commit 61584e0eb2fb288b5fed1954d58d26268d01c1bf Author: root Date: Mon Aug 17 19:16:42 2020 -0400 Initial commit diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100755 index 0000000..1811a34 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,27 @@ +version: "3" +services: + + lotgd-web: + image: kizaing/lotgd-web + ports: + - "8007:80" + environment: + - TZ=America/Toronto + volumes: + - /media/Cerberus/Backup/Docker/LotGD/lotgd-web/site:/var/www/lotgd + depends_on: + - lotgd-php + - lotgd-db + links: + - lotgd-php + - lotgd-db + lotgd-php: + image: kizaing/lotgd-php + environment: + - TZ=America/Toronto + volumes: + - /media/Cerberus/Backup/Docker/LotGD/lotgd-web/site:/var/www/lotgd + lotgd-db: + image: kizaing/lotgd-db + environment: + - MYSQL_ROOT_PASSWORD=lotgd diff --git a/lotgd-db/Dockerfile b/lotgd-db/Dockerfile new file mode 100755 index 0000000..0ffbcec --- /dev/null +++ b/lotgd-db/Dockerfile @@ -0,0 +1,10 @@ +FROM mariadb + +MAINTAINER Chris P + +ENV MYSQL_ROOT_PASSWORD "lotgd" + +#Copies in the pre-populated database files +COPY mysql /var/lib/mysql + +EXPOSE 3306 diff --git a/lotgd-db/lotgd.sql b/lotgd-db/lotgd.sql new file mode 100755 index 0000000..5743087 --- /dev/null +++ b/lotgd-db/lotgd.sql @@ -0,0 +1,1181 @@ +-- MySQL dump 10.17 Distrib 10.3.22-MariaDB, for debian-linux-gnu (x86_64) +-- +-- Host: localhost Database: lotgd +-- ------------------------------------------------------ +-- Server version 10.3.22-MariaDB-1ubuntu1 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Current Database: `lotgd` +-- + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `lotgd` /*!40100 DEFAULT CHARACTER SET utf8mb4 */; + +USE `lotgd`; + +-- +-- Table structure for table `accounts` +-- + +DROP TABLE IF EXISTS `accounts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `accounts` ( + `acctid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(60) NOT NULL, + `sex` tinyint(4) unsigned NOT NULL DEFAULT 0, + `specialty` varchar(20) NOT NULL, + `experience` int(11) unsigned NOT NULL DEFAULT 0, + `gold` int(11) unsigned NOT NULL DEFAULT 0, + `weapon` varchar(50) NOT NULL DEFAULT 'Fists', + `armor` varchar(50) NOT NULL DEFAULT 'T-Shirt', + `seenmaster` int(4) unsigned NOT NULL DEFAULT 0, + `level` int(11) unsigned NOT NULL DEFAULT 1, + `defense` int(11) unsigned NOT NULL DEFAULT 1, + `attack` int(11) unsigned NOT NULL DEFAULT 1, + `alive` int(11) unsigned NOT NULL DEFAULT 1, + `goldinbank` int(11) NOT NULL DEFAULT 0, + `marriedto` int(11) unsigned NOT NULL DEFAULT 0, + `spirits` int(4) NOT NULL DEFAULT 0, + `laston` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `hitpoints` int(11) NOT NULL DEFAULT 10, + `maxhitpoints` int(11) unsigned NOT NULL DEFAULT 10, + `gems` int(11) unsigned NOT NULL DEFAULT 0, + `weaponvalue` int(11) unsigned NOT NULL DEFAULT 0, + `armorvalue` int(11) unsigned NOT NULL DEFAULT 0, + `location` varchar(25) NOT NULL DEFAULT 'Degolburg', + `turns` int(11) unsigned NOT NULL DEFAULT 10, + `title` varchar(25) NOT NULL, + `password` varchar(32) NOT NULL, + `badguy` text NOT NULL, + `companions` text NOT NULL, + `allowednavs` mediumtext NOT NULL, + `loggedin` tinyint(4) unsigned NOT NULL DEFAULT 0, + `resurrections` int(11) unsigned NOT NULL DEFAULT 0, + `superuser` int(11) unsigned NOT NULL DEFAULT 1, + `weapondmg` int(11) NOT NULL DEFAULT 0, + `armordef` int(11) NOT NULL DEFAULT 0, + `age` int(11) unsigned NOT NULL DEFAULT 0, + `charm` int(11) unsigned NOT NULL DEFAULT 0, + `specialinc` varchar(50) NOT NULL, + `specialmisc` text NOT NULL, + `login` varchar(50) NOT NULL, + `lastmotd` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `playerfights` int(11) unsigned NOT NULL DEFAULT 3, + `lasthit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `seendragon` tinyint(4) unsigned NOT NULL DEFAULT 0, + `dragonkills` int(11) unsigned NOT NULL DEFAULT 0, + `locked` tinyint(4) unsigned NOT NULL DEFAULT 0, + `restorepage` varchar(128) DEFAULT NULL, + `hashorse` tinyint(4) unsigned NOT NULL DEFAULT 0, + `bufflist` text NOT NULL, + `gentime` double unsigned NOT NULL DEFAULT 0, + `gentimecount` int(11) unsigned NOT NULL DEFAULT 0, + `lastip` varchar(40) NOT NULL, + `uniqueid` varchar(32) DEFAULT NULL, + `dragonpoints` text NOT NULL, + `boughtroomtoday` tinyint(4) NOT NULL DEFAULT 0, + `emailaddress` varchar(128) NOT NULL, + `emailvalidation` varchar(32) NOT NULL, + `sentnotice` int(11) NOT NULL DEFAULT 0, + `prefs` text NOT NULL, + `pvpflag` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `transferredtoday` int(11) unsigned NOT NULL DEFAULT 0, + `soulpoints` int(11) unsigned NOT NULL DEFAULT 0, + `gravefights` int(11) unsigned NOT NULL DEFAULT 0, + `hauntedby` varchar(50) NOT NULL, + `deathpower` int(11) unsigned NOT NULL DEFAULT 0, + `gensize` int(11) unsigned NOT NULL DEFAULT 0, + `recentcomments` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `donation` int(11) unsigned NOT NULL DEFAULT 0, + `donationspent` int(11) unsigned NOT NULL DEFAULT 0, + `donationconfig` text NOT NULL, + `referer` int(11) unsigned NOT NULL DEFAULT 0, + `refererawarded` tinyint(1) NOT NULL DEFAULT 0, + `bio` varchar(255) NOT NULL, + `race` varchar(25) NOT NULL DEFAULT '0', + `biotime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `banoverride` tinyint(4) DEFAULT 0, + `buffbackup` text DEFAULT NULL, + `amountouttoday` int(11) unsigned NOT NULL DEFAULT 0, + `pk` tinyint(3) unsigned NOT NULL DEFAULT 0, + `dragonage` int(11) unsigned NOT NULL DEFAULT 0, + `bestdragonage` int(11) unsigned NOT NULL DEFAULT 0, + `ctitle` varchar(25) NOT NULL, + `beta` tinyint(3) unsigned NOT NULL DEFAULT 0, + `slaydragon` tinyint(4) unsigned NOT NULL DEFAULT 0, + `fedmount` tinyint(4) unsigned NOT NULL DEFAULT 0, + `regdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `clanid` int(11) unsigned NOT NULL DEFAULT 0, + `clanrank` tinyint(4) unsigned NOT NULL DEFAULT 0, + `clanjoindate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`acctid`), + KEY `name` (`name`), + KEY `level` (`level`), + KEY `login` (`login`), + KEY `alive` (`alive`), + KEY `laston` (`laston`), + KEY `lasthit` (`lasthit`), + KEY `emailaddress` (`emailaddress`), + KEY `clanid` (`clanid`), + KEY `locked` (`locked`,`loggedin`,`laston`), + KEY `referer` (`referer`), + KEY `uniqueid` (`uniqueid`), + KEY `emailvalidation` (`emailvalidation`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `accounts` +-- + +LOCK TABLES `accounts` WRITE; +/*!40000 ALTER TABLE `accounts` DISABLE KEYS */; +INSERT INTO `accounts` VALUES (1,'`%Admin `&admin`0',0,'MP',0,0,'Fists','T-Shirt',0,1,1,1,1,0,0,1,'2020-08-12 19:11:19',10,10,0,0,0,'Degolburg',11,'','a31e0f49d2dc4381072e30ee5a313237','','a:0:{}','a:0:{}',0,0,3923967,0,0,1,0,'','','admin','0000-00-00 00:00:00',3,'2020-08-12 19:08:59',0,0,0,'news.php',0,'a:0:{}',3.5302112102506,32,'192.168.1.133','8cec52f5b954fa644bc0bc91650fb69d','a:0:{}',0,'','',0,'a:1:{s:12:\"ihavenocheer\";i:0;}','0000-00-00 00:00:00',0,55,10,'',0,721701,'0000-00-00 00:00:00',0,0,'',0,0,'','Human','0000-00-00 00:00:00',0,NULL,0,0,0,0,'`%Admin',0,0,0,'2020-08-12 19:08:34',0,0,'0000-00-00 00:00:00'); +/*!40000 ALTER TABLE `accounts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `accounts_output` +-- + +DROP TABLE IF EXISTS `accounts_output`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `accounts_output` ( + `acctid` int(11) unsigned NOT NULL, + `output` mediumtext NOT NULL, + PRIMARY KEY (`acctid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `accounts_output` +-- + +LOCK TABLES `accounts_output` WRITE; +/*!40000 ALTER TABLE `accounts_output` DISABLE KEYS */; +INSERT INTO `accounts_output` VALUES (1,'\r\n\r\n\r\n\r\n Degolburg Square\r\n \r\n \r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\'\'\'\'\'\'
\'\'• Degolburg Square\'\'
\'\'\'\'\'\'
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\'\'\'\'\'\'
\'\'
\r\n—City Gates—
\r\n\r\nForest
\r\n\r\nSlay Other Players
\r\n\r\nQuit to the fields
\r\n\r\nMercenary Camp
\r\n\n\r\n—Blades Boulevard—
\r\n\r\nBluspring\'s Warrior Training
\r\n\r\nJCP\'s Hunter Lodge
\r\n\n\r\n—Market Street—
\r\n\r\nMightyE\'s Weaponry
\r\n\r\nPegasus Armor
\r\n\r\nYe Olde Bank
\r\n\r\nZe Gypsy Tent
\r\n\n\r\n—Tavern Street—
\r\n\r\nThe Boar\'s Head Inn
\r\n\r\nMerick\'s Stables
\r\n\r\nThe Gardens
\r\n\r\nCurious Looking Rock
\r\n\r\nClan Halls
\r\n\n\r\n—Info—
\r\n\r\n(?) F.A.Q. (newbies start here)
\r\n\r\nDaily News
\r\n\r\nList Warriors
\r\n\r\nHall o\' Fame
\r\n\n\r\n—Other—
\r\n\r\nPreferences
\r\n\n\r\n—Superuser—
\r\n\r\n(,) Comment Moderation
\r\n\r\n(X) Superuser Grotto
\r\n\r\n(/) New Day
\r\n\n
\'\'
\'\'\'\'\'\'
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\'\'\'\'\'\'
\'\'\r\n \r\n \r\n \r\n \r\n \r\n
\r\n\n\n
Degolburg Square
The village of Degolburg hustles and bustles. No one really notices that you\'re standing there. You see various shops and businesses along main street. There is a curious looking rock to one side. On every side the village is surrounded by deep dark forest.
\n
\n\nThe clock on the inn reads
4:45 am.
\n\n
\n
Nearby some villagers talk:
\n\n\n\n\n\n\n\n\n\n\n\n\n
\n
Speak
\n\n\n
\n\n\n\n\r\n \n\n\n
\n\r\n \r\n \n\n\n\n\n\n
\n\n
\n\n\n\n\n\n<< First Unseen < Previous\n Refresh \nNext > Last Page >>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\'\'\'\'\'\'
\'\'\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
Vital Info
NameAdmin admin
Level1
Hitpoints10/10
Turns11
Attack1
Defense1
SpiritsHigh
RaceHuman
Personal Info
Gold0
Gems0
Experience0
Equipment Info
WeaponFists
ArmorT-Shirt
Buffs:
None
\r\n

 

\n\n\n\n\n\n\n\n\n\n\n\n
\n\n\n\n\n\n\n\n\n\n\n\n
\'\'
\'\'\'\'\'\'
\r\n
\r\n
\'\'
\'\'\'\'\'\'
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\'\'\'\'\'\'
\'\'\r\n \r\n \r\n \r\n \r\n \r\n
\n\n\'Creative\nThis work is licensed under a Creative Commons License.
\n\n\nGame Design and Code: Copyright © 2002-2005, Eric Stevens & JT Traub, © 2006-2007, Dragonprime Development Team
Design: Jade Template © Josh Canning 2004 of HFS
View PHP Source
Version: 1.1.2 Dragonprime Edition
(Page gen: 0.592s / 314 queries (0.554s), Ave: 0.11s - 3.53/32)
\r\n
\'\'
\'\'\'\'\'\'
\r\n
\r\n\r\n\r\n'); +/*!40000 ALTER TABLE `accounts_output` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `armor` +-- + +DROP TABLE IF EXISTS `armor`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `armor` ( + `armorid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `armorname` varchar(128) DEFAULT NULL, + `value` int(11) NOT NULL DEFAULT 0, + `defense` int(11) NOT NULL DEFAULT 1, + `level` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`armorid`) +) ENGINE=InnoDB AUTO_INCREMENT=196 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `armor` +-- + +LOCK TABLES `armor` WRITE; +/*!40000 ALTER TABLE `armor` DISABLE KEYS */; +INSERT INTO `armor` VALUES (1,'Fuzzy Slippers',48,1,0),(2,'Flannel Pajamas',225,2,0),(3,'Homespun Longjohns',585,3,0),(4,'Homespun Undershirt',990,4,0),(5,'Knitted Socks',1575,5,0),(6,'Knitted Gloves',2250,6,0),(7,'Old Leather Boots',2790,7,0),(8,'Homespun Pants',3420,8,0),(9,'Homespun Tunic',4230,9,0),(10,'Gypsy Cape',5040,10,0),(11,'Old Leather Cap',5850,11,0),(12,'Old Leather Bracers',6840,12,0),(13,'Traveller\'s Shield',8010,13,0),(14,'Old Leather Pants',9000,14,0),(15,'Old Leather Tunic',10350,15,0),(16,'Flip-Flops',48,1,1),(17,'Swimsuit and Towel',225,2,1),(18,'Cotton Undershirt',585,3,1),(19,'Wool Socks',990,4,1),(20,'Wool Gloves',1575,5,1),(21,'Leather Boots',2250,6,1),(22,'Leather Cap',2790,7,1),(23,'Leather Bracers',3420,8,1),(24,'Leather Leggings',4230,9,1),(25,'Leather Tunic',5040,10,1),(26,'Hooded Leather Cape',5850,11,1),(27,'Deerskin Leggings',6840,12,1),(28,'Deerskin Belt',8010,13,1),(29,'Deerskin Tunic',9000,14,1),(30,'Small Rawhide Shield',10350,15,1),(31,'Workboots',48,1,2),(32,'Overalls',225,2,2),(33,'Sturdy Leather Gloves',585,3,2),(34,'Sturdy Leather Bracers',990,4,2),(35,'Sturdy Leather Boots',1575,5,2),(36,'Sturdy Leather Helm',2250,6,2),(37,'Sturdy Leather Pants',2790,7,2),(38,'Sturdy Leather Tunic',3420,8,2),(39,'Sturdy Leather Cloak',4230,9,2),(40,'Woodsman\'s Helm',5040,10,2),(41,'Woodsman\'s Gauntlets',5850,11,2),(42,'Woodsman\'s Bracers',6840,12,2),(43,'Woodsman\'s Greaves',8010,13,2),(44,'Woodsman\'s Tunic',9000,14,2),(45,'Woodsman\'s Kite Shield',10350,15,2),(46,'Showercap and Towel',48,1,3),(47,'Bathrobe',225,2,3),(48,'Wolfskin Gloves',585,3,3),(49,'Wolfskin-lined Boots',990,4,3),(50,'Wolfskin Bracers',1575,5,3),(51,'Wolfskin Pants',2250,6,3),(52,'Wolfskin Tunic',2790,7,3),(53,'Hooded Wolfskin Cape',3420,8,3),(54,'Wolfmaster\'s Bracers',4230,9,3),(55,'Wolfmaster\'s Gauntlets',5040,10,3),(56,'Wolfmasters Helm',5850,11,3),(57,'Wolfmaster\'s Leggings',6840,12,3),(58,'Wolfmaster\'s Belted Jerkin',8010,13,3),(59,'Wolfhide Cape',9000,14,3),(60,'Shield of the Wolf Master',10350,15,3),(61,'Sweat Pants',48,1,4),(62,'Sweat Shirt',225,2,4),(63,'Studded Leather Helm',585,3,4),(64,'Studded Leather Gauntlets',990,4,4),(65,'Hardened Leather Boots',1575,5,4),(66,'Studded Leather Leggings',2250,6,4),(67,'Studded Leather Tunic',2790,7,4),(68,'Tanner\'s Cape',3420,8,4),(69,'Rusty Chainmail Helm',4230,9,4),(70,'Rusty Chainmail Gauntlets',5040,10,4),(71,'Rusty Chainmail Bracers',5850,11,4),(72,'Rusty Chainmail Boots',6840,12,4),(73,'Rusty Chainmail Greaves',8010,13,4),(74,'Rusty Chainmail Tunic',9000,14,4),(75,'Large Iron Buckler',10350,15,4),(76,'Bunny Slippers',48,1,5),(77,'Feety Pajamas',225,2,5),(78,'Comfortable Leather Undergarments',585,3,5),(79,'Heavy Chainmail Helm',990,4,5),(80,'Heavy Chainmail Gauntlets',1575,5,5),(81,'Heavy Chainmail Bracers',2250,6,5),(82,'Heavy Chainmail Boots',2790,7,5),(83,'Heavy Chainmail Greaves',3420,8,5),(84,'Heavy Chainmail Tunic',4230,9,5),(85,'Dragon Soldier\'s Bracers',5040,10,5),(86,'Dragon Soldier\'s Gauntlets',5850,11,5),(87,'Dragon Soldier\'s Boots',6840,12,5),(88,'Dragon Soldier\'s Greaves',8010,13,5),(89,'Dragon Soldier\'s Chestplate',9000,14,5),(90,'Dragon Soldier\'s Shield',10350,15,5),(91,'Bluejeans',48,1,6),(92,'Flannel Shirt',225,2,6),(93,'Well Crafted Bronze Helm',585,3,6),(94,'Well Crafted Bronze Gauntlets',990,4,6),(95,'Well Crafted Bronze Bracers',1575,5,6),(96,'Well Crafted Bronze Boots',2250,6,6),(97,'Well Crafted Bronze Greaves',2790,7,6),(98,'Well Crafted Bronze Chestplate',3420,8,6),(99,'Enchanted Bronze Helm',4230,9,6),(100,'Enchanted Bronze Gauntlets',5040,10,6),(101,'Enchanted Bronze Bracers',5850,11,6),(102,'Enchanted Bronze Boots',6840,12,6),(103,'Enchanted Bronze Greaves',8010,13,6),(104,'Enchanted Bronze Chestplate',9000,14,6),(105,'Hooded Unicorn Skin Cloak',10350,15,6),(106,'Barrel',48,1,7),(107,'Lampshade',225,2,7),(108,'Perfectly Crafted Steel Helm',585,3,7),(109,'Perfectly Crafted Steel Gauntlets',990,4,7),(110,'Perfectly Crafted Steel Boots',1575,5,7),(111,'Perfectly Crafted Steel Bracers',2250,6,7),(112,'Perfectly Crafted Steel Greaves',2790,7,7),(113,'Perfectly Crafted Steel Chestplate',3420,8,7),(114,'Griffon-Feather Cloak',4230,9,7),(115,'Dwarven Chainmail Helm',5040,10,7),(116,'Dwarven Chainmail Gauntlets',5850,11,7),(117,'Dwarven Chainmail Boots',6840,12,7),(118,'Dwarven Chainmail Bracers',8010,13,7),(119,'Dwarven Chainmail Greaves',9000,14,7),(120,'Dwarven Chainmail Chestplate',10350,15,7),(121,'Fig Leaf',48,1,8),(122,'Kilt',225,2,8),(123,'Majestic Gold Helm',585,3,8),(124,'Majestic Gold Gauntlets',990,4,8),(125,'Majestic Gold Boots',1575,5,8),(126,'Bracers',2250,6,8),(127,'Majestic Gold Greaves',2790,7,8),(128,'Majestic Gold Chestplate',3420,8,8),(129,'Majestic Gold Shield',4230,9,8),(130,'Gold-Threaded Cloak',5040,10,8),(131,'Enchanted Ruby Ring',5850,11,8),(132,'Enchanted Sapphire Ring',6840,12,8),(133,'Enchanted Jade Ring',8010,13,8),(134,'Enchanted Amethyst Ring',9000,14,8),(135,'Enchanted Diamond Ring',10350,15,8),(136,'Button',48,1,9),(137,'Elven Silk Nightclothes',225,2,9),(138,'Elven Silk Gloves',585,3,9),(139,'Elven Silk Slippers',990,4,9),(140,'Elven Silk Wristband',1575,5,9),(141,'Leggings',2250,6,9),(142,'Elven Silk Tunic',2790,7,9),(143,'Elven Silk Cloak',3420,8,9),(144,'Ring of Night',4230,9,9),(145,'Ring of Day',5040,10,9),(146,'Ring of Solitude',5850,11,9),(147,'Ring of Peace',6840,12,9),(148,'Ring of Courage',8010,13,9),(149,'Ring of Virtue',9000,14,9),(150,'Ring of Life',10350,15,9),(151,'Pegasus\' Hooded Cloak',5040,10,10),(152,'Pegasus\' Chestplate',4230,9,10),(153,'Pegasus\' Greaves',3420,8,10),(154,'Pegasus\' Boots',2790,7,10),(155,'Pegasus\' Gorget',2250,6,10),(156,'Pegasus\' Bracers',1575,5,10),(157,'Pegasus\' Gauntlets',990,4,10),(158,'Pegasus\' Helm',585,3,10),(159,'Platform Shoes',225,2,10),(160,'Leisure Suit',48,1,10),(161,'Pegasus Feather Pendant',5850,11,10),(162,'Pegasus Feather Belt',6840,12,10),(163,'Pegasus\' Emblazoned Shield',8010,13,10),(164,'Pegasus\' Emblazoned Ring',9000,14,10),(165,'Pegasus\' Emblazoned Crown',10350,15,10),(166,'New Clothes',48,1,11),(167,'Chicken Suit',225,2,11),(168,'Gauntlets of Grace',585,3,11),(169,'Bracer of Beauty',990,4,11),(170,'Helm of Health',1575,5,11),(171,'Greaves of Good Fortune',2250,6,11),(172,'Boots of Bravery',2790,7,11),(173,'Tunic of Tolerance',3420,8,11),(174,'Cloak of Confidence',4230,9,11),(175,'Ring of Righteousness',5040,10,11),(176,'Necklace of Narcissism',5850,11,11),(177,'Pendant of Power',6840,12,11),(178,'Breastplate of Benevolence',8010,13,11),(179,'Shield of Superiority',9000,14,11),(180,'Scepter of Strength',10350,15,11),(181,'Dragon Skin Leather Helm',48,1,12),(182,'Dragon Skin Leather Gauntlets',225,2,12),(183,'Dragon Skin Leather Boots',585,3,12),(184,'Dragon Skin Leather Bracers',990,4,12),(185,'Dragon Skin Leather Leggings',1575,5,12),(186,'Dragon Skin Leather Tunic',2250,6,12),(187,'Dragon Skin Leather Cloak',2790,7,12),(188,'Dragon Scale Helm',3420,8,12),(189,'Dragon Scale Gauntlets',4230,9,12),(190,'Dragon Scale Boots',5040,10,12),(191,'Dragon Scale Bracers',5850,11,12),(192,'Dragon Scale Greaves',6840,12,12),(193,'Dragon Scale Chestplate',8010,13,12),(194,'Dragon Scale Cloak',9000,14,12),(195,'Dragon Talon Shield',10350,15,12); +/*!40000 ALTER TABLE `armor` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `bans` +-- + +DROP TABLE IF EXISTS `bans`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bans` ( + `ipfilter` varchar(15) NOT NULL, + `uniqueid` varchar(32) NOT NULL, + `banexpire` datetime DEFAULT NULL, + `banreason` text NOT NULL, + `banner` varchar(50) NOT NULL, + `lasthit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + KEY `banexpire` (`banexpire`), + KEY `uniqueid` (`uniqueid`), + KEY `ipfilter` (`ipfilter`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `bans` +-- + +LOCK TABLES `bans` WRITE; +/*!40000 ALTER TABLE `bans` DISABLE KEYS */; +/*!40000 ALTER TABLE `bans` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `clans` +-- + +DROP TABLE IF EXISTS `clans`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `clans` ( + `clanid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `clanname` varchar(255) NOT NULL, + `clanshort` varchar(5) NOT NULL, + `clanmotd` text DEFAULT NULL, + `clandesc` text DEFAULT NULL, + `motdauthor` int(11) unsigned NOT NULL DEFAULT 0, + `descauthor` int(11) unsigned NOT NULL DEFAULT 0, + `customsay` varchar(15) NOT NULL, + PRIMARY KEY (`clanid`), + KEY `clanname` (`clanname`), + KEY `clanshort` (`clanshort`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `clans` +-- + +LOCK TABLES `clans` WRITE; +/*!40000 ALTER TABLE `clans` DISABLE KEYS */; +/*!40000 ALTER TABLE `clans` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `commentary` +-- + +DROP TABLE IF EXISTS `commentary`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `commentary` ( + `commentid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `section` varchar(20) DEFAULT NULL, + `author` int(11) unsigned NOT NULL DEFAULT 0, + `comment` varchar(200) NOT NULL, + `postdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`commentid`), + KEY `section` (`section`), + KEY `postdate` (`postdate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `commentary` +-- + +LOCK TABLES `commentary` WRITE; +/*!40000 ALTER TABLE `commentary` DISABLE KEYS */; +/*!40000 ALTER TABLE `commentary` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `companions` +-- + +DROP TABLE IF EXISTS `companions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `companions` ( + `companionid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `category` varchar(255) NOT NULL, + `description` text NOT NULL, + `attack` int(6) unsigned NOT NULL DEFAULT 1, + `attackperlevel` int(6) unsigned NOT NULL DEFAULT 0, + `defense` int(6) unsigned NOT NULL DEFAULT 1, + `defenseperlevel` int(6) unsigned NOT NULL DEFAULT 0, + `maxhitpoints` int(6) unsigned NOT NULL DEFAULT 10, + `maxhitpointsperlevel` int(6) unsigned NOT NULL DEFAULT 10, + `abilities` text NOT NULL, + `cannotdie` tinyint(4) NOT NULL DEFAULT 0, + `cannotbehealed` tinyint(4) NOT NULL DEFAULT 1, + `companionlocation` varchar(25) NOT NULL DEFAULT 'all', + `companionactive` tinyint(25) NOT NULL DEFAULT 1, + `companioncostdks` tinyint(4) NOT NULL DEFAULT 0, + `companioncostgems` int(6) NOT NULL DEFAULT 0, + `companioncostgold` int(10) NOT NULL DEFAULT 0, + `jointext` text NOT NULL, + `dyingtext` varchar(255) NOT NULL, + `allowinshades` tinyint(4) NOT NULL DEFAULT 0, + `allowinpvp` tinyint(4) NOT NULL DEFAULT 0, + `allowintrain` tinyint(4) NOT NULL DEFAULT 0, + PRIMARY KEY (`companionid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `companions` +-- + +LOCK TABLES `companions` WRITE; +/*!40000 ALTER TABLE `companions` DISABLE KEYS */; +INSERT INTO `companions` VALUES (1,'Mortimer teh javelin man','Knight','A rough and ready warrior. Beneath his hardened exterior, one can detect a man of strong honour.',5,2,1,2,20,20,'a:4:{s:5:\"fight\";s:1:\"1\";s:4:\"heal\";s:1:\"0\";s:5:\"magic\";s:1:\"0\";s:6:\"defend\";b:0;}',0,0,'Degolburg',1,0,4,573,'`^Greetings unto thee, my friend. Let us go forth and conquer the evils of this world together!','`4Argggggh! I am slain! Shuffling off my mortal coil. Fare thee well, my friends.',1,0,0),(2,'Florenz','Healer','With a slight build, Florenz is better suited as a healer than a fighter.',1,1,5,5,15,10,'a:4:{s:4:\"heal\";s:1:\"2\";s:5:\"magic\";s:1:\"0\";s:5:\"fight\";b:0;s:6:\"defend\";b:0;}',0,0,'Degolburg',1,0,3,1000,'Thank ye for thy faith in my skills. I shall endeavour to keep ye away from Ramius\' claws.','O Discordia!',1,0,0),(3,'Grizzly Bear','Wild Beasts','You look at the beast knowing that this Grizzly Bear will provide an effective block against attack with its long curved claws and massive body of silver-tipped fur.',1,2,5,2,25,25,'a:4:{s:5:\"fight\";s:1:\"0\";s:4:\"heal\";s:1:\"0\";s:5:\"magic\";s:1:\"0\";s:6:\"defend\";s:1:\"1\";}',0,0,'Qexelcrag',1,0,4,600,'You hear a low, deep belly growl coming from a shadowed corner of the Bestiarium. Curious you walk over to investigate your purchase. As you approach a large form shuffles on all four legs towards the front of its hewn rock enclosure.`n`nThe hunched shoulders of the largest bear you have ever seen ripple as its front haunches push against the ground causing it to stand on its hind legs. It makes another low growl before dropping back on all four legs to follow you on your adventure.','The grizzly gets scared by the multitude of blows and hits he has to take and flees into the forest.',1,0,0); +/*!40000 ALTER TABLE `companions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creatures` +-- + +DROP TABLE IF EXISTS `creatures`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `creatures` ( + `creatureid` int(11) NOT NULL AUTO_INCREMENT, + `creaturename` varchar(50) DEFAULT NULL, + `creaturelevel` int(11) DEFAULT NULL, + `creatureweapon` varchar(50) DEFAULT NULL, + `creaturelose` varchar(120) DEFAULT NULL, + `creaturewin` varchar(120) DEFAULT NULL, + `creaturegold` int(11) DEFAULT NULL, + `creatureexp` int(11) DEFAULT NULL, + `creaturehealth` int(11) DEFAULT NULL, + `creatureattack` int(11) DEFAULT NULL, + `creaturedefense` int(11) DEFAULT NULL, + `creatureaiscript` text DEFAULT NULL, + `createdby` varchar(50) DEFAULT NULL, + `forest` tinyint(4) NOT NULL DEFAULT 0, + `graveyard` tinyint(4) NOT NULL DEFAULT 0, + `oldcreatureexp` int(11) DEFAULT NULL, + PRIMARY KEY (`creatureid`), + KEY `creaturelevel` (`creaturelevel`) +) ENGINE=InnoDB AUTO_INCREMENT=321 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `creatures` +-- + +LOCK TABLES `creatures` WRITE; +/*!40000 ALTER TABLE `creatures` DISABLE KEYS */; +INSERT INTO `creatures` VALUES (1,'Thieving Kender',1,'Whirling Hoopak','You only wish you could pickpocket your money back from the thief.',NULL,36,14,10,1,1,NULL,'Appleshiner',1,0,NULL),(2,'Rude Student',1,'Worn Textbook','You have sent this student to permanent detention.','',36,14,10,1,1,'','Appleshiner',1,0,NULL),(3,'Baby Unicorn',1,'Blunt Horn','You feel like a real jerk killing something so pretty.','',36,14,10,1,1,'','Appleshiner',1,0,NULL),(4,'Small Purple Mouse',1,'Lashing pink tail','It is written in black and white: this strange technicolor mouse is no more.','',36,14,10,1,1,'','Appleshiner',1,0,NULL),(5,'Grunting Piggy',1,'Wiggly Snout','Mmm...Bacon',NULL,36,14,10,1,1,NULL,'Appleshiner',1,0,NULL),(6,'Dumb Old Eyesore',2,'Nagging complaints','All she ever did was nag...nag...nag...',NULL,97,24,21,3,3,NULL,'Appleshiner',1,0,NULL),(7,'Pygmy Marmoset',2,'Pieces of treebark','The strange little monkey falls from the trees and lies still.',NULL,97,24,21,3,3,NULL,'Appleshiner',1,0,NULL),(8,'Burly Man',15,'Amazing Absorbency','Fantasize, fantasize about Burly ...Eeeh, Eeeh, Eeeh!',NULL,531,189,155,29,21,NULL,'Bluspring',1,0,NULL),(9,'Screaming Banshee',2,'Hauntingly Beautiful Voice','You plunge your weapon into her breast, silencing her song.','',97,24,21,3,3,'','Appleshiner',1,1,NULL),(10,'Ursa Minor',2,'Twinkling Lights','After an astronomical battle, Ursa Minor is the one seeing stars',NULL,97,24,21,3,3,NULL,'Appleshiner',1,0,NULL),(11,'Stone Troll',2,'Gaping Maw','That troll is stone cold ugly.',NULL,97,24,21,3,3,NULL,'Appleshiner',1,0,NULL),(12,'Slithering Asp',2,'Hypnotic eyes','You break the deadly gaze of the snake to save your own life.','',97,24,21,3,3,'','Appleshiner',1,0,NULL),(13,'Windan The Barbarian',2,'Feathered Spear','He really was just a feather-weight',NULL,97,24,21,3,3,NULL,'Appleshiner',1,0,NULL),(14,'Studious Young Sorceror',2,'Newly memorized spells','Perhaps she should have studied harder.','',97,24,21,3,3,'','Appleshiner',1,0,NULL),(15,'Four and Twenty Blackbirds',3,'Freshly Baked Pies','Now isn\'t this a dainty dish to set before a king?',NULL,148,34,32,5,4,NULL,'Appleshiner',1,0,NULL),(16,'Amazon',3,'Bow and Arrow','The beautiful warrior lass has lost a battle for the first time.',NULL,148,34,32,5,4,NULL,'Appleshiner',1,0,NULL),(17,'Overbearing Mother',3,'9pm Curfew','With one fell swoop you save your social life!','',148,34,32,5,4,'','Appleshiner',1,0,NULL),(18,'Huge Bald Programmer',3,'Shining Forehead','You feel as if you have seen this man before in the village.','',148,34,32,5,4,'','Appleshiner',1,0,NULL),(19,'Someone\'s Grandfather',3,'Stories that go nowhere','This reminds you of the time you needed a new heel for your shoe.','',148,34,32,5,4,'','Appleshiner',1,0,NULL),(20,'Juvenile Delinquent',3,'Poor Attitude','With a satisfying thump, you knock the smirk right off his face.','',148,34,32,5,4,'','Appleshiner',1,0,NULL),(21,'Beautiful Woodland Sprite',3,'Kindness and tranquility','You really cut that wood sprite down to size.','',148,34,32,5,4,'','Appleshiner',1,0,NULL),(22,'Society Belle',3,'Southern Charm','Now she will never be on time for the ball!',NULL,148,34,32,5,4,NULL,'Appleshiner',1,0,NULL),(23,'Giant Goldfish Cracker',3,'Annoying Commercial Jingles','Now *there* is a fish that smiled till you bit his head off.',NULL,148,34,32,5,4,NULL,'Appleshiner',1,0,NULL),(24,'Angry Mob',4,'Torches','There is no justice for an angry mob.','',162,45,43,7,6,'','Appleshiner',1,0,NULL),(25,'Polar Bear',4,'Terrible claws','That bear really needed an attitude adjustment.','',162,45,43,7,6,'','Appleshiner',1,0,NULL),(26,'Decaying Skeleton',4,'Rusty Sword','His leg ought to make a good toy for your dog.',NULL,162,45,43,7,6,NULL,'Appleshiner',1,1,NULL),(27,'Willie the Wonder Hampster',4,'Nuclear Sunflower Seeds','You smile a grim smile at Willie and quietly munch on some seeds.','',162,45,43,7,6,'','Appleshiner',1,0,NULL),(28,'Winged Demon Of Death',4,'Red Glare','You cut off the Demon\'s head, to be sure of its death.',NULL,162,45,43,7,6,NULL,'foilwench',1,1,NULL),(29,'Small Dragon',4,'Hot air','For one moment you thought THIS was the Green Dragon, but alas not.',NULL,162,45,43,7,6,NULL,'Appleshiner',1,0,NULL),(30,'Monstrous Dustbunny',4,'Sneezing fits','You sweep the poor bunny under the rug when no one is looking.','',162,45,43,7,6,'','Appleshiner',1,0,NULL),(31,'Small Rabbit',4,'Sharp Pointy Teeth','To think you almost ran away!',NULL,162,45,43,7,6,NULL,'Appleshiner',1,0,NULL),(32,'Mature Unicorn',5,'Powerful Horn','A unicorn is a thing of beauty, even in death.','',198,55,53,9,7,'','Appleshiner',1,0,NULL),(33,'Gnome Necromancer',5,'Skeleton Familiar','Once you killed its familiar that Gnome was really weak.',NULL,198,55,53,9,7,NULL,'Appleshiner',1,1,NULL),(34,'Purple Dinosaur',5,'Helpful Nature','There seems to be a person inside that strange dino. You wonder why.',NULL,198,55,53,9,7,NULL,'Appleshiner',1,0,NULL),(35,'Orc Emmisary',5,'Diplomacy','You never were the diplomatic type.',NULL,198,55,53,9,7,NULL,'Appleshiner',1,0,NULL),(36,'Dark Spiritling',5,'Dark Magic','The spiritling gasps a final breath as you end its pitiful life.','',198,55,53,9,7,'','Appleshiner',1,1,NULL),(37,'Enchanted Toilet',5,'Ninja Flushing Action','That was just weird.','',198,55,53,9,7,'','Appleshiner',1,0,NULL),(38,'Giant Water Elemental',5,'Torrential Downpours','The giant creature is reduced a meager spring shower.','',198,55,53,9,7,'','Appleshiner',1,0,NULL),(39,'Violins',5,'Off-Key notes','Won\'t someone PLEASE stop the violins?',NULL,198,55,53,9,7,NULL,'Appleshiner',1,0,NULL),(40,'Whirled Peas',5,'Green Slime','We should all pray for whirled peas.',NULL,198,55,53,9,7,NULL,'Appleshiner',1,0,NULL),(41,'Magic Mushroom',6,'Swirling Colors','Guess you don\'t need to go ask Alice now.','',234,66,64,11,8,'','Appleshiner',1,0,NULL),(42,'Invisible Man',6,'Something Invisible and Sharp','You really aren\'t sure if it is dead, or just hiding...after all it is invisible.','',234,66,64,11,8,'','Appleshiner',1,0,NULL),(43,'Clown of Death',6,'Balloon Animals from Beyond','You give the clown\'s nose a honk just for fun before you leave.','',234,66,64,11,8,'','Appleshiner',1,1,NULL),(44,'Heart of Stone',6,'Unromantic Thoughts','Aww, now look, you broke its heart!',NULL,234,66,64,11,8,NULL,'Appleshiner',1,0,NULL),(45,'Troll Warrior',6,'Steel Broadsword','Wow, he smelled bad enough alive, can you imagine how he\'ll smell tomorrow?',NULL,234,66,64,11,8,NULL,'Appleshiner',1,0,NULL),(46,'Bettie the Amazing Kung-Fu Butterfly',6,'Stupendous Kung-Fu Wings','You survived a battle to the death with a butterfly. You must be so proud.',NULL,234,66,64,11,8,NULL,'Appleshiner',1,0,NULL),(47,'Golden Goose',6,'14 Karat Gold Eggs','You have slain the goose but it is too heavy to take back to town. All that wealth wasted.',NULL,234,66,64,11,8,NULL,'Appleshiner',1,0,NULL),(48,'Black Tiger',6,'Claws','You ponder the tiger\'s body thinking what a good rug it might make.','',234,66,64,11,8,'','Appleshiner',1,0,NULL),(49,'Lambert the Sheepish Lion',6,'Timid Growling','You marched in like a lion and he died like a lamb.','',234,66,64,11,8,'','Appleshiner',1,0,NULL),(50,'Marsha of the Jungle',7,'Trained Monkeys','Poor Marsha, she thought those monkeys were better trained.','',268,77,74,13,10,'','Appleshiner',1,0,NULL),(51,'Moe',7,'Two Knives','Maybe those knives weren\'t so great.','',268,77,74,13,10,'','Appleshiner',1,0,NULL),(52,'Coffin',7,'Terrifying Premonitions','Best way to get rid of the coffin is Robitussin.',NULL,268,77,74,13,10,NULL,'Appleshiner',1,1,NULL),(53,'Green Alligator',7,'Crushing Jaws','Crikey! That thing could have killed you!',NULL,268,77,74,13,10,NULL,'foilwench',1,0,NULL),(54,'Lindsey, Daughter of Erin the Ninja Squirrel',7,'A Peanut Shooter','All these squirrels are nuts.','',268,77,74,13,10,'','Appleshiner',1,0,NULL),(55,'Wizarding School Senior Student',7,'Memory Charm','Drat! He took your memory before you killed him. Who are you anyway?',NULL,268,77,74,13,10,NULL,'Appleshiner',1,0,NULL),(56,'Enchanted Laundry Basket',7,'Stinky Socks of Terror','So that\'s what happens to lost socks!',NULL,268,77,74,13,10,NULL,'Appleshiner',1,0,NULL),(57,'Carrot Top',7,'Phone Company Slogans','That has got to be the most satisfying kill you ever made.',NULL,268,77,74,13,10,NULL,'Appleshiner',1,0,NULL),(58,'Macintosh Computer',7,'Amazingly Bright Colors','So THAT\'S what happens when you right-click a Mac.',NULL,268,77,74,13,10,NULL,'Appleshiner',1,0,NULL),(59,'Interior Designer',8,'Color-coordinating Sword and Shield','You didn\'t like his style.','',302,89,84,15,11,'','Appleshiner',1,0,NULL),(60,'Daughter of the Devil',8,'Sinfully Good Looks','She is the girl your mom always warned you about.',NULL,302,89,84,15,11,NULL,'Appleshiner',1,1,NULL),(61,'Wild Horses',8,'Dragging','I guess the saying is true, wild horses can\'t drag you away.','',302,89,84,15,11,'','Appleshiner',1,0,NULL),(62,'Steam Elemental',8,'Scalding jets of air','There was just enough steam left to make an espresso.','',302,89,84,15,11,'','foilwench',1,0,NULL),(63,'Gordon the Cheese Eater',8,'Odiferous Nature','You sure cut that cheese....eater.','',302,89,84,15,11,'','Appleshiner',1,0,NULL),(64,'Narcoleptic',8,'Drowsiness','This narcoleptic won\'t be waking up anytime soon.','',302,89,84,15,11,'','Appleshiner',1,0,NULL),(65,'Swarm of Bees',8,'Stinging','You feel like a pincushion, but you are alive.','',302,89,84,15,11,'','Appleshiner',1,0,NULL),(66,'Halfling Mage',8,'Painful Spells','That fight wasn\'t half as difficult as you thought it would be.','',302,89,84,15,11,'','Appleshiner',1,0,NULL),(67,'Citizen of Eythgim Village',9,'Slurs','Geeze, what did you ever do to him?',NULL,336,101,94,17,13,NULL,'Appleshiner',1,0,NULL),(68,'Old Hag',9,'Red Red Rose','It is her turn to sleep an enchanted sleep.','',336,101,94,17,13,'','Appleshiner',1,0,NULL),(69,'Charging Buffalo',9,'Stampeding Hoofs','Do you know how to stop a charging buffalo? Take away his credit card!',NULL,336,101,94,17,13,NULL,'Appleshiner',1,0,NULL),(70,'Pawn',9,'Simple Tactics','Well, that was a bad move.','',336,101,94,17,13,'','Appleshiner',1,0,NULL),(71,'Romulan',9,'Wrong-Genre Confusion','You think to yourself they look tougher on TV.','',336,101,94,17,13,'','Appleshiner',1,0,NULL),(72,'Large Griffon',9,'Beak and Claws','The mythical creature is no more.','',336,101,94,17,13,'','Appleshiner',1,0,NULL),(73,'Cliche Bond Movie Villain',9,'Cell-phone of Death','Well, really, who throws a cell phone? I mean, that really, really hurt!','',336,101,94,17,13,'','Appleshiner',1,0,NULL),(74,'Fuzzy Ferret',9,'Disarming Cuteness','Who knew ferrets were so violent!',NULL,336,101,94,17,13,NULL,'Appleshiner',1,0,NULL),(75,'Starving Artist',9,'Pointy Paintbrushes','This guy really painted himself into a corner.','',336,101,94,17,13,'','Appleshiner',1,0,NULL),(76,'Guard from Eythgim Village',10,'Rapier','The people from that village seem angry!',NULL,369,114,105,19,14,NULL,'Appleshiner',1,0,NULL),(77,'Garden Gnome',10,'Painful Tackiness','Stupid garden gnomes. What are they doing in the forest anyway?','',369,114,105,19,14,'','Appleshiner',1,0,NULL),(78,'Chicken',10,'Squawking','Good fortune smiles upon you - you will eat well tonight.','',369,114,105,19,14,'','foilwench',1,0,NULL),(79,'Marksman',10,'Deadly Aim','He took so long to aim, you just walked up and kicked him.','',369,114,105,19,14,'','Appleshiner',1,0,NULL),(80,'Enchanted Tissue Box',10,'Cold Germs','You pick up the box and put it in your pocket. You never know when a tissue might come in handy.','',369,114,105,19,14,'','Appleshiner',1,0,NULL),(81,'Ghostly Woodsman',10,'Phantom Axe','You aren\'t sure how you did it, but you killed something that was already dead. Good for you.',NULL,369,114,105,19,14,NULL,'Appleshiner',1,1,NULL),(82,'Zombie',10,'Rotting Flesh','He really went to pieces, didn\'t he?',NULL,369,114,105,19,14,NULL,'foilwench',1,0,NULL),(83,'Fortula the Plains Cat',10,'Claws and Teeth','That plains cat is now plain dead.','',369,114,105,19,14,'','Appleshiner',1,0,NULL),(84,'Erin the Ninja Squirrel',10,'Acorn Tossing Madness','That squirrel was a little crazy.','',369,114,105,19,14,'','Appleshiner',1,0,NULL),(85,'Bluebird of Happiness',11,'Uplifting Melody','Happiness is over-rated anyway.','',402,127,115,21,15,'','Appleshiner',1,0,NULL),(86,'Potato Newscaster',11,'Personal Opinions','It\'s ok, he was just a common \'tater.','',402,127,115,21,15,'','Appleshiner',1,0,NULL),(87,'Pygmy Dragon',11,'Fire Breath','You hope he wasn\'t a relative of the Green Dragon.','',402,127,115,21,15,'','Appleshiner',1,0,NULL),(88,'Zealous Photographer',11,'Flashing Lights','The things beautiful people have to put up with.',NULL,402,127,115,21,15,NULL,'Appleshiner',1,0,NULL),(89,'Gary Larson',11,'Strange Cartoons','You still don\'t get it.',NULL,402,127,115,21,15,NULL,'Appleshiner',1,0,NULL),(90,'Soldier from Eythgim Village',11,'Battle Cry','Eythgim seems to be waging a personal war with you.','',402,127,115,21,15,'','Appleshiner',1,0,NULL),(91,'80\'s Glam Rocker',11,'Blinding Makeup','You know your motto, Live and let die.',NULL,402,127,115,21,15,NULL,'Appleshiner',1,0,NULL),(92,'Vigilante',11,'Sack of Doorknobs','This carnage disgusts you.','',402,127,115,21,15,'','Appleshiner',1,0,NULL),(93,'The Devil',11,'Eternal Damnation','For being the Devil, he really wasn\'t so hot.',NULL,402,127,115,21,15,NULL,'Appleshiner',1,1,NULL),(94,'Mercenary',12,'Blood-chilling Stare','You could use an ale.','',435,141,125,23,17,'','Appleshiner',1,0,NULL),(95,'Magic Mirror',12,'Flattering Remarks','Mirror, Mirror, on the Ground, it is your death that you have found.',NULL,435,141,125,23,17,NULL,'Appleshiner',1,0,NULL),(96,'Broadway Extra',12,'Memorable Showtunes','This extra is really on her own now.','',435,141,125,23,17,'','Appleshiner',1,0,NULL),(97,'Butter the Sprite',12,'Magic Pixie Dust','Butter? What kind of a name is Butter?',NULL,435,141,125,23,17,NULL,'Appleshiner',1,0,NULL),(98,'Father Time',12,'Old Age','Your victory is not comforting. You know he will still catch up to you.','',435,141,125,23,17,'','Appleshiner',1,0,NULL),(99,'Eythgim Village Archers',12,'Flaming Arrows','The tree is burning, you\'d better try to put it out.',NULL,435,141,125,23,17,NULL,'foilwench',1,0,NULL),(100,'Animate Stormcloud',12,'Lightning','The storm is no more. You can see the light of day peeking through the last of the clouds.','',435,141,125,23,17,'','Appleshiner',1,0,NULL),(101,'Three Toed Sloth',12,'Slow Responses','Your swift moves were too fast for this sloth.','',435,141,125,23,17,'','Appleshiner',1,0,NULL),(102,'Death',12,'Cold Grasp','There it is! Death!!!!!',NULL,435,141,125,23,17,NULL,'Appleshiner',1,1,NULL),(103,'Cerberus',13,'Three Drooling Maws','Each one\'s breath was worse than the last.','',467,156,135,25,18,'','Appleshiner',1,1,NULL),(104,'Man from deep, deep, dark, dark, deep, dark woods',13,'Snarling and Biting','The creature from the deep, deep, dark, dark, deep, dark woods is finally dead.','',467,156,135,25,18,'','Appleshiner',1,0,NULL),(105,'Devil in a Blue Dress',13,'Alluring Promises','You really prefer black dresses anyway.','',467,156,135,25,18,'','Appleshiner',1,1,NULL),(106,'Giant',13,'Smashing Club','Geeze, he almost fell on you!',NULL,467,156,135,25,18,NULL,'Appleshiner',1,0,NULL),(107,'Commander of the Eythgim Army',13,'Winning Tactics','You have bested their army by killing its master.',NULL,467,156,135,25,18,NULL,'Appleshiner',1,0,NULL),(108,'Ice Dragon',13,'Frost Breath','You defeated him, but caught a cold.',NULL,467,156,135,25,18,NULL,'Appleshiner',1,0,NULL),(109,'Pushmi Pullyew',13,'Conflictory Arguments','That strange creature couldn\'t tell if it was coming or going.',NULL,467,156,135,25,18,NULL,'Appleshiner',1,0,NULL),(110,'Whale',13,'Tail','You know Violet isn\'t going to believe a Whale attacked you in the forest.','',467,156,135,25,18,'','Appleshiner',1,0,NULL),(111,'Gorma The Leper',13,'Contagious Disease','It looks like the leper\'s fighting strategy has fallen apart...',NULL,467,156,135,25,18,NULL,'foilwench',1,0,NULL),(112,'Samurai Master',14,'Daisho','You bow to the fallen master before you walk away.','',499,172,145,27,20,'','Appleshiner',1,0,NULL),(113,'Bartender',14,'Duck','That\'s not a Duck! It\'s a Chicken!',NULL,499,172,145,27,20,NULL,'Appleshiner',1,0,NULL),(114,'Prince of Eythgim Village',14,'Bribes of Gold','You are not easily bribed, and he was a mortal enemy.','',499,172,145,27,20,'','Appleshiner',1,0,NULL),(115,'Loch Ness Monster',14,'Shocking Appearance','Why in the world would that monster be in this forest. You must have been dreaming!','',499,172,145,27,20,'','Appleshiner',1,0,NULL),(116,'Fuzzie Wuzzie',14,'Male Pattern Baldness','Fuzzie Wuzzie wasn\'t very fuzzie, was he?',NULL,499,172,145,27,20,NULL,'Appleshiner',1,0,NULL),(117,'Princess of Eythgim Village',15,'Beguiling Words','She tried to tempt you, but you resisted.',NULL,531,189,155,29,21,NULL,'Appleshiner',1,0,NULL),(118,'Ugly Harpy',14,'Poisonous Breath','Her breath was worse than her bite.','',499,172,145,27,20,'','Appleshiner',1,1,NULL),(119,'Field Mouse',14,'Chewing','That was some powerful mouse!',NULL,499,172,145,27,20,NULL,'Appleshiner',1,0,NULL),(120,'Monarch of Eythgim Village',16,'Royal Commands','I guess this makes you king of their Village.',NULL,563,207,166,31,22,NULL,'Appleshiner',1,0,NULL),(121,'Cyclops Warrior',15,'Fire Eye','The dead Cyclops\' one eye stares at you blankly.',NULL,531,189,155,29,21,NULL,'foilwench',1,0,NULL),(122,'Cupid',15,'Pink Arrows of Love','You have slain Cupid. You shall never find true love.','',531,189,155,29,21,'','Appleshiner',1,0,NULL),(123,'Tabloid Writer',15,'Far-fetched Stories','If you ask me, SHE was the six-armed alien who gave birth to the world\'s largest infant Elvis impersonator.','',531,189,155,29,21,'','Appleshiner',1,0,NULL),(124,'Evil Wizard',15,'Tormented Souls','You have set the tortured souls free.','',531,189,155,29,21,'','Appleshiner',1,0,NULL),(125,'Artemis, Goddess of the Hunt',15,'Winged Stags','The moon itself shall weep for the slain Artemis.','',531,189,155,29,21,'','Appleshiner',1,0,NULL),(126,'Centaur Archer',15,'Deadly Marksmanship','The twisted man-beast lies still.','',531,189,155,29,21,'','Appleshiner',1,0,NULL),(127,'Mime',15,'Something Imaginary','His death is a rather sad charade.','',531,189,155,29,21,'','Appleshiner',1,0,NULL),(128,'Chili Chef',15,'Insanity Peppers','Man, that\'s good chili!','',531,189,155,29,21,'','Appleshiner',1,0,NULL),(129,'Brownie',16,'Miniscule weapons','The tiny warrior dies with a faint squeal.','',563,207,166,31,22,'','Appleshiner',1,0,NULL),(130,'Darkness',16,'Self-induced Terror','You are afraid of the dark no longer.','',563,207,166,31,22,'','Appleshiner',1,1,NULL),(131,'Mountain King',16,'God-like Fury','The King has died, long live the King!','',563,207,166,31,22,'','Appleshiner',1,0,NULL),(134,'Loneliness',17,'Silence','What is the sound of one hand clapping?','What is the sound of one hand clapping?',36,0,1,0,0,NULL,NULL,1,0,NULL),(135,'Loneliness',18,'Silence','What is the sound of one hand clapping?','What is the sound of one hand clapping?',0,0,1,0,25,NULL,NULL,1,0,NULL),(136,'Le Chat dans le chapeau',15,'Rhyming Nonsense','In spanish, El Gato en el sombrero.','',531,189,155,29,21,'','Appleshiner',1,0,NULL),(138,'Whopper With Cheese',8,'Abundant Cholesterol','This is one whopper that won\'t show up on your hips tomorrow.',NULL,302,89,84,15,11,NULL,'foilwench',1,0,NULL),(139,'Swarming Ladybugs',3,'Stinking Residue','Those Ladybugs weren\'t very ladylike.',NULL,148,34,32,5,4,NULL,'foilwench',1,0,NULL),(140,'Football Fan',6,'Raucous Cheers','This fan doesn\'t have much to cheer about.',NULL,234,66,64,11,8,NULL,'foilwench',1,0,NULL),(141,'King Agrippa',13,'Flaming Wingnuts','As you stare at his smoking corpse, you marvel at the ineffectiveness of flaming wingnuts.',NULL,467,156,135,25,18,NULL,'foilwench',1,0,NULL),(142,'Cherubically Charming Child',1,'Curious Questions','You think it was the alliteration that did him in.',NULL,36,14,10,1,1,NULL,'foilwench',1,0,NULL),(143,'Haberdasher',5,'Heavy Hat','Hats have gone out of style anyway.',NULL,198,55,53,9,7,NULL,'foilwench',1,0,NULL),(144,'Rush Hour Driver',11,'Road Rage','It was a no-win situation, speeding on these forest paths. The driver had it coming.',NULL,402,127,115,21,15,NULL,'foilwench',1,0,NULL),(145,'Sorority Girl in Nightie',7,'Pillow Fighting Action','It\'s too bad she\'s dead... you liked her action.','',268,77,74,13,10,'','foilwench',1,0,NULL),(146,'Ulysses Wulfgang',14,'Ridiculous Lies','Death to lies! Death to Ulysses Wulfgang!','',499,172,145,27,20,'','Joe',1,0,NULL),(147,'Crazy Audrey',9,'Ravenous Kittens','With a well placed stomp, Audrey and the kittens are no more.',NULL,336,101,94,17,13,NULL,'Appleshiner',1,0,NULL),(148,'Shining Happy People',5,'Hand Holding Terror','They just wanted to be your friend. You meanie.',NULL,198,55,53,9,7,NULL,'foilwench',1,0,NULL),(149,'Elsabutt',8,'Gravitational Pull','This is indeed a grave situation.','',302,89,84,15,11,'','foilwench',1,0,NULL),(150,'Mr. Bear',2,'Overwhelming Sleepiness','Mr. Bear was too tired to finish playing with you and went back to napping.','',97,24,21,3,3,'','foilwench',1,0,NULL),(151,'Everquest Junkie',12,'1337 Sp34k','D00d U pwned that guy!',NULL,435,141,125,23,17,NULL,'foilwench',1,0,NULL),(152,'Little Cocobean',4,'Her Special Roast','She really made your heart race and pound, but now she has crumbled to the ground',NULL,162,45,43,7,6,NULL,'Appleshiner',1,0,NULL),(153,'Humongous Hairball',5,'Incredible Drain-Clogging Power','The hairball and all its accompanying gook have been washed out to sea!',NULL,198,55,53,9,7,NULL,'foilwench',1,0,NULL),(154,'Iron Chef',4,'Sizzling Eel Flambe!','You have rendered the Chef Ironless! He\'s now simply a copper/tin alloy!',NULL,162,45,43,7,6,NULL,'foilwench',1,0,NULL),(155,'The Government',7,'Taxes','That\'s a tax return you\'ll be taking to the bank!',NULL,268,77,74,13,10,NULL,'Bluspring',1,0,NULL),(156,'Bar Fly',1,'Alcoholism','Good thing you got him before cirrhosis did!',NULL,36,14,10,1,1,NULL,'Bluspring',1,0,NULL),(157,'Methane Man',7,'Unfriendly Gasses','Must have been that bean he ate!',NULL,268,77,74,13,10,NULL,'foilwench',1,0,NULL),(158,'Wooly Mammoth',8,'Wildebeest Sidekick','You climb atop the Mammoth\'s remains and declare yourself king (or queen) for a day!',NULL,302,89,84,15,11,NULL,'foilwench',1,0,NULL),(159,'Nasty Nevin',10,'Bossy Mom','Wrecked\'em? Darn near killed \'em!',NULL,369,114,105,19,14,NULL,'Joe',1,0,NULL),(160,'The Gar Man',3,'Jar of Cotton Balls','There is but one Gar Man! And now he\'s just fluff!','',148,34,32,5,4,'','foilwench',1,0,NULL),(161,'Hiker',1,'Walking Stick','His last words were \"...I must protect the dragon.\"','',36,14,10,1,1,'','Appleshiner',1,0,NULL),(162,'Camper',2,'Marshmallow-roasting Stick','With her dying breath she gasps \"...and I never saw the dragon.\"',NULL,97,24,21,3,3,NULL,'Appleshiner',1,0,NULL),(163,'Forest Ranger',3,'Hunting Rifle','In his pack you find a copy of \"Dragon Seeking for Dummies.\"','',148,34,32,5,4,'','Appleshiner',1,0,NULL),(164,'Tree-Hugger',4,'Propaganda Leaflets','The leaflet reads \"Who Will Protect The Helpless Dragon?\"','',162,45,43,7,6,'','Appleshiner',1,0,NULL),(165,'Forest Dwelling Hermit',5,'Hand-Made Sling','He speaks only these words as he dies: \"You must leave the Dragon\'s Forest.\"',NULL,198,55,53,9,7,NULL,'Appleshiner',1,0,NULL),(166,'Member of Dragon Lovers Anonymous',6,'Stuffed Dragon Toy','When one wears a pin saying \"Dragon Lovers Anonymous\" they really are not as anonymous as they might think.','',234,66,64,11,8,'','Appleshiner',1,0,NULL),(167,'Initiate Dragon Watcher',7,'Binoculars','All he could say was \"Shhh, you are scaring the dragons!\"',NULL,268,77,74,13,10,NULL,'Appleshiner',1,0,NULL),(168,'Dragon Watcher, Junior Class',8,'Annoyance','You find a dragon-watching textbook in his backpack.',NULL,302,89,84,15,11,NULL,'Appleshiner',1,0,NULL),(169,'Dragon-watcher Senior Class',9,'Spelunking Equipment','You find a copy of \"Cave-Dwelling Dragons, and Where to Find Them\" in his pack.','',336,101,94,17,13,'','Appleshiner',1,0,NULL),(170,'Master Dragon Watcher',10,'Stealth','You wonder who watches the watchers.','',369,114,105,19,14,'','Appleshiner',1,0,NULL),(171,'Initiate Dragon Tamer',11,'10-foot dragon pole','Good thing for you that pole only works on 10-foot dragons!',NULL,402,127,115,21,15,NULL,'Appleshiner',1,0,NULL),(172,'Junior Dragon Tamer',12,'Large Whip','If he cannot tell the difference between you and a dragon, he has much work to do.','',435,141,125,23,17,'','Appleshiner',1,0,NULL),(173,'Senior Dragon Tamer',13,'Very Large Hoop','You regret killing him. You wanted to see him make a dragon jump through that hoop.','',467,156,135,25,18,'','Appleshiner',1,0,NULL),(174,'Master Dragon Tamer',14,'Tame Dragon','Once you killed the master, the dragon ran away',NULL,499,172,145,27,20,NULL,'Appleshiner',1,0,NULL),(175,'Dragon Rider in Training',15,'Mechanical Bull','They learn to ride dragons using a mechanical bull?',NULL,531,189,155,29,21,NULL,'Appleshiner',1,0,NULL),(176,'Dragon Rider',16,'Flying Dragon','A well-aimed strike grounds the flying dragon and his rider.','',563,207,166,31,22,'','Appleshiner',1,0,NULL),(177,'Batling',1,'Tiny flapping wings','Silly batling!','',36,14,10,1,1,'','Appleshiner',1,1,NULL),(178,'Small Bat',2,'Slightly venomous fangs','The small mammal falls to the ground lifeless.','',97,24,21,3,3,'','Appleshiner',1,1,NULL),(179,'Medium Sized Bat',3,'Screeching Cries','You killed it just to shut it up.',NULL,148,34,32,5,4,NULL,'Appleshiner',1,1,NULL),(180,'Large Bat',4,'Guano','You feel the need to take a bath.','',162,45,43,7,6,'','Appleshiner',1,1,NULL),(181,'Giant Bat',5,'Clinging and Biting','Why do movie bats always fly at people\'s hair?',NULL,198,55,53,9,7,NULL,'Appleshiner',1,1,NULL),(182,'Vampire Batling',6,'Pricking teeth','He resembled a mosquito more than a vampire bat.','',234,66,64,11,8,'','Appleshiner',1,1,NULL),(183,'Small Vampire Bat',7,'Deadly Fangs','You kick at the annoying pest as it lies on the ground.','',268,77,74,13,10,'','Appleshiner',1,1,NULL),(184,'Medium Sized Vampire Bat',8,'Echoing Sounds','Who decides that this bat is a \"Medium\"? Maybe he is a giant bat who hasn\'t bloomed yet.',NULL,302,89,84,15,11,NULL,'Appleshiner',1,1,NULL),(185,'Huge Vampire Bat',9,'Blood-Sucking','You gave more blood to the Red Cross.','',336,101,94,17,13,'','Appleshiner',1,1,NULL),(186,'Vampire in Bat Form',10,'Bad Romanian Accent','\"I vant to suk your blooood!\"',NULL,369,114,105,19,14,NULL,'Appleshiner',1,1,NULL),(187,'Vampire-Bat Prince',11,'Death Grip','You thought bats were Republicans.','',402,127,115,21,15,'','Appleshiner',1,1,NULL),(188,'Vampire Bat King',12,'Red Eyes','You decide to leave before the rest of the bats come to find their king.','',435,141,125,23,17,'','Appleshiner',1,1,NULL),(189,'Sorcerous Vampire',13,'Petrifying Spells','A cold shiver goes down your spine. You would rather be with Violet.','',467,156,135,25,18,'','Appleshiner',1,1,NULL),(219,'Seductive Vampiress',14,'Sultry Moves','It was a shame to kill her.',NULL,499,172,145,27,20,NULL,'Appleshiner',1,1,NULL),(220,'Frenzied vampire bats',15,'Numerous attacks','Why are there so many darn bats in this forest?',NULL,531,189,155,29,21,NULL,'Appleshiner',1,1,NULL),(221,'Vampirus,the Bat God',16,'Godly Power','You are even more god-like then he!','',563,207,166,31,22,'','Appleshiner',1,1,NULL),(222,'Old Man Winter',9,'Bitter Cold','You shake your fist over his dead, pathetic corpse.',NULL,336,101,94,17,13,NULL,NULL,1,0,NULL),(223,'Deranged Gnome',1,'A Cloth Draped Mirror','What happens when I do THIS?',NULL,36,14,10,1,1,NULL,NULL,1,0,NULL),(224,'Water Sprite',1,'Burst of Water','That was refreshing.',NULL,36,14,10,1,1,NULL,NULL,1,0,NULL),(225,'Water Nymph',3,'A torrent of water','I didn\'t need a bath, thank you.',NULL,148,34,32,5,4,NULL,NULL,1,0,NULL),(226,'Lady of the Lake',10,'Excalibur','Take that, you watery tart!',NULL,369,114,105,19,14,NULL,NULL,1,0,NULL),(227,'Cunning Sapling',1,'Arrrr!','Ah Ha! A toothpick!',NULL,36,14,10,1,1,NULL,NULL,1,0,NULL),(228,'Pirate Tree',5,'A loud ARRRRR!','Arrrrrr! indeed.',NULL,198,55,53,9,7,NULL,NULL,1,0,NULL),(229,'Undead Centurion',5,'Bronze Spear','Hmm Not too good at combat the second time around, either.',NULL,198,55,53,9,7,NULL,NULL,1,1,NULL),(230,'Insane Bard',2,'Iambic Pentameter','Slings and Arrows of outrageous fortune? Nope. Just the can o\' Whoopass.',NULL,97,24,21,3,3,NULL,NULL,1,0,NULL),(231,'Twig Man',1,'Brambles and Briars','I snapped him like a.. well, twig.',NULL,36,14,10,1,1,NULL,'Hank',1,0,NULL),(232,'Rabid Mouse',1,'Little Bitty Teeth','Those little teeth HURT!',NULL,36,14,10,1,1,NULL,'Hank',1,0,NULL),(233,'Stray Cat',1,'A Midnight Serenade','Finally! Peace in the night!',NULL,36,14,10,1,1,NULL,'Hank',1,0,NULL),(234,'Big Hairy Spider',1,'Sticky stringy webs','I *HATE* spiders!',NULL,36,14,10,1,1,NULL,'Hank',1,0,NULL),(235,'Goblin Lackey',1,'Dull Knife','Who knew goblins had lackeys?',NULL,36,14,10,1,1,NULL,'Hank',1,0,NULL),(236,'Crazy Chihuahua',1,'Fast food cravings','Here taco, taco, taco.','',36,14,10,1,1,'','Hank',1,0,NULL),(237,'Looney Rabbit',1,'Wisecracks','Th- Th- That\'s all folks!',NULL,36,14,10,1,1,NULL,'Hank',1,0,NULL),(238,'Undead Oarsman',1,'Rotten Oar','Funny... I didn\'t see any water around here.','',36,14,10,1,1,'','Hank',1,1,NULL),(239,'Lost Ghostling',2,'Sad Weeping','Well, I\'m sure that helped him on his way...','',97,24,21,3,3,'','Hank',1,0,NULL),(240,'Angry Titmouse',2,'Incessant Chattering','You swat the little bird out of the air with little effort.','',97,24,21,3,3,'','Hank',1,0,NULL),(241,'Fabianist Youth Member',2,'Marxist Doctrine','Socialize THAT.',NULL,97,24,21,3,3,NULL,'Hank',1,0,NULL),(242,'Little Bogeyman',2,'Noises in the Dark','Hmm, not so scary when you have grown up...','',97,24,21,3,3,'','Hank',1,0,NULL),(243,'Big Bogeyman',3,'Fingers poking you as you sleep.','Ok... that was weird. But not scary... Nope not at all... I think I\'ll leave the light on at the inn tonight though.','',148,34,32,5,4,'','Hank',1,0,NULL),(244,'Coblynau',2,'Ill tempered tricks','Maybe I better leave him part of my lunch next time.','',97,24,21,3,3,'','Hank',1,0,NULL),(245,'Jack O\'Lantern',2,'Eternal Wandering','The light has gone out of his life.',NULL,97,24,21,3,3,NULL,'Hank',1,0,NULL),(246,'Fresh Ghoul',2,'Long Pointed Nails','You leave him to the mercies of the other ghouls.','',97,24,21,3,3,'','Hank',1,1,NULL),(247,'Dry Skeleton',2,'a Rusty Dagger','The skeleton crumbles into a pile of dust.',NULL,97,24,21,3,3,NULL,'Hank',1,1,NULL),(248,'Newly Dead Zombie',2,'Fists','Maybe now it can rest in peace.',NULL,97,24,21,3,3,NULL,'Hank',1,1,NULL),(249,'Faerie hound',2,'Glowing Eyes','The embers in the eye sockets dim and sputter out.',NULL,97,24,21,3,3,NULL,'Hank',1,1,NULL),(250,'Apprentice Necromancer',3,'Life Draining Spells','He gasps a final breath and melts into a tarry liquid.',NULL,148,34,32,5,4,NULL,'Hank',1,0,NULL),(251,'Doppleganger',3,'Shape changing','You kill the doppleganger and he returns to his true form.',NULL,148,34,32,5,4,NULL,'Hank',1,0,NULL),(252,'Forest Thief',3,'Poisoned Short Sword','His pockets were almost empty. I guess he wasn\'t much of a thief.','',148,34,32,5,4,'','Hank',1,0,NULL),(253,'Mouldy Skeleton',3,'Rotten Fists','Heeeeey, didn\'t you see him in town last week?',NULL,148,34,32,5,4,NULL,'Hank',1,1,NULL),(254,'Angry Fairy',3,'Furious Fairy Dust','He disappears in a cloud of fairy dust.',NULL,148,34,32,5,4,NULL,'Hank',1,0,NULL),(255,'Goblin Hunter',3,'a Shortbow','Only one? Don\'t they usually travel in packs?',NULL,148,34,32,5,4,NULL,'Hank',1,0,NULL),(256,'Bobcat Cub',3,'Sharp Claws','Even the cute fuzzy kittens are evil in this place.',NULL,148,34,32,5,4,NULL,'Hank',1,0,NULL),(257,'Animate Junkheap',3,'Stench of 1000 rotten potatoes','Just call you the De-Animator!',NULL,148,34,32,5,4,NULL,'Hank',1,0,NULL),(258,'Necromancer',4,'Strength Draining Touch','In a cloud of black smoke, his body wafts away on the breeze.','',162,45,43,7,6,'','Hank',1,0,NULL),(259,'Reed Golem',4,'Fists of Thorns','The only thing left was a tiny bale of hay.',NULL,162,45,43,7,6,NULL,'Hank',1,0,NULL),(260,'Goblin Shaman',4,'Primitive Magic','\"Oooga Booga,\" indeed.',NULL,162,45,43,7,6,NULL,'Hank',1,0,NULL),(261,'Steam Spirit',4,'Scalding Steam','Not so hot now, eh?',NULL,162,45,43,7,6,NULL,'Hank',1,0,NULL),(262,'Restless Zombie',4,'Broken Longsword','Finally he is at peace.',NULL,162,45,43,7,6,NULL,'Hank',1,1,NULL),(263,'Zombie Soldier',4,'Rusted Spear','His final orders were to march to hell.','',162,45,43,7,6,'','Hank',1,1,NULL),(264,'Dark Imp',4,'Nagging Doubts','The imp implodes in a ball of flame.',NULL,162,45,43,7,6,NULL,'Hank',1,1,NULL),(265,'Giant Spider',4,'Fangs that glisten with poison','I really, really hate spiders.','',162,45,43,7,6,'','Hank',1,0,NULL),(266,'Undead Kitten',4,'Mews of Doom','Another evil cat sent to hell C.O.D.',NULL,162,45,43,7,6,NULL,'Hank',1,1,NULL),(267,'Flying Dagger',4,'Sharpened Steel Point','The dagger shatters when it hits the ground.',NULL,162,45,43,7,6,NULL,'Hank',1,0,NULL),(268,'Goblin Warrior',5,'Bent Short Sword','Gone... and forgotten.','',198,55,53,9,7,'','Hank',1,0,NULL),(269,'Experienced Necromancer',5,'a small group of Zombies','The necromancer turns into a pile of black sand and blows away.',NULL,198,55,53,9,7,NULL,'Hank',1,0,NULL),(270,'Flame Sprite',5,'Searing Flame','You cooled him off in a hurry...',NULL,198,55,53,9,7,NULL,'Hank',1,0,NULL),(271,'Mud Man',5,'Enchanted Mud','Defeated, the Mud Man dries up in the warm sun.',NULL,198,55,53,9,7,NULL,'Hank',1,0,NULL),(272,'Lupe the Hypnotic Chihuahua',5,'The stare of doom','You manage to break free of those deep hypnotic eyes...',NULL,198,55,53,9,7,NULL,'Hank',1,0,NULL),(273,'Ghoul',5,'Hunger for Flesh','The ghoul falls to the ground, a bit of flesh between his teeth.',NULL,198,55,53,9,7,NULL,'Hank',1,1,NULL),(274,'Seedy Cutthroat',5,'Sharpened Daggers','One more bandit removed from this forest.',NULL,198,55,53,9,7,NULL,'Hank',1,0,NULL),(275,'Ogre',5,'Broken treebranch','Boy, thats a face not even a mother could love.',NULL,198,55,53,9,7,NULL,'Hank',1,0,NULL),(276,'Crazy Woodsman',5,'Dull axe','Chopped him down to size...',NULL,198,55,53,9,7,NULL,'Hank',1,0,NULL),(277,'Flying Drakeling',5,'a Lashing Tail','You swat the small, majestic beast out of the air.',NULL,198,55,53,9,7,NULL,'Hank',1,0,NULL),(278,'Forest Cat',6,'Menacing Claws','Here kitty, kitty, kitty.','',234,66,64,11,8,'','Hank',1,0,NULL),(279,'Journeyman Necromancer',6,'An Undead Giant','The necromancer drifts away on a cloud of black smoke.','',234,66,64,11,8,'','Hank',1,0,NULL),(280,'Frigid Skeleton',6,'The Cold of the Grave','I\'ll bet one of these guys could cool ale at the inn.','',234,66,64,11,8,'','Hank',1,1,NULL),(281,'Frost Spirit',6,'Bone Chilling Cold','Puttin down another cold one.','',234,66,64,11,8,'','Hank',1,0,NULL),(282,'Dragon Slayer\'s ghost',6,'Warnings of Doom','Everybody wondered what happened to him.',NULL,234,66,64,11,8,NULL,'Hank',1,0,NULL),(283,'Ettin Mage',6,'Double threat spells','Two heads are not better than one in this case. Just more to lop off.','',234,66,64,11,8,'','Hank',1,0,NULL),(284,'Insane Brownie',6,'Faerie spells','This one\'s nuts!',NULL,234,66,64,11,8,NULL,'Hank',1,0,NULL),(285,'Ghostly Wolfpack',6,'Ghostly Howls','Quiet settles in around you. Finally.',NULL,234,66,64,11,8,NULL,'Hank',1,1,NULL),(286,'Wood Golem',6,'Oaken Fists','The truth gave you life and the truth set you free.','',234,66,64,11,8,'','Hank',1,0,NULL),(287,'Diseased Ent',6,'Twisted Branches','There must be fifty ways to cut your lumber. (Groan)','',234,66,64,11,8,'','Hank',1,0,NULL),(288,'Dark Druid',7,'Corrupted Nature','He lost me at the corrupt it to save it part.',NULL,268,77,74,13,10,NULL,'Hank',1,0,NULL),(289,'Lizard Man Scout',7,'Marginal Archery','I know where I can get him made into a nice pair of boots.','',268,77,74,13,10,'','Hank',1,0,NULL),(290,'Diabolic Footman',7,'A Demon Forged Mace','His armor sizzles and he melts as he crumples to the ground.',NULL,268,77,74,13,10,NULL,'Hank',1,1,NULL),(291,'Gargantuan Tree Spider',7,'Projectile Webbing','After you lop him in half, you realize he\'s not so big.',NULL,268,77,74,13,10,NULL,'Hank',1,0,NULL),(292,'Flaming Zombie',7,'Fists covered in Flame','You extinguish the flame of life and the zombie falls to the ground, smoking.',NULL,268,77,74,13,10,NULL,'Hank',1,1,NULL),(293,'Eldritch Wizard',7,'Spells of Darkness','You slice him in two only to watch his body disappear, leaving an empty robe behind.',NULL,268,77,74,13,10,NULL,'Hank',1,0,NULL),(294,'Master Necromancer',7,'An Army of the Dead','You kill the necromancer and his minions disintegrate before your eyes.',NULL,268,77,74,13,10,NULL,'Hank',1,0,NULL),(295,'Animate Darkness',7,'The Darkness of a Thousand Nights','Light Slowly returns to this part of the forest.','',268,77,74,13,10,'','Hank',1,1,NULL),(296,'Temple Guardian Statue',7,'Marble Fists','So, where\'s the temple?',NULL,268,77,74,13,10,NULL,'Hank',1,0,NULL),(297,'Owlbear',7,'Claws and a bearhug','I don\'t even want to know how they breed these.','',268,77,74,13,10,'','Hank',1,0,NULL),(298,'The Man In Black',8,'Necromantic Spells','Finally, I got my chance to kill him.','',302,89,84,15,11,'','Hank',1,0,NULL),(299,'Gnome Illusionist',8,'Fearsome Illusions','It was all in his head.','',302,89,84,15,11,'','Hank',1,0,NULL),(300,'Demon Skeleton',8,'Diabolic Runes','The spirits of its victims drag the skeleton back to hell.','',302,89,84,15,11,'','Hank',1,1,NULL),(301,'Insane Master Druid',8,'The land Itself','His evil laughter dies with him.',NULL,302,89,84,15,11,NULL,'Hank',1,0,NULL),(302,'Water Elementalist',8,'Water Based Spells','He\'s all wet.',NULL,302,89,84,15,11,NULL,'Hank',1,0,NULL),(303,'Earth Elementalist',8,'Earth Based Spells','He fought kind of Dirty.','',302,89,84,15,11,'','Hank',1,0,NULL),(304,'Ettin Warrior',8,'Two Clubs of Iron','They did all right until they hit each other.',NULL,302,89,84,15,11,NULL,'Hank',1,0,NULL),(305,'Forest Giant',8,'An Uprooted Tree','Ho, Ho, Ho that, green man.',NULL,302,89,84,15,11,NULL,'Hank',1,0,NULL),(306,'Demoniac Knight',8,'A Diabolic Lance','Good night, Sir Knight.','',302,89,84,15,11,'','Hank',1,1,NULL),(307,'Giant Zombie',8,'Gigantic Fists','They DO smell worse when they are bigger!',NULL,302,89,84,15,11,NULL,'Hank',1,1,NULL),(308,'Frost Spectre',9,'The Chill Touch of the Grave','As you recover from the fight, the Spectre melts away into the shadows.',NULL,336,101,94,17,13,NULL,'Hank',1,1,NULL),(309,'Small Forest Dragon',9,'Snapping Jaws','Dragon? Check. Green? Check. Huge? Nope.','',336,101,94,17,13,'','Hank',1,0,NULL),(310,'A Pack of Carnivorous Lemurs',9,'Hoots and Howls','What the heck is a Lemur??',NULL,336,101,94,17,13,NULL,'Hank',1,0,NULL),(311,'Albino Crypt Bear',9,'Foul Stench and Claws','You dispatch the bear and wonder if there are more lurking about.',NULL,336,101,94,17,13,NULL,'Hank',1,0,NULL),(312,'Black Knight of The Vale',9,'Ebony Sword','As he dies, he curses you and tells you that you will never defeat the dragon.',NULL,336,101,94,17,13,NULL,'Hank',1,0,NULL),(313,'Elmearian Spy',9,'Small Dagger','He eats his information before he dies, so you learn nothing from him.',NULL,336,101,94,17,13,NULL,'Hank',1,0,NULL),(314,'Stalking Shadow',9,'Fingers of Darkness','You send the ceature back to where it came from.',NULL,336,101,94,17,13,NULL,'Hank',1,1,NULL),(315,'Necromantic Archmagus',9,'Screams of a Thousand Souls','With his dying breath he explodes into a pillar of black flame!',NULL,336,101,94,17,13,NULL,'Hank',1,0,NULL),(316,'Iron Golem',9,'Rusted Fists','The golem seizes up and you push him over.','',336,101,94,17,13,'','Hank',1,0,NULL),(317,'A Hell Hound',9,'Fiery Breath','He bursts into flames and is sucked into the earth.',NULL,336,101,94,17,13,NULL,'Hank',1,1,NULL),(318,'Corporate Lackey',7,'Buzzwords','Well, you sure reprioritized his downsizing.',NULL,268,77,74,13,10,NULL,'Moonchilde',1,0,NULL),(319,'SCO Lawyer',8,'Court Papers','There\'s one lawyer who\'ll never trouble you again!',NULL,302,89,84,15,11,NULL,'Moonchilde',1,1,NULL),(320,'Gypsy Bandit',14,'Gemmed Dagger','That will put an end to his thieving days.','You\'re dead, he\'s free to take what he will.',499,172,145,27,20,'global $badguy, $session;\r\n\r\nif (!isset($badguy[\'spellpoints\'])) {\r\n $badguy[\'spellpoints\'] = 1;\r\n}\r\n\r\n$gold = round($session[\'user\'][\'gold\'] * 0.2);\r\nif (e_rand(0,7) == 0 && $gold > 200 && $badguy[\'spellpoints\'] == 1) {\r\n rawoutput(\"
The pickpocket takes $gold gold!

\");\r\n $session[\'user\'][\'gold\'] -= $gold;\r\n $badguy[\'creaturegold\'] += $gold;\r\n $badguy[\'spellpoints\']--;\r\n}','Talisman',1,0,NULL); +/*!40000 ALTER TABLE `creatures` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `debuglog` +-- + +DROP TABLE IF EXISTS `debuglog`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `debuglog` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `actor` int(11) unsigned DEFAULT NULL, + `target` int(11) unsigned DEFAULT NULL, + `message` text NOT NULL, + `field` varchar(20) NOT NULL, + `value` float(9,2) NOT NULL DEFAULT 0.00, + PRIMARY KEY (`id`), + KEY `date` (`date`), + KEY `field` (`actor`,`field`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `debuglog` +-- + +LOCK TABLES `debuglog` WRITE; +/*!40000 ALTER TABLE `debuglog` DISABLE KEYS */; +INSERT INTO `debuglog` VALUES (1,'2020-08-12 19:08:59',1,0,'New Day Turns: Base: 10, Spirits: 1, DK: 0','',0.00); +/*!40000 ALTER TABLE `debuglog` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `faillog` +-- + +DROP TABLE IF EXISTS `faillog`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `faillog` ( + `eventid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `post` tinytext NOT NULL, + `ip` varchar(40) NOT NULL, + `acctid` int(11) unsigned DEFAULT NULL, + `id` varchar(32) NOT NULL, + PRIMARY KEY (`eventid`), + KEY `date` (`date`), + KEY `acctid` (`acctid`), + KEY `ip` (`ip`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `faillog` +-- + +LOCK TABLES `faillog` WRITE; +/*!40000 ALTER TABLE `faillog` DISABLE KEYS */; +/*!40000 ALTER TABLE `faillog` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gamelog` +-- + +DROP TABLE IF EXISTS `gamelog`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `gamelog` ( + `logid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `message` text NOT NULL, + `category` varchar(50) NOT NULL, + `filed` tinyint(4) NOT NULL DEFAULT 0, + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `who` int(11) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`logid`), + KEY `date` (`category`,`date`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `gamelog` +-- + +LOCK TABLES `gamelog` WRITE; +/*!40000 ALTER TABLE `gamelog` DISABLE KEYS */; +INSERT INTO `gamelog` VALUES (1,'Deleted 0 accounts:\n[0] with 0 dk avg lvl [0]\n[0] with 1 dk avg lvl [0]\nAvg DK: [0]\nAccounts: ','char expiration',0,'2020-08-12 19:08:59',1),(2,'Cleaned up 0 old values in module_userprefs that don\'t exist anymore','maintenance',0,'2020-08-12 19:08:59',1),(3,'Cleaned up 0 old values in module_settings that don\'t exist anymore','maintenance',0,'2020-08-12 19:08:59',1),(4,'Cleaned up 0 from debuglog older than 2020-07-25 19:08:59.','maintenance',0,'2020-08-12 19:08:59',1),(5,'Cleaned up gamelog table removing 0 older than 2020-07-12 19:08:59.','maintenance',0,'2020-08-12 19:08:59',1),(6,'Deleted 0 old comments.','comment expiration',0,'2020-08-12 19:08:59',1),(7,'Deleted 0 old moderated comments.','comment expiration',0,'2020-08-12 19:08:59',1); +/*!40000 ALTER TABLE `gamelog` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `logdnet` +-- + +DROP TABLE IF EXISTS `logdnet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `logdnet` ( + `serverid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `address` varchar(255) NOT NULL, + `description` varchar(255) NOT NULL, + `priority` double NOT NULL DEFAULT 100, + `lastupdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `version` varchar(255) NOT NULL DEFAULT 'Unknown', + `admin` varchar(255) NOT NULL DEFAULT 'unknown', + `lastping` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `recentips` varchar(255) NOT NULL, + `count` int(11) unsigned NOT NULL DEFAULT 0, + `lang` varchar(20) NOT NULL, + PRIMARY KEY (`serverid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `logdnet` +-- + +LOCK TABLES `logdnet` WRITE; +/*!40000 ALTER TABLE `logdnet` DISABLE KEYS */; +/*!40000 ALTER TABLE `logdnet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `logdnetbans` +-- + +DROP TABLE IF EXISTS `logdnetbans`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `logdnetbans` ( + `banid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `bantype` varchar(20) NOT NULL, + `banvalue` varchar(255) NOT NULL, + PRIMARY KEY (`banid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `logdnetbans` +-- + +LOCK TABLES `logdnetbans` WRITE; +/*!40000 ALTER TABLE `logdnetbans` DISABLE KEYS */; +/*!40000 ALTER TABLE `logdnetbans` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `mail` +-- + +DROP TABLE IF EXISTS `mail`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mail` ( + `messageid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `msgfrom` varchar(255) NOT NULL DEFAULT '0', + `msgto` int(11) unsigned NOT NULL DEFAULT 0, + `subject` varchar(255) NOT NULL, + `body` text NOT NULL, + `sent` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `seen` tinyint(1) NOT NULL DEFAULT 0, + `originator` int(11) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`messageid`), + KEY `msgto` (`msgto`), + KEY `seen` (`seen`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `mail` +-- + +LOCK TABLES `mail` WRITE; +/*!40000 ALTER TABLE `mail` DISABLE KEYS */; +/*!40000 ALTER TABLE `mail` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `masters` +-- + +DROP TABLE IF EXISTS `masters`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `masters` ( + `creatureid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `creaturename` varchar(50) DEFAULT NULL, + `creaturelevel` int(11) DEFAULT NULL, + `creatureweapon` varchar(50) DEFAULT NULL, + `creaturelose` varchar(120) DEFAULT NULL, + `creaturewin` varchar(120) DEFAULT NULL, + `creaturegold` int(11) DEFAULT NULL, + `creatureexp` int(11) DEFAULT NULL, + `creaturehealth` int(11) DEFAULT NULL, + `creatureattack` int(11) DEFAULT NULL, + `creaturedefense` int(11) DEFAULT NULL, + PRIMARY KEY (`creatureid`) +) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `masters` +-- + +LOCK TABLES `masters` WRITE; +/*!40000 ALTER TABLE `masters` DISABLE KEYS */; +INSERT INTO `masters` VALUES (1,'Mireraband',1,'Small Dagger','Well done %w`&, I should have guessed you\'d grown some.','As I thought, %w`^, your skills are no match for my own!',NULL,NULL,12,2,2),(2,'Fie',2,'Short Sword','Well done %w`&, you really know how to use your %x.','You should have known you were no match for my %X',NULL,NULL,22,4,4),(3,'Glynyc',3,'Hugely Spiked Mace','Aah, defeated by the likes of you! Next thing you know, Mireraband will be hunting me down!','Haha, maybe you should go back to Mireraband\'s class.',NULL,NULL,33,6,6),(4,'Guth',4,'Spiked Club','Ha! Hahaha, excellent fight %w`&! Haven\'t had a battle like that since I was in the RAF!','Back in the RAF, we\'d have eaten the likes of you alive! Go work on your skills some old boy!',NULL,NULL,44,8,8),(5,'Un�lith',5,'Thought Control','Your mind is greater than mine. I concede defeat.','Your mental powers are lacking. Meditate on this failure and perhaps some day you will defeat me.',NULL,NULL,55,10,10),(6,'Adwares',6,'Dwarven Battle Axe','Ach! Y\' do hold yer %x with skeel!','Har! Y\' do be needin moore praktise y\' wee cub!',NULL,NULL,66,12,12),(7,'Gerrard',7,'Battle Bow','Hmm, mayhaps I underestimated you.','As I thought.',NULL,NULL,77,14,14),(8,'Ceiloth',8,'Orkos Broadsword','Well done %w`&, I can see that great things lie in the future for you!','You are becoming powerful, but not yet that powerful.',NULL,NULL,88,16,16),(9,'Dwiredan',9,'Twin Swords','Perhaps I should have considered your %x...','Perhaps you\'ll reconsider my twin swords before you try that again?',NULL,NULL,99,18,18),(10,'Sensei Noetha',10,'Martial Arts Skills','Your style was superior, your form greater. I bow to you.','Learn to adapt your style, and you shall prevail.',NULL,NULL,110,20,20),(11,'Celith',11,'Throwing Halos','Wow, how did you dodge all those halos?','Watch out for that last halo, it\'s coming back this way!',NULL,NULL,121,22,22),(12,'Gadriel the Elven Ranger',12,'Elven Long Bow','I can accept that you defeated me, because after all elves are immortal while you are not, so the victory will be mine.','Do not forget that elves are immortal. Mortals will likely never defeat one of the fey.',NULL,NULL,132,24,24),(13,'Adoawyr',13,'Gargantuan Broad Sword','If I could have picked up this sword, I probably would have done better!','Haha, I couldn\'t even pick the sword UP and I still won!',NULL,NULL,143,26,26),(14,'Yoresh',14,'Death Touch','Well, you evaded my touch. I salute you!','Watch out for my touch next time!',NULL,NULL,154,28,28); +/*!40000 ALTER TABLE `masters` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `moderatedcomments` +-- + +DROP TABLE IF EXISTS `moderatedcomments`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `moderatedcomments` ( + `modid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `comment` text DEFAULT NULL, + `moderator` int(11) unsigned NOT NULL DEFAULT 0, + `moddate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`modid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `moderatedcomments` +-- + +LOCK TABLES `moderatedcomments` WRITE; +/*!40000 ALTER TABLE `moderatedcomments` DISABLE KEYS */; +/*!40000 ALTER TABLE `moderatedcomments` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `module_event_hooks` +-- + +DROP TABLE IF EXISTS `module_event_hooks`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `module_event_hooks` ( + `event_type` varchar(20) NOT NULL, + `modulename` varchar(50) NOT NULL, + `event_chance` text NOT NULL, + KEY `modulename` (`modulename`), + KEY `event_type` (`event_type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `module_event_hooks` +-- + +LOCK TABLES `module_event_hooks` WRITE; +/*!40000 ALTER TABLE `module_event_hooks` DISABLE KEYS */; +INSERT INTO `module_event_hooks` VALUES ('forest','fairy','return 100;'),('forest','findgem','return 100;'),('travel','findgem','return 20;'),('forest','foilwench','return 100;'),('forest','glowingstream','return 100;'),('travel','glowingstream','return 100;'),('forest','goldmine','return 100;'),('forest','findgold','return 100;'),('travel','findgold','return 20;'),('forest','crazyaudrey','return 100;'),('forest','darkhorse','require_once(\"modules/darkhorse.php\");\n return (darkhorse_tavernmount() ? 0 : 100);'),('travel','darkhorse','require_once(\"modules/darkhorse.php\");\n return (darkhorse_tavernmount() ? 0 : 100);'); +/*!40000 ALTER TABLE `module_event_hooks` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `module_hooks` +-- + +DROP TABLE IF EXISTS `module_hooks`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `module_hooks` ( + `modulename` varchar(50) NOT NULL, + `location` varchar(50) NOT NULL, + `function` varchar(50) NOT NULL, + `whenactive` text NOT NULL, + `priority` int(11) NOT NULL DEFAULT 50, + PRIMARY KEY (`modulename`,`location`,`function`), + KEY `location` (`location`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `module_hooks` +-- + +LOCK TABLES `module_hooks` WRITE; +/*!40000 ALTER TABLE `module_hooks` DISABLE KEYS */; +INSERT INTO `module_hooks` VALUES ('cedrikspotions','header-inn','cedrikspotions_dohook','',50),('cedrikspotions','hprecalc','cedrikspotions_dohook','',50),('cedrikspotions','newday-runonce','cedrikspotions_dohook','',50),('crazyaudrey','newday','crazyaudrey_dohook','',50),('crazyaudrey','newday-runonce','crazyaudrey_dohook','',50),('crazyaudrey','village','crazyaudrey_dohook','',50),('crazyaudrey','village-desc','crazyaudrey_dohook','',50),('dag','delete_character','dag_dohook','',50),('dag','dragonkill','dag_dohook','',50),('dag','inn','dag_dohook','',50),('dag','inn-desc','dag_dohook','',50),('dag','newday','dag_dohook','',50),('dag','pvpwin','dag_dohook','',50),('dag','showsettings','dag_dohook','',50),('dag','superuser','dag_dohook','',50),('darkhorse','forest','darkhorse_dohook','',50),('darkhorse','moderate','darkhorse_dohook','',50),('darkhorse','mountfeatures','darkhorse_dohook','',50),('drinks','ale','drinks_dohook','',50),('drinks','commentary','drinks_dohook','',50),('drinks','dragonkill','drinks_dohook','',50),('drinks','header-graveyard','drinks_dohook','',50),('drinks','newday','drinks_dohook','',50),('drinks','soberup','drinks_dohook','',50),('drinks','superuser','drinks_dohook','',50),('fairy','hprecalc','fairy_dohook','',50),('game_dice','darkhorsegame','game_dice_dohook','',50),('game_stones','darkhorsegame','game_stones_dohook','',50),('lovers','inn','lovers_dohook','',50),('lovers','newday','lovers_dohook','',50),('outhouse','forest','outhouse_dohook','',50),('outhouse','newday','outhouse_dohook','',50),('racedwarf','camplocs','racedwarf_dohook','',50),('racedwarf','changesetting','racedwarf_dohook','',50),('racedwarf','chooserace','racedwarf_dohook','',50),('racedwarf','creatureencounter','racedwarf_dohook','',50),('racedwarf','drinks-check','racedwarf_dohook','',50),('racedwarf','drinks-text','racedwarf_dohook','',50),('racedwarf','mercenarycamptext','racedwarf_dohook','',50),('racedwarf','moderate','racedwarf_dohook','',50),('racedwarf','raceminedeath','racedwarf_dohook','',50),('racedwarf','racenames','racedwarf_dohook','',50),('racedwarf','setrace','racedwarf_dohook','',50),('racedwarf','travel','racedwarf_dohook','',50),('racedwarf','validforestloc','racedwarf_dohook','',50),('racedwarf','validlocation','racedwarf_dohook','',50),('racedwarf','village','racedwarf_dohook','',50),('racedwarf','villagetext','racedwarf_dohook','',50),('raceelf','adjuststats','raceelf_dohook','',50),('raceelf','changesetting','raceelf_dohook','',50),('raceelf','chooserace','raceelf_dohook','',50),('raceelf','moderate','raceelf_dohook','',50),('raceelf','newday','raceelf_dohook','',50),('raceelf','pvpadjust','raceelf_dohook','',50),('raceelf','raceminedeath','raceelf_dohook','',50),('raceelf','racenames','raceelf_dohook','',50),('raceelf','setrace','raceelf_dohook','',50),('raceelf','travel','raceelf_dohook','',50),('raceelf','validforestloc','raceelf_dohook','',50),('raceelf','validlocation','raceelf_dohook','',50),('raceelf','villagetext','raceelf_dohook','',50),('raceelf','weaponstext','raceelf_dohook','',50),('racehuman','changesetting','racehuman_dohook','',50),('racehuman','chooserace','racehuman_dohook','',50),('racehuman','moderate','racehuman_dohook','',50),('racehuman','newday','racehuman_dohook','',50),('racehuman','raceminedeath','racehuman_dohook','',50),('racehuman','racenames','racehuman_dohook','',50),('racehuman','setrace','racehuman_dohook','',50),('racehuman','stablelocs','racehuman_dohook','',50),('racehuman','stabletext','racehuman_dohook','',50),('racehuman','travel','racehuman_dohook','',50),('racehuman','validforestloc','racehuman_dohook','',50),('racehuman','validlocation','racehuman_dohook','',50),('racehuman','villagetext','racehuman_dohook','',50),('racetroll','adjuststats','racetroll_dohook','',50),('racetroll','changesetting','racetroll_dohook','',50),('racetroll','chooserace','racetroll_dohook','',50),('racetroll','moderate','racetroll_dohook','',50),('racetroll','newday','racetroll_dohook','',50),('racetroll','pvpadjust','racetroll_dohook','',50),('racetroll','raceminedeath','racetroll_dohook','',50),('racetroll','racenames','racetroll_dohook','',50),('racetroll','setrace','racetroll_dohook','',50),('racetroll','travel','racetroll_dohook','',50),('racetroll','validforestloc','racetroll_dohook','',50),('racetroll','validlocation','racetroll_dohook','',50),('racetroll','villagetext','racetroll_dohook','',50),('sethsong','inn','sethsong_dohook','',50),('sethsong','newday','sethsong_dohook','',50),('specialtydarkarts','apply-specialties','specialtydarkarts_dohook','',50),('specialtydarkarts','choose-specialty','specialtydarkarts_dohook','',50),('specialtydarkarts','dragonkill','specialtydarkarts_dohook','',50),('specialtydarkarts','fightnav-specialties','specialtydarkarts_dohook','',50),('specialtydarkarts','incrementspecialty','specialtydarkarts_dohook','',50),('specialtydarkarts','newday','specialtydarkarts_dohook','',50),('specialtydarkarts','set-specialty','specialtydarkarts_dohook','',50),('specialtydarkarts','specialtycolor','specialtydarkarts_dohook','',50),('specialtydarkarts','specialtymodules','specialtydarkarts_dohook','',50),('specialtydarkarts','specialtynames','specialtydarkarts_dohook','',50),('specialtymysticpower','apply-specialties','specialtymysticpower_dohook','',50),('specialtymysticpower','choose-specialty','specialtymysticpower_dohook','',50),('specialtymysticpower','dragonkill','specialtymysticpower_dohook','',50),('specialtymysticpower','fightnav-specialties','specialtymysticpower_dohook','',50),('specialtymysticpower','incrementspecialty','specialtymysticpower_dohook','',50),('specialtymysticpower','newday','specialtymysticpower_dohook','',50),('specialtymysticpower','set-specialty','specialtymysticpower_dohook','',50),('specialtymysticpower','specialtycolor','specialtymysticpower_dohook','',50),('specialtymysticpower','specialtymodules','specialtymysticpower_dohook','',50),('specialtymysticpower','specialtynames','specialtymysticpower_dohook','',50),('specialtythiefskills','apply-specialties','specialtythiefskills_dohook','',50),('specialtythiefskills','choose-specialty','specialtythiefskills_dohook','',50),('specialtythiefskills','dragonkill','specialtythiefskills_dohook','',50),('specialtythiefskills','fightnav-specialties','specialtythiefskills_dohook','',50),('specialtythiefskills','incrementspecialty','specialtythiefskills_dohook','',50),('specialtythiefskills','newday','specialtythiefskills_dohook','',50),('specialtythiefskills','set-specialty','specialtythiefskills_dohook','',50),('specialtythiefskills','specialtycolor','specialtythiefskills_dohook','',50),('specialtythiefskills','specialtymodules','specialtythiefskills_dohook','',50),('specialtythiefskills','specialtynames','specialtythiefskills_dohook','',50); +/*!40000 ALTER TABLE `module_hooks` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `module_objprefs` +-- + +DROP TABLE IF EXISTS `module_objprefs`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `module_objprefs` ( + `modulename` varchar(50) NOT NULL, + `objtype` varchar(50) NOT NULL, + `setting` varchar(50) NOT NULL, + `objid` int(11) unsigned NOT NULL DEFAULT 0, + `value` text DEFAULT NULL, + PRIMARY KEY (`modulename`,`objtype`,`setting`,`objid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `module_objprefs` +-- + +LOCK TABLES `module_objprefs` WRITE; +/*!40000 ALTER TABLE `module_objprefs` DISABLE KEYS */; +/*!40000 ALTER TABLE `module_objprefs` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `module_settings` +-- + +DROP TABLE IF EXISTS `module_settings`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `module_settings` ( + `modulename` varchar(50) NOT NULL, + `setting` varchar(50) NOT NULL, + `value` text DEFAULT NULL, + PRIMARY KEY (`modulename`,`setting`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `module_settings` +-- + +LOCK TABLES `module_settings` WRITE; +/*!40000 ALTER TABLE `module_settings` DISABLE KEYS */; +INSERT INTO `module_settings` VALUES ('cedrikspotions','atkmod','.75'),('cedrikspotions','carrydk','1'),('cedrikspotions','charmcost','2'),('cedrikspotions','charmgain','1'),('cedrikspotions','defmod','.75'),('cedrikspotions','forgcost','2'),('cedrikspotions','ischarm','1'),('cedrikspotions','isforget','1'),('cedrikspotions','ismax','1'),('cedrikspotions','istemp','1'),('cedrikspotions','istrans','1'),('cedrikspotions','maxcost','2'),('cedrikspotions','maxrand','5'),('cedrikspotions','minrand','2'),('cedrikspotions','randcost','2'),('cedrikspotions','random','0'),('cedrikspotions','survive','1'),('cedrikspotions','tempcost','2'),('cedrikspotions','tempgain','20'),('cedrikspotions','transcost','2'),('cedrikspotions','transmuteturns','10'),('cedrikspotions','vitalgain','1'),('crazyaudrey','animal','Kitten'),('crazyaudrey','animals','Kittens'),('crazyaudrey','buffname','Warm Fuzzies'),('crazyaudrey','cost','5'),('crazyaudrey','defaultanimal','Kitten'),('crazyaudrey','defaultanimals','Kittens'),('crazyaudrey','defaultbuffname','Warm Fuzzies'),('crazyaudrey','defaultsound','mew'),('crazyaudrey','gamedaysremaining','-1'),('crazyaudrey','lanimal','kitten'),('crazyaudrey','lanimals','kittens'),('crazyaudrey','profit','5'),('crazyaudrey','sound','mew'),('crazyaudrey','villagepercent','20'),('dag','bountyfee','10'),('dag','bountylevel','3'),('dag','bountymax','200'),('dag','bountymin','50'),('dag','maxbounties','5'),('darkhorse','tavernname','Dark Horse Tavern'),('drinks','hardlimit','3'),('drinks','maxdrunk','66'),('fairy','carrydk','1'),('fairy','fftoaward','1'),('fairy','hptoaward','1'),('findgold','maxgold','50'),('findgold','mingold','10'),('goldmine','alwaystether','10'),('goldmine','percentgemloss','0'),('goldmine','percentgoldloss','0'),('outhouse','badmusthit','50'),('outhouse','cost','5'),('outhouse','giveback','3'),('outhouse','givegempercent','25'),('outhouse','giveturnchance','0'),('outhouse','goldinhand','1'),('outhouse','goodmusthit','60'),('outhouse','takeback','1'),('racedwarf','minedeathchance','5'),('racedwarf','villagename','Qexelcrag'),('raceelf','minedeathchance','90'),('raceelf','villagename','Glorfindal'),('racehuman','bonus','2'),('racehuman','minedeathchance','90'),('racehuman','villagename','Romar'),('racetroll','minedeathchance','90'),('racetroll','villagename','Glukmoore'),('sethsong','bhploss','10'),('sethsong','goldloss','5'),('sethsong','hpgain','20'),('sethsong','maxgems','1'),('sethsong','maxgold','50'),('sethsong','mingems','1'),('sethsong','mingold','10'),('sethsong','shploss','20'),('sethsong','visits','1'); +/*!40000 ALTER TABLE `module_settings` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `module_userprefs` +-- + +DROP TABLE IF EXISTS `module_userprefs`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `module_userprefs` ( + `modulename` varchar(50) NOT NULL, + `setting` varchar(50) NOT NULL, + `userid` int(11) unsigned NOT NULL DEFAULT 0, + `value` text DEFAULT NULL, + PRIMARY KEY (`modulename`,`setting`,`userid`), + KEY `modulename` (`modulename`,`userid`), + KEY `userid` (`userid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `module_userprefs` +-- + +LOCK TABLES `module_userprefs` WRITE; +/*!40000 ALTER TABLE `module_userprefs` DISABLE KEYS */; +/*!40000 ALTER TABLE `module_userprefs` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `modules` +-- + +DROP TABLE IF EXISTS `modules`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `modules` ( + `modulename` varchar(50) NOT NULL, + `formalname` varchar(255) NOT NULL, + `description` text NOT NULL, + `moduleauthor` varchar(255) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT 0, + `filename` varchar(255) NOT NULL, + `installdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `installedby` varchar(50) NOT NULL, + `filemoddate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `type` tinyint(4) NOT NULL DEFAULT 0, + `extras` text DEFAULT NULL, + `category` varchar(50) NOT NULL, + `infokeys` text NOT NULL, + `version` varchar(10) DEFAULT NULL, + `download` varchar(200) DEFAULT NULL, + PRIMARY KEY (`modulename`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `modules` +-- + +LOCK TABLES `modules` WRITE; +/*!40000 ALTER TABLE `modules` DISABLE KEYS */; +INSERT INTO `modules` VALUES ('cedrikspotions','Cedrik\'s Potion Shop','','Eric Stevens
Modifications by: Chris Vorndran',1,'cedrikspotions.php','2020-08-12 19:09:49','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Inn','|name|version|author|category|download|settings|prefs|description|requires|','2.6','core_module'),('crazyaudrey','Crazy Audrey\'s Petting Zoo','','Eric Stevens',1,'crazyaudrey.php','2020-08-12 19:09:49','`%Admin `&admin`0','2020-06-21 05:47:56',0,NULL,'Forest Specials','|name|version|author|category|download|settings|prefs|requires|description|','1.1','core_module'),('dag','Dag Durnick Bounties','','Darrel Morrone
Updates by Andrew Senger, JT Traub, and Eric Stevens',1,'dag.php','2020-08-12 19:09:49','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Inn','|name|author|version|category|download|settings|prefs|description|requires|','1.3','core_module'),('darkhorse','Dark Horse Tavern','','Eric Stevens',1,'darkhorse.php','2020-08-12 19:09:50','`%Admin `&admin`0','2020-06-21 05:47:56',0,NULL,'Forest Specials','|name|version|author|category|download|settings|prefs-mounts|requires|description|','1.1','core_module'),('drinks','Exotic Drinks','','John J. Collins
Heavily modified by JT Traub',1,'drinks.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Inn','|name|author|category|download|settings|prefs|version|description|requires|','1.1','core_module'),('fairy','Forest Fairy','','Eric Stevens',1,'fairy.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Forest Specials','|name|version|author|category|download|settings|prefs|description|requires|','1.1','core_module'),('findgem','Find Gems','','Eric Stevens',1,'findgem.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Forest Specials','|name|version|author|category|download|description|requires|','1.1','core_module'),('findgold','Find Gold','','Eric Stevens',1,'findgold.php','2020-08-12 19:09:57','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Forest Specials','|name|version|author|category|download|settings|description|requires|','1.1','core_module'),('foilwench','Foilwench','','Eric Stevens',1,'foilwench.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Forest Specials','|name|version|author|category|download|description|requires|','1.1','core_module'),('game_dice','Dice Game for DarkHorse','','Eric Stevens',1,'game_dice.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Darkhorse Game','|name|author|version|category|download|description|requires|','1.1','core_module'),('game_stones','Stones Game for DarkHorse','','Eric Stevens',1,'game_stones.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Darkhorse Game','|name|author|version|category|download|description|requires|','1.1','core_module'),('glowingstream','Glowing Stream','','Eric Stevens',1,'glowingstream.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Forest Specials','|name|version|author|category|download|description|requires|','1.1','core_module'),('goldmine','Gold Mine','','Ville Valtokari',1,'goldmine.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Forest Specials','|name|version|author|category|download|settings|prefs-mounts|description|requires|','1.0','core_module'),('lovers','Violet and Seth Lovers','','Eric Stevens',1,'lovers.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Inn','|name|author|version|category|download|prefs|description|requires|','1.0','core_module'),('outhouse','Gnomish Outhouse','','John Collins',1,'outhouse.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Forest','|name|author|version|category|download|prefs|settings|description|requires|','2.0','core_module'),('racedwarf','Race - Dwarf','','Eric Stevens',1,'racedwarf.php','2020-08-12 19:09:50','`%Admin `&admin`0','2020-06-21 05:47:57',0,NULL,'Races','|name|version|author|category|download|settings|prefs-drinks|requires|description|','1.1','core_module'),('raceelf','Race - Elf','','Eric Stevens',1,'raceelf.php','2020-08-12 19:09:50','`%Admin `&admin`0','2020-06-21 05:47:57',0,NULL,'Races','|name|version|author|category|download|settings|requires|description|','1.0','core_module'),('racehuman','Race - Human','','Eric Stevens',1,'racehuman.php','2020-08-12 19:09:50','`%Admin `&admin`0','2020-06-21 05:47:57',0,NULL,'Races','|name|version|author|category|download|settings|requires|description|','1.0','core_module'),('racetroll','Race - Troll','','Eric Stevens',1,'racetroll.php','2020-08-12 19:09:50','`%Admin `&admin`0','2020-06-21 05:47:57',0,NULL,'Races','|name|version|author|category|download|settings|requires|description|','1.0','core_module'),('sethsong','Seth the Bard\'s Songs','','Eric Stevens',1,'sethsong.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Inn','|name|version|author|category|download|settings|prefs|description|requires|','1.1','core_module'),('specialtydarkarts','Specialty - Dark Arts','','Eric Stevens',1,'specialtydarkarts.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Specialties','|name|author|version|download|category|prefs|description|requires|','1.1','core_module'),('specialtymysticpower','Specialty - Mystical Powers','','Eric Stevens',1,'specialtymysticpower.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Specialties','|name|author|version|download|category|prefs|description|requires|','1.0','core_module'),('specialtythiefskills','Specialty - Thieving Skills','','Eric Stevens',1,'specialtythiefskills.php','2020-08-12 19:09:51','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Specialties','|name|author|version|download|category|prefs|description|requires|','1.0','core_module'); +/*!40000 ALTER TABLE `modules` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `motd` +-- + +DROP TABLE IF EXISTS `motd`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `motd` ( + `motditem` int(11) unsigned NOT NULL AUTO_INCREMENT, + `motdtitle` varchar(200) DEFAULT NULL, + `motdbody` text DEFAULT NULL, + `motddate` datetime DEFAULT NULL, + `motdtype` tinyint(4) unsigned NOT NULL DEFAULT 0, + `motdauthor` int(11) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`motditem`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `motd` +-- + +LOCK TABLES `motd` WRITE; +/*!40000 ALTER TABLE `motd` DISABLE KEYS */; +/*!40000 ALTER TABLE `motd` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `mounts` +-- + +DROP TABLE IF EXISTS `mounts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mounts` ( + `mountid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `mountname` varchar(50) NOT NULL, + `mountdesc` text DEFAULT NULL, + `mountcategory` varchar(50) NOT NULL, + `mountbuff` text DEFAULT NULL, + `mountcostgems` int(11) unsigned NOT NULL DEFAULT 0, + `mountcostgold` int(11) unsigned NOT NULL DEFAULT 0, + `mountactive` int(11) unsigned NOT NULL DEFAULT 1, + `mountforestfights` int(11) NOT NULL DEFAULT 0, + `newday` text NOT NULL, + `recharge` text NOT NULL, + `partrecharge` text NOT NULL, + `mountfeedcost` int(11) unsigned NOT NULL DEFAULT 20, + `mountlocation` varchar(25) NOT NULL DEFAULT 'all', + `mountdkcost` int(11) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`mountid`), + KEY `mountid` (`mountid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `mounts` +-- + +LOCK TABLES `mounts` WRITE; +/*!40000 ALTER TABLE `mounts` DISABLE KEYS */; +INSERT INTO `mounts` VALUES (1,'Pony','This docile beast is young yet.','Horses','a:5:{s:4:\"name\";s:13:\"`&Pony Attack\";s:8:\"roundmsg\";s:26:\"Your pony fights with you!\";s:6:\"rounds\";s:2:\"20\";s:6:\"atkmod\";s:3:\"1.2\";s:8:\"activate\";s:7:\"offense\";}',6,0,1,1,'You strap your {weapon} to your pony\'s saddle bags, and head out for some adventure!','`&Remembering that is has been quite some time since you last fed your pony, you decide this is a perfect time to relax and allow it to graze the field a bit. You doze off enjoying this peaceful serenity.`0','`&You dismount in the field to allow your pony to graze for a moment even though it has recently been fully fed. As you lean back in the grass to watch the clouds, your pony whickers softly and trots off into the underbrush. You search for a while before returning to the fields hoping that it\'ll return. A short time later, your pony trots back into the clearing holding its head high, looking much more energized and with a very equine grin on its face.`0',20,'all',0),(2,'Gelding','This powerful beast is fiercely loyal.','Horses','a:5:{s:4:\"name\";s:16:\"`&Gelding Attack\";s:8:\"roundmsg\";s:29:\"Your gelding fights with you!\";s:6:\"rounds\";s:2:\"40\";s:6:\"atkmod\";s:3:\"1.2\";s:8:\"activate\";s:7:\"offense\";}',10,0,1,2,'You strap your {weapon} to your gelding\'s saddle bags, and head out for some adventure!','`&Remembering that is has been quite some time since you last fed your gelding, you decide this is a perfect time to relax and allow it to graze the field a bit. You doze off enjoying this peaceful serenity.`0','`&You dismount in the field to allow your gelding to graze for a moment even though it has recently been fully fed. As you lean back in the grass to watch the clouds, your gelding whickers softly and trots off into the underbrush. You search for a while before returning to the fields hoping that it\'ll return. A short time later, your gelding trots back into the clearing holding its head high, looking much more energized and with a very equine grin on its face.`n`nAnd here you thought geldings weren\'t equipped that way any longer!`0',25,'all',0),(3,'Stallion','This noble beast is huge and powerful!','Horses','a:5:{s:4:\"name\";s:17:\"`&Stallion Attack\";s:8:\"roundmsg\";s:30:\"Your stallion fights with you!\";s:6:\"rounds\";s:2:\"60\";s:6:\"atkmod\";s:3:\"1.2\";s:8:\"activate\";s:7:\"offense\";}',16,0,1,3,'You strap your {weapon} to your stallion\'s saddle bags, and head out for some adventure!','`&Remembering that is has been quite some time since you last fed your stallion, you decide this is a perfect time to relax and allow it to graze the field a bit. You doze off enjoying this peaceful serenity.`0','`&You dismount in the field to allow your stallion to graze for a moment even though it has recently been fully fed. As you lean back in the grass to watch the clouds, your stallion whickers softly and trots off into the underbrush. You search for a while before returning to the fields hoping that it\'ll return. A short time later, your stallion trots back into the clearing holding its head high, looking much more energized and with a very equine grin on its face.`0',30,'all',0); +/*!40000 ALTER TABLE `mounts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `nastywords` +-- + +DROP TABLE IF EXISTS `nastywords`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `nastywords` ( + `words` text DEFAULT NULL, + `type` varchar(10) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `nastywords` +-- + +LOCK TABLES `nastywords` WRITE; +/*!40000 ALTER TABLE `nastywords` DISABLE KEYS */; +INSERT INTO `nastywords` VALUES ('*damn* *dyke *fuck* *nigger* *phuck* *shit* amcik andskota arschloch arse* ass asshole atouche ayir bastard bitch* boiolas bollock* buceta butt* butt-pirate cabron cawk cazzo chink chraa chuj cipa clit cock* cum cunt* dago daygo dego dick* dike dildo dirsa dupa dziwka ejaculate ejackulate ekrem* ekto enculer faen fag* fanculo fanny fatass fcuk feces feg felcher ficken fitta fitte flikker foreskin phuck fuk* fut futkretzn fuxor gay gook guiena hell helvete hoer* honkey honky hor hore huevon hui injun jism jizz kanker* kawk kike klootzak knulle kraut kuk kuksuger kurac kurwa kusi* kyrp�* leitch lesbian lesbo mamhoon masturbat* merd merde mibun monkleigh mouliewop muie mulkku muschi nazis nepesaurio nigga* nigger nutsack orospu paska* pendejo penis perse phuck picka pierdol* pillu* pimmel pimpis piss* pizda poontsee poop porn preteen preud prick pron pula pule pusse pussy puta puto qahbeh queef* queer* qweef rautenberg schaffer scheiss* scheisse schlampe schmuck screw scrotum sharmuta sharmute shemale shipal shiz skribz skurwysyn slut smut sphencter shpincter spic spierdalaj splooge suka teets teez testicle tits titties titty twat twaty vittu votze wank* wetback* whoar whore wichser woose wop yed zabourah','nasty'); +/*!40000 ALTER TABLE `nastywords` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `news` +-- + +DROP TABLE IF EXISTS `news`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `news` ( + `newsid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `newstext` text NOT NULL, + `newsdate` date NOT NULL DEFAULT '0000-00-00', + `accountid` int(11) unsigned NOT NULL DEFAULT 0, + `arguments` text NOT NULL, + `tlschema` varchar(255) NOT NULL DEFAULT 'news', + PRIMARY KEY (`newsid`,`newsdate`), + KEY `accountid` (`accountid`), + KEY `newsdate` (`newsdate`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `news` +-- + +LOCK TABLES `news` WRITE; +/*!40000 ALTER TABLE `news` DISABLE KEYS */; +INSERT INTO `news` VALUES (1,'`^A strange awakening takes place in the world.`0','2020-08-12',0,'',''); +/*!40000 ALTER TABLE `news` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `paylog` +-- + +DROP TABLE IF EXISTS `paylog`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `paylog` ( + `payid` int(11) NOT NULL AUTO_INCREMENT, + `info` text NOT NULL, + `response` text NOT NULL, + `txnid` varchar(32) NOT NULL, + `amount` float(9,2) NOT NULL DEFAULT 0.00, + `name` varchar(50) NOT NULL, + `acctid` int(11) unsigned NOT NULL DEFAULT 0, + `processed` tinyint(4) unsigned NOT NULL DEFAULT 0, + `filed` tinyint(4) unsigned NOT NULL DEFAULT 0, + `txfee` float(9,2) NOT NULL DEFAULT 0.00, + `processdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`payid`), + KEY `txnid` (`txnid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `paylog` +-- + +LOCK TABLES `paylog` WRITE; +/*!40000 ALTER TABLE `paylog` DISABLE KEYS */; +/*!40000 ALTER TABLE `paylog` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `petitions` +-- + +DROP TABLE IF EXISTS `petitions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `petitions` ( + `petitionid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `author` int(11) unsigned NOT NULL DEFAULT 0, + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `status` int(11) unsigned NOT NULL DEFAULT 0, + `body` text DEFAULT NULL, + `pageinfo` text DEFAULT NULL, + `closedate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `closeuserid` int(11) unsigned NOT NULL DEFAULT 0, + `ip` varchar(40) NOT NULL, + `id` varchar(32) NOT NULL, + PRIMARY KEY (`petitionid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `petitions` +-- + +LOCK TABLES `petitions` WRITE; +/*!40000 ALTER TABLE `petitions` DISABLE KEYS */; +/*!40000 ALTER TABLE `petitions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `pollresults` +-- + +DROP TABLE IF EXISTS `pollresults`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pollresults` ( + `resultid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `choice` int(11) unsigned NOT NULL DEFAULT 0, + `account` int(11) unsigned NOT NULL DEFAULT 0, + `motditem` int(11) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`resultid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pollresults` +-- + +LOCK TABLES `pollresults` WRITE; +/*!40000 ALTER TABLE `pollresults` DISABLE KEYS */; +/*!40000 ALTER TABLE `pollresults` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `referers` +-- + +DROP TABLE IF EXISTS `referers`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `referers` ( + `refererid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `uri` text DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `last` datetime DEFAULT NULL, + `site` varchar(50) NOT NULL, + `dest` varchar(255) DEFAULT NULL, + `ip` varchar(40) DEFAULT NULL, + PRIMARY KEY (`refererid`), + KEY `uri` (`uri`(100)), + KEY `site` (`site`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `referers` +-- + +LOCK TABLES `referers` WRITE; +/*!40000 ALTER TABLE `referers` DISABLE KEYS */; +/*!40000 ALTER TABLE `referers` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `settings` +-- + +DROP TABLE IF EXISTS `settings`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `settings` ( + `setting` varchar(20) NOT NULL, + `value` varchar(255) NOT NULL, + PRIMARY KEY (`setting`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `settings` +-- + +LOCK TABLES `settings` WRITE; +/*!40000 ALTER TABLE `settings` DISABLE KEYS */; +INSERT INTO `settings` VALUES ('allowclans','1'),('allowspecialswitch','1'),('automaster','1'),('barkeep','`)Cedrik'),('beta','0'),('betaperplayer','1'),('cachetranslations','0'),('charset','ISO-8859-1'),('collecttexts','0'),('daysperday','4'),('defaultlanguage','en'),('defaultskin','jade.htm'),('enablecompanions','1'),('enabletranslation','1'),('expirecontent','180'),('expirenewacct','10'),('expireoldacct','45'),('expiretrashacct','1'),('fightsforinterest','4'),('gameoffsetseconds','0'),('game_epoch','2020-07-13 00:00:00 +0000'),('gravefightsperday','10'),('homecurtime','1'),('homenewdaytime','1'),('homenewestplayer','1'),('homeskinselect','1'),('innname','The Boar\'s Head Inn'),('installer_version','1.1.2 Dragonprime Edition'),('lastdboptimize','2020-08-11 19:08:59'),('last_char_expire','2020-08-12 19:08:59'),('logdnet','0'),('loginbanner','*BETA* This is a BETA of this website, things are likely to change now and again, as it is under active development *BETA*'),('LOGINTIMEOUT','900'),('maxinterest','10'),('maxonline','0'),('mininterest','1'),('newdaycron','0'),('newdaySemaphore','2020-08-12 19:08:59'),('newestplayer',''),('oldmail','14'),('OnlineCount','0'),('OnlineCountLast','1597259479'),('paypalcurrency','USD'),('paypalemail',''),('permacollect','0'),('pvp','1'),('pvpday','3'),('resurrectionturns','-6'),('serverlanguages','en,English,fr,Fran�ais,dk,Danish,de,Deutsch,es,Espa�ol,it,Italian'),('serverurl','http://_/'),('show_notices','0'),('tl_maxallowed','0'),('turns','10'),('villagechance','0'),('villagename','Degolburg'); +/*!40000 ALTER TABLE `settings` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `taunts` +-- + +DROP TABLE IF EXISTS `taunts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `taunts` ( + `tauntid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `taunt` text DEFAULT NULL, + `editor` varchar(50) DEFAULT NULL, + PRIMARY KEY (`tauntid`) +) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `taunts` +-- + +LOCK TABLES `taunts` WRITE; +/*!40000 ALTER TABLE `taunts` DISABLE KEYS */; +INSERT INTO `taunts` VALUES (1,'`5\"`6Just wait for my revenge, `4%W`6. It will be swift!`5\" %w declares.','Bluspring'),(2,'`5\"`6I\'m really going to enjoy this new `4%x`6 that %w`6 had,`5\" exclaimed %W.','joe'),(3,'`5\"`6Aah, so `bthat\'s`b what `4%X`6 is for!`5\" exclaimed %W','joe'),(4,'`5\"`6Oh man! I didn\'t think you had it in you, `5%W`6,`5\" %w exclaims.','Bluspring'),(5,'`5%W was overheard saying, \"`6%p `4%x`6 was no match for my `4%X`6!`5\"','Bluspring'),(6,'`5\"`6You know, you really shouldn\'t have a `4%x`6 unless you know how to use it,`5\" suggested %W.','Bluspring'),(7,'`5\"`6`bARRRGGGGGGG`b!!`5\" %w screams in frustration.','Bluspring'),(8,'`5\"`6How could I be so feeble?`5\" %w laments.','Bluspring'),(9,'`5\"`6I must not be as sturdy as I thought...!`5\" %w concedes.','Bluspring'),(10,'`5\"`6Watch your back, `4%W`6, I am coming for you!`5\" %w warns.','Bluspring'),(11,'`5\"`6This both sucks and blows!`5\" wails %w.','Bluspring'),(12,'`5\"`6I see London, I see France, I see `4%w\'s`6 underpants!`5\" reveals %W.','Bluspring'),(13,'`5\"`6The Healer\'s Hut can\'t help you now, `4%w`6!`5\" chides %W.','Bluspring'),(14,'`5%W smiles. \"`6You are too slow. You are too weak.`5\"','Bluspring'),(15,'`5%w bangs %p head against a stone...\"`6Stupid, stupid, stupid!`5\" %o was heard to say.','Bluspring'),(16,'`5\"`6My ego can\'t take much more of this bruising!`5\" exclaims %w.','Bluspring'),(17,'`5\"`6Why didn\'t I become a successful doctor like my father suggested?`5\" wonders %w aloud.','Bluspring'),(18,'`5\"`6Maybe `bnext`b time you won\'t be so cocky!`5\" laughs %W','Bluspring'),(19,'`5\"`6A baby could wield a `4%x `6better than that!`5\" %W proclaims.','Bluspring'),(20,'`5\"`6You should have just stayed in bed,`5\" %W suggests.','Bluspring'),(21,'`5\"`6Well isn\'t that a kick in the crotch?!`5\" %w observes.','Bluspring'),(22,'`5\"`6Come back when you learn how to fight,`5\" %W scoffs.','Bluspring'),(23,'`5\"`6Next time, eat your Wheaties,`5\" %W suggests.','Bluspring'),(24,'`5 \"`6You are dishonorable, `4%W`6!`5\" %w cries.','Bluspring'),(25,'`5\"`4%w`6, your lack of posture is a disgrace,`5\" %W states. ','Bluspring'),(26,'`5\"`6You know, `4%w`6 really had it coming to %s after all those things `bI`b said about `b%p`b mom`5,\" commented %W.','Joe'); +/*!40000 ALTER TABLE `taunts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `titles` +-- + +DROP TABLE IF EXISTS `titles`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `titles` ( + `titleid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `dk` int(11) NOT NULL DEFAULT 0, + `ref` varchar(100) NOT NULL, + `male` varchar(25) NOT NULL, + `female` varchar(25) NOT NULL, + PRIMARY KEY (`titleid`), + KEY `dk` (`dk`) +) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `titles` +-- + +LOCK TABLES `titles` WRITE; +/*!40000 ALTER TABLE `titles` DISABLE KEYS */; +INSERT INTO `titles` VALUES (1,0,'','Farmboy','Farmgirl'),(2,1,'','Page','Page'),(3,2,'','Squire','Squire'),(4,3,'','Gladiator','Gladiatrix'),(5,4,'','Legionnaire','Legioness'),(6,5,'','Centurion','Centurioness'),(7,6,'','Sir','Madam'),(8,7,'','Reeve','Reeve'),(9,8,'','Steward','Steward'),(10,9,'','Mayor','Mayoress'),(11,10,'','Baron','Baroness'),(12,11,'','Count','Countess'),(13,12,'','Viscount','Viscountess'),(14,13,'','Marquis','Marchioness'),(15,14,'','Chancellor','Chancelloress'),(16,15,'','Prince','Princess'),(17,16,'','King','Queen'),(18,17,'','Emperor','Empress'),(19,18,'','Angel','Angel'),(20,19,'','Archangel','Archangel'),(21,20,'','Principality','Principality'),(22,21,'','Power','Power'),(23,22,'','Virtue','Virtue'),(24,23,'','Dominion','Dominion'),(25,24,'','Throne','Throne'),(26,25,'','Cherub','Cherub'),(27,26,'','Seraph','Seraph'),(28,27,'','Demigod','Demigoddess'),(29,28,'','Titan','Titaness'),(30,29,'','Archtitan','Archtitaness'),(31,30,'','Undergod','Undergoddess'),(32,31,'','God','Goddess'); +/*!40000 ALTER TABLE `titles` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `translations` +-- + +DROP TABLE IF EXISTS `translations`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `translations` ( + `tid` int(11) NOT NULL AUTO_INCREMENT, + `language` varchar(10) NOT NULL, + `uri` varchar(255) NOT NULL, + `intext` blob NOT NULL, + `outtext` blob NOT NULL, + `author` varchar(50) DEFAULT NULL, + `version` varchar(50) DEFAULT NULL, + PRIMARY KEY (`tid`), + KEY `language` (`language`,`uri`), + KEY `uri` (`uri`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `translations` +-- + +LOCK TABLES `translations` WRITE; +/*!40000 ALTER TABLE `translations` DISABLE KEYS */; +/*!40000 ALTER TABLE `translations` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `untranslated` +-- + +DROP TABLE IF EXISTS `untranslated`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `untranslated` ( + `intext` blob NOT NULL, + `language` varchar(10) NOT NULL, + `namespace` varchar(255) NOT NULL, + PRIMARY KEY (`intext`(200),`language`,`namespace`), + KEY `language` (`language`), + KEY `intext1` (`intext`(200),`language`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `untranslated` +-- + +LOCK TABLES `untranslated` WRITE; +/*!40000 ALTER TABLE `untranslated` DISABLE KEYS */; +/*!40000 ALTER TABLE `untranslated` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `weapons` +-- + +DROP TABLE IF EXISTS `weapons`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `weapons` ( + `weaponid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `weaponname` varchar(128) DEFAULT NULL, + `value` int(11) NOT NULL DEFAULT 0, + `damage` int(11) NOT NULL DEFAULT 1, + `level` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`weaponid`) +) ENGINE=InnoDB AUTO_INCREMENT=196 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `weapons` +-- + +LOCK TABLES `weapons` WRITE; +/*!40000 ALTER TABLE `weapons` DISABLE KEYS */; +INSERT INTO `weapons` VALUES (1,'Rake',48,1,0),(2,'Trowel',225,2,0),(3,'Spade',585,3,0),(4,'Adze',990,4,0),(5,'Gardening Hoe',1575,5,0),(6,'Torch',2250,6,0),(7,'Pitchfork',2790,7,0),(8,'Shovel',3420,8,0),(9,'Hedge Trimmers',4230,9,0),(10,'Hatchet',5040,10,0),(11,'Carving Knife',5850,11,0),(12,'Rusty Iron Wood-Chopping Axe',6840,12,0),(13,'Dull Steel Wood-chopping Axe',8010,13,0),(14,'Sharp Steel Wood-chopping Axe',9000,14,0),(15,'Woodsman\'s Axe',10350,15,0),(16,'Pebbles',48,1,1),(17,'Stones',225,2,1),(18,'Rocks',585,3,1),(19,'Small Treebranch',990,4,1),(20,'Large Treebranch',1575,5,1),(21,'Thickly Padded Sparring Pole',2250,6,1),(22,'Thinly Padded Sparring Pole',2790,7,1),(23,'Wooden Stave',3420,8,1),(24,'Wooden Practice Sword',4230,9,1),(25,'Blunt Bronze Short Sword',5040,10,1),(26,'Well Crafted Bronze Short Sword',5850,11,1),(27,'Rusty Steel Short Sword',6840,12,1),(28,'Dull Steel Short Sword',8010,13,1),(29,'Sharp Steel Short Sword',9000,14,1),(30,'Pages\'s Short Sword',10350,15,1),(31,'Dull Bronze Sword',48,1,2),(32,'Bronze Sword',225,2,2),(33,'Well Crafted Bronze Sword',585,3,2),(34,'Dull Iron Sword',990,4,2),(35,'Iron Sword',1575,5,2),(36,'Enchanted Sword',9000,14,2),(37,'Well Crafted Iron Sword',2250,6,2),(38,'Rusty Steel Sword',2790,7,2),(39,'Dull Steel Sword',3420,8,2),(40,'Well Crafted Steel Sword',4230,9,2),(41,'Engraved Steel Sword',5040,10,2),(42,'Steel Sword with Jeweled Hilt',5850,11,2),(43,'Golden Hilted Sword',6840,12,2),(44,'Platinum Hilted Sword',8010,13,2),(45,'Adept\'s Sword',10350,15,2),(46,'Steel Longsword',48,1,3),(47,'Etched Steel Longsword',585,3,3),(48,'Polished Steel Longsword',225,2,3),(49,'Well Balanced Steel Longsword',990,4,3),(50,'Perfectly Balanced Steel Longsword',1575,5,3),(51,'Engraved Steel Longsword',2250,6,3),(52,'Longsword with Silver-plated Hilt',2790,7,3),(53,'Longsword with Gold-plated Hilt',3420,8,3),(54,'Longsword with Solid Gold Hilt',4230,9,3),(55,'Longsword with Solid Platinum Hilt',5040,10,3),(56,'Moonsilver Longsword',5850,11,3),(57,'Autumngold Longsword',6840,12,3),(58,'Elfsilver Longsword',8010,13,3),(59,'Enchanted Longsword',9000,14,3),(60,'Wolfmaster\'s Longsword',10350,15,3),(61,'Poorly Balanced Bastard Sword',48,1,4),(62,'Tarnished Bastard Sword',225,2,4),(63,'Iron Bastard Sword',585,3,4),(64,'Steel Bastard Sword',990,4,4),(65,'Well Balanced Steel Bastard Sword',1575,5,4),(66,'Perfectly Balanced Bastard Sword',2250,6,4),(67,'Rune-etched Bastard Sword',2790,7,4),(68,'Bronze-inlay Bastard Sword',3420,8,4),(69,'Silver-inlay Bastard Sword',4230,9,4),(70,'Gold-inlay Bastard Sword',5040,10,4),(71,'Nightsilver Bastard Sword',5850,11,4),(72,'Morning-gold Bastard Sword',6840,12,4),(73,'Truesplendor Bastard Sword',8010,13,4),(74,'Enchanted Elfgold Bastard Sword',9000,14,4),(75,'Noble\'s Bastard Sword',10350,15,4),(76,'Tarnished Iron Claymore',48,1,5),(77,'Polished Iron Claymore',225,2,5),(78,'Rusty Steel Claymore',585,3,5),(79,'Steel Claymore',990,4,5),(80,'Finely Crafted Steel Claymore',1575,5,5),(81,'Scottish Broadsword',2250,6,5),(82,'Viking War Sword',2790,7,5),(83,'Barbarian\'s Sword',3420,8,5),(84,'Scottish Basket-Hilt Claymore',4230,9,5),(85,'Agincourt Steel Sword',5040,10,5),(86,'Celtic Combat Sword',5850,11,5),(87,'Norseman\'s Sword',6840,12,5),(88,'Knight\'s Sword',8010,13,5),(89,'Heraldic Lion Claymore',9000,14,5),(90,'Dragon Soldier\'s Claymore',10350,15,5),(91,'Two Broken Short Swords',48,1,6),(92,'Two Short Swords',225,2,6),(93,'Iron Scimitars',585,3,6),(94,'Balanced Scimitars',990,4,6),(95,'Tarnished Steel Scimitars',1575,5,6),(96,'Rusty Steel Scimitars',2250,6,6),(97,'Steel Scimitars',2790,7,6),(98,'Bronze Hilted Steel Scimitars',3420,8,6),(99,'Gold Hilted Steel Scimitars',4230,9,6),(100,'Platinum Hilted Steel Scimitars',5040,10,6),(101,'Well Crafted Adamantite Scimitars',5850,11,6),(102,'Perfectly Crafted Adamantite Scimitars',6840,12,6),(103,'Enchanted Scimitars',8010,13,6),(104,'Drow Crafted Scimitars',9000,14,6),(105,'Unicorn Blood-Forged Scimitars',10350,15,6),(106,'Chipped Iron Axe',48,1,7),(107,'Iron Axe',225,2,7),(108,'Rusty Steel Axe',585,3,7),(109,'Fine Steel Axe',990,4,7),(110,'Lumberjack\'s Axe',1575,5,7),(111,'Low Quality Battle Axe',2250,6,7),(112,'Medium Quality Battle Axe',2790,7,7),(113,'High Quality Battle Axe',3420,8,7),(114,'Double Bladed Axe',4230,9,7),(115,'Double Bladed Battle Axe',5040,10,7),(116,'Gold Plated Battle Axe',5850,11,7),(117,'Platinum Hilted Battle Axe',6840,12,7),(118,'Enchanted Battle Axe',8010,13,7),(119,'Dwarf Smith\'s Battle Axe',9000,14,7),(120,'Dwarf Warrior\'s Battle Axe',10350,15,7),(121,'Broken Iron Mace',48,1,8),(122,'Tarnished Iron Mace',225,2,8),(123,'Polished Iron Mace',585,3,8),(124,'Well Crafted Iron Mace',990,4,8),(125,'Polished Steel Mace',1575,5,8),(126,'Well Crafted Steel Mace',2250,6,8),(127,'Poorly Balanced Double Mace',2790,7,8),(128,'Well Balanced Double Mace',3420,8,8),(129,'Battle Mace',4230,9,8),(130,'War Chieftain\'s Battle Mace',5040,10,8),(131,'War Chieftain\'s Morning Star',5850,11,8),(132,'Adamantite Morning Star',6840,12,8),(133,'Dwarf Crafted Morning Star',8010,13,8),(134,'Dwarf Warlord\'s Morning Star',9000,14,8),(135,'Enchanted Morning Star',10350,15,8),(136,'Boot Knife',48,1,9),(137,'Target Knife',225,2,9),(138,'Blackjack',585,3,9),(139,'Throwing Star',990,4,9),(140,'Hira-Shuriken',1575,5,9),(141,'Throwing Spike',2250,6,9),(142,'Atlatl',2790,7,9),(143,'Qilamitautit Bolo',3420,8,9),(144,'War Quoait',4230,9,9),(145,'Cha Kran',5040,10,9),(146,'Fei Piau',5850,11,9),(147,'Jen Piau',6840,12,9),(148,'Gau dim Piau',8010,13,9),(149,'Enchanted Throwing Axe',9000,14,9),(150,'Teksolo\'s Ninja Stars',10350,15,9),(151,'Farmer\'s Bow & Wooden Arrows',48,1,10),(152,'Farmer\'s Bow & Stone Tipped Arrows',225,2,10),(153,'Farmer\'s Bow & Steel Tipped Arrows',585,3,10),(154,'Hunter\'s Bow & Wooden Arrows',990,4,10),(155,'Hunter\'s Bow & Stone Tipped Arrows',1575,5,10),(156,'Hunter\'s Bow & Steel Tipped Arrows',2250,6,10),(157,'Ranger\'s Bow & Wooden Arrows',2790,7,10),(158,'Ranger\'s Bow & Stone Tipped Arrows',3420,8,10),(159,'Ranger\'s Bow & Steel Tipped Arrows',4230,9,10),(160,'Longbow',5040,10,10),(161,'Crossbow',5850,11,10),(162,'Elvish Longbow',6840,12,10),(163,'Elvish Longbow & Flame Tipped Arrows',8010,13,10),(164,'Elvish Longbow & Enchanted Arrows',9000,14,10),(165,'Longbow of the Elf King',10350,15,10),(166,'MightyE\'s Long Sword',225,2,11),(167,'MightyE\'s Short Sword',48,1,11),(168,'MightyE\'s Bastard Sword',585,3,11),(169,'MightyE\'s Scimitars',990,4,11),(170,'MightyE\'s Battle Axe',1575,5,11),(171,'MightyE\'s Throwing Hammer',2250,6,11),(172,'MightyE\'s Morning Star',2790,7,11),(173,'MightyE\'s Compound Bow',3420,8,11),(174,'MightyE\'s Rapier',4230,9,11),(175,'MightyE\'s Sabre',5040,10,11),(176,'MightyE\'s Light Sabre',5850,11,11),(177,'MightyE\'s Wakizashi',6840,12,11),(178,'MightyE\'s 2-Handed War Sword',8010,13,11),(179,'MightyE\'s 2-handed War Axe',9000,14,11),(180,'MightyE\'s Claymore',10350,15,11),(181,'Spell of Fire',48,1,12),(182,'Spell of Earthquake',225,2,12),(183,'Spell of Flood',585,3,12),(184,'Spell of Hurricane',990,4,12),(185,'Spell of Mind Control',1575,5,12),(186,'Spell of Lightning',2250,6,12),(187,'Spell of Weakness',2790,7,12),(188,'Spell of Fear',3420,8,12),(189,'Spell of Poison',4230,9,12),(190,'Spell of Spirit Possession',5040,10,12),(191,'Spell of Despair',5850,11,12),(192,'Spell of Bat Summoning',6840,12,12),(193,'Spell of Wolf Summoning',8010,13,12),(194,'Spell of Unicorn Summoning',9000,14,12),(195,'Spell of Dragon Summoning',10350,15,12); +/*!40000 ALTER TABLE `weapons` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2020-08-12 19:58:00 diff --git a/lotgd-db/mysql/aria_log.00000001 b/lotgd-db/mysql/aria_log.00000001 new file mode 100755 index 0000000..a15d9e1 Binary files /dev/null and b/lotgd-db/mysql/aria_log.00000001 differ diff --git a/lotgd-db/mysql/aria_log_control b/lotgd-db/mysql/aria_log_control new file mode 100755 index 0000000..2f38bc8 Binary files /dev/null and b/lotgd-db/mysql/aria_log_control differ diff --git a/lotgd-db/mysql/ib_buffer_pool b/lotgd-db/mysql/ib_buffer_pool new file mode 100755 index 0000000..c92097d --- /dev/null +++ b/lotgd-db/mysql/ib_buffer_pool @@ -0,0 +1,478 @@ +40,3 +40,2 +0,420 +40,1 +40,0 +39,5 +39,4 +39,3 +39,2 +0,419 +39,1 +39,0 +38,5 +38,4 +38,3 +38,2 +0,418 +38,1 +38,0 +0,417 +37,4 +37,3 +37,2 +0,416 +37,1 +37,0 +36,3 +36,2 +36,1 +36,0 +0,415 +35,3 +35,2 +35,1 +35,0 +34,5 +34,4 +34,3 +34,2 +34,1 +34,0 +33,3 +33,2 +33,1 +33,0 +32,3 +32,2 +32,1 +32,0 +2,7 +2,6 +0,414 +31,4 +31,3 +31,2 +0,413 +31,1 +31,0 +0,412 +0,411 +0,410 +0,409 +30,5 +30,4 +30,3 +30,2 +0,408 +30,1 +30,0 +0,407 +0,406 +0,405 +29,3 +29,2 +0,404 +29,1 +29,0 +0,403 +0,402 +0,401 +28,4 +28,3 +28,2 +0,400 +28,1 +28,0 +0,399 +0,398 +27,3 +27,2 +0,397 +27,1 +27,0 +0,396 +0,395 +0,394 +26,3 +26,2 +0,393 +26,1 +26,0 +0,392 +0,391 +25,5 +25,4 +25,3 +25,2 +0,390 +25,1 +25,0 +0,389 +0,388 +0,387 +24,3 +24,2 +0,386 +24,1 +24,0 +0,385 +0,384 +23,3 +23,2 +0,383 +23,1 +23,0 +0,382 +0,381 +0,380 +22,4 +22,3 +22,2 +0,379 +22,1 +22,0 +0,378 +0,377 +0,376 +21,5 +21,4 +21,3 +21,2 +0,375 +21,1 +21,0 +2,5 +2,4 +0,374 +0,373 +20,3 +20,2 +0,372 +20,1 +20,0 +0,371 +0,370 +0,369 +19,3 +19,2 +0,368 +0,367 +0,366 +19,1 +19,0 +0,365 +0,364 +18,5 +18,4 +18,3 +18,2 +0,363 +18,1 +18,0 +0,362 +0,361 +17,3 +17,2 +0,360 +17,1 +17,0 +0,359 +0,358 +16,3 +16,2 +0,357 +16,1 +16,0 +0,356 +0,355 +0,354 +15,4 +15,3 +15,2 +0,353 +15,1 +15,0 +0,352 +0,351 +14,6 +14,5 +14,4 +14,3 +14,2 +0,350 +14,1 +14,0 +0,349 +0,348 +0,347 +13,5 +13,4 +13,3 +13,2 +0,346 +13,1 +13,0 +12,8 +12,7 +12,6 +12,5 +0,345 +0,344 +0,343 +12,4 +12,3 +12,2 +0,342 +12,1 +12,0 +0,341 +0,340 +0,339 +11,3 +11,2 +0,338 +11,1 +11,0 +0,337 +0,336 +10,5 +10,4 +10,3 +10,2 +0,335 +10,1 +10,0 +0,334 +0,333 +9,5 +9,4 +9,3 +9,2 +0,332 +9,1 +9,0 +0,331 +0,330 +8,6 +8,5 +8,4 +8,3 +8,2 +0,329 +8,1 +8,0 +0,328 +0,327 +0,326 +0,325 +0,324 +7,3 +7,2 +0,323 +0,322 +7,1 +7,0 +6,5 +6,4 +0,321 +0,320 +0,319 +6,3 +6,2 +0,318 +6,1 +6,0 +0,317 +5,15 +5,14 +5,13 +5,12 +5,11 +5,10 +5,9 +5,8 +5,7 +5,6 +5,5 +5,4 +5,3 +5,2 +5,1 +5,0 +4,3 +4,2 +4,1 +4,0 +3,6 +3,5 +3,4 +3,3 +3,2 +3,1 +3,0 +2,3 +2,2 +2,1 +2,0 +1,3 +1,2 +1,1 +1,0 +0,243 +0,9 +0,0 +0,310 +0,305 +0,308 +0,304 +0,303 +0,302 +0,307 +0,12 +0,10 +0,8 +0,300 +0,299 +0,298 +0,297 +0,296 +0,295 +0,294 +0,293 +0,292 +0,291 +0,290 +0,289 +0,288 +0,287 +0,286 +0,285 +0,284 +0,283 +0,282 +0,281 +0,280 +0,279 +0,278 +0,277 +0,276 +0,275 +0,274 +0,273 +0,272 +0,271 +0,270 +0,269 +0,268 +0,267 +0,266 +0,265 +0,264 +0,263 +0,262 +0,261 +0,260 +0,259 +0,258 +0,257 +0,256 +0,255 +0,254 +0,253 +0,252 +0,251 +0,250 +0,249 +0,248 +0,247 +0,246 +0,245 +0,244 +0,242 +0,241 +0,240 +0,239 +0,238 +0,237 +0,236 +0,235 +0,234 +0,233 +0,232 +0,231 +0,230 +0,229 +0,228 +0,227 +0,226 +0,225 +0,224 +0,223 +0,222 +0,221 +0,220 +0,219 +0,218 +0,217 +0,216 +0,215 +0,214 +0,213 +0,212 +0,211 +0,210 +0,209 +0,208 +0,207 +0,206 +0,205 +0,204 +0,203 +0,202 +0,201 +0,200 +0,199 +0,198 +0,197 +0,196 +0,195 +0,194 +0,193 +0,192 +0,63 +0,62 +0,61 +0,60 +0,59 +0,58 +0,57 +0,56 +0,55 +0,54 +0,53 +0,316 +0,52 +0,315 +0,51 +0,314 +0,50 +0,313 +0,49 +0,312 +0,48 +0,311 +0,47 +0,309 +0,46 +0,306 +0,45 +0,301 +0,6 +0,5 +0,1 +0,11 +0,4 +0,2 +0,3 +0,7 diff --git a/lotgd-db/mysql/ib_logfile0 b/lotgd-db/mysql/ib_logfile0 new file mode 100755 index 0000000..d4b0002 Binary files /dev/null and b/lotgd-db/mysql/ib_logfile0 differ diff --git a/lotgd-db/mysql/ibdata1 b/lotgd-db/mysql/ibdata1 new file mode 100755 index 0000000..54d2244 Binary files /dev/null and b/lotgd-db/mysql/ibdata1 differ diff --git a/lotgd-db/mysql/ibtmp1 b/lotgd-db/mysql/ibtmp1 new file mode 100644 index 0000000..1c35b5c Binary files /dev/null and b/lotgd-db/mysql/ibtmp1 differ diff --git a/lotgd-db/mysql/lotgd/accounts.frm b/lotgd-db/mysql/lotgd/accounts.frm new file mode 100644 index 0000000..20f6739 Binary files /dev/null and b/lotgd-db/mysql/lotgd/accounts.frm differ diff --git a/lotgd-db/mysql/lotgd/accounts.ibd b/lotgd-db/mysql/lotgd/accounts.ibd new file mode 100644 index 0000000..7892632 Binary files /dev/null and b/lotgd-db/mysql/lotgd/accounts.ibd differ diff --git a/lotgd-db/mysql/lotgd/accounts_output.frm b/lotgd-db/mysql/lotgd/accounts_output.frm new file mode 100644 index 0000000..12da1e5 Binary files /dev/null and b/lotgd-db/mysql/lotgd/accounts_output.frm differ diff --git a/lotgd-db/mysql/lotgd/accounts_output.ibd b/lotgd-db/mysql/lotgd/accounts_output.ibd new file mode 100644 index 0000000..b90b826 Binary files /dev/null and b/lotgd-db/mysql/lotgd/accounts_output.ibd differ diff --git a/lotgd-db/mysql/lotgd/armor.frm b/lotgd-db/mysql/lotgd/armor.frm new file mode 100644 index 0000000..f643a28 Binary files /dev/null and b/lotgd-db/mysql/lotgd/armor.frm differ diff --git a/lotgd-db/mysql/lotgd/armor.ibd b/lotgd-db/mysql/lotgd/armor.ibd new file mode 100644 index 0000000..f4d096a Binary files /dev/null and b/lotgd-db/mysql/lotgd/armor.ibd differ diff --git a/lotgd-db/mysql/lotgd/bans.frm b/lotgd-db/mysql/lotgd/bans.frm new file mode 100644 index 0000000..48c3c96 Binary files /dev/null and b/lotgd-db/mysql/lotgd/bans.frm differ diff --git a/lotgd-db/mysql/lotgd/bans.ibd b/lotgd-db/mysql/lotgd/bans.ibd new file mode 100644 index 0000000..9f3ea04 Binary files /dev/null and b/lotgd-db/mysql/lotgd/bans.ibd differ diff --git a/lotgd-db/mysql/lotgd/clans.frm b/lotgd-db/mysql/lotgd/clans.frm new file mode 100644 index 0000000..227417f Binary files /dev/null and b/lotgd-db/mysql/lotgd/clans.frm differ diff --git a/lotgd-db/mysql/lotgd/clans.ibd b/lotgd-db/mysql/lotgd/clans.ibd new file mode 100644 index 0000000..3982752 Binary files /dev/null and b/lotgd-db/mysql/lotgd/clans.ibd differ diff --git a/lotgd-db/mysql/lotgd/commentary.frm b/lotgd-db/mysql/lotgd/commentary.frm new file mode 100644 index 0000000..b954975 Binary files /dev/null and b/lotgd-db/mysql/lotgd/commentary.frm differ diff --git a/lotgd-db/mysql/lotgd/commentary.ibd b/lotgd-db/mysql/lotgd/commentary.ibd new file mode 100644 index 0000000..f71fb7e Binary files /dev/null and b/lotgd-db/mysql/lotgd/commentary.ibd differ diff --git a/lotgd-db/mysql/lotgd/companions.frm b/lotgd-db/mysql/lotgd/companions.frm new file mode 100644 index 0000000..9eaeffc Binary files /dev/null and b/lotgd-db/mysql/lotgd/companions.frm differ diff --git a/lotgd-db/mysql/lotgd/companions.ibd b/lotgd-db/mysql/lotgd/companions.ibd new file mode 100644 index 0000000..2597029 Binary files /dev/null and b/lotgd-db/mysql/lotgd/companions.ibd differ diff --git a/lotgd-db/mysql/lotgd/creatures.frm b/lotgd-db/mysql/lotgd/creatures.frm new file mode 100644 index 0000000..a329da9 Binary files /dev/null and b/lotgd-db/mysql/lotgd/creatures.frm differ diff --git a/lotgd-db/mysql/lotgd/creatures.ibd b/lotgd-db/mysql/lotgd/creatures.ibd new file mode 100644 index 0000000..7c93ddf Binary files /dev/null and b/lotgd-db/mysql/lotgd/creatures.ibd differ diff --git a/lotgd-db/mysql/lotgd/db.opt b/lotgd-db/mysql/lotgd/db.opt new file mode 100755 index 0000000..ccbf699 --- /dev/null +++ b/lotgd-db/mysql/lotgd/db.opt @@ -0,0 +1,2 @@ +default-character-set=utf8mb4 +default-collation=utf8mb4_general_ci diff --git a/lotgd-db/mysql/lotgd/debuglog.frm b/lotgd-db/mysql/lotgd/debuglog.frm new file mode 100644 index 0000000..2e5d733 Binary files /dev/null and b/lotgd-db/mysql/lotgd/debuglog.frm differ diff --git a/lotgd-db/mysql/lotgd/debuglog.ibd b/lotgd-db/mysql/lotgd/debuglog.ibd new file mode 100644 index 0000000..b8ec2fa Binary files /dev/null and b/lotgd-db/mysql/lotgd/debuglog.ibd differ diff --git a/lotgd-db/mysql/lotgd/faillog.frm b/lotgd-db/mysql/lotgd/faillog.frm new file mode 100644 index 0000000..ae016f3 Binary files /dev/null and b/lotgd-db/mysql/lotgd/faillog.frm differ diff --git a/lotgd-db/mysql/lotgd/faillog.ibd b/lotgd-db/mysql/lotgd/faillog.ibd new file mode 100644 index 0000000..9dfe411 Binary files /dev/null and b/lotgd-db/mysql/lotgd/faillog.ibd differ diff --git a/lotgd-db/mysql/lotgd/gamelog.frm b/lotgd-db/mysql/lotgd/gamelog.frm new file mode 100644 index 0000000..666eac8 Binary files /dev/null and b/lotgd-db/mysql/lotgd/gamelog.frm differ diff --git a/lotgd-db/mysql/lotgd/gamelog.ibd b/lotgd-db/mysql/lotgd/gamelog.ibd new file mode 100644 index 0000000..cf2a671 Binary files /dev/null and b/lotgd-db/mysql/lotgd/gamelog.ibd differ diff --git a/lotgd-db/mysql/lotgd/logdnet.frm b/lotgd-db/mysql/lotgd/logdnet.frm new file mode 100644 index 0000000..0b26e56 Binary files /dev/null and b/lotgd-db/mysql/lotgd/logdnet.frm differ diff --git a/lotgd-db/mysql/lotgd/logdnet.ibd b/lotgd-db/mysql/lotgd/logdnet.ibd new file mode 100644 index 0000000..f0ae8aa Binary files /dev/null and b/lotgd-db/mysql/lotgd/logdnet.ibd differ diff --git a/lotgd-db/mysql/lotgd/logdnetbans.frm b/lotgd-db/mysql/lotgd/logdnetbans.frm new file mode 100644 index 0000000..b94ae8a Binary files /dev/null and b/lotgd-db/mysql/lotgd/logdnetbans.frm differ diff --git a/lotgd-db/mysql/lotgd/logdnetbans.ibd b/lotgd-db/mysql/lotgd/logdnetbans.ibd new file mode 100644 index 0000000..d9d455c Binary files /dev/null and b/lotgd-db/mysql/lotgd/logdnetbans.ibd differ diff --git a/lotgd-db/mysql/lotgd/mail.frm b/lotgd-db/mysql/lotgd/mail.frm new file mode 100644 index 0000000..ab7db0b Binary files /dev/null and b/lotgd-db/mysql/lotgd/mail.frm differ diff --git a/lotgd-db/mysql/lotgd/mail.ibd b/lotgd-db/mysql/lotgd/mail.ibd new file mode 100644 index 0000000..e3fafaf Binary files /dev/null and b/lotgd-db/mysql/lotgd/mail.ibd differ diff --git a/lotgd-db/mysql/lotgd/masters.frm b/lotgd-db/mysql/lotgd/masters.frm new file mode 100644 index 0000000..f625cf9 Binary files /dev/null and b/lotgd-db/mysql/lotgd/masters.frm differ diff --git a/lotgd-db/mysql/lotgd/masters.ibd b/lotgd-db/mysql/lotgd/masters.ibd new file mode 100644 index 0000000..4a32279 Binary files /dev/null and b/lotgd-db/mysql/lotgd/masters.ibd differ diff --git a/lotgd-db/mysql/lotgd/moderatedcomments.frm b/lotgd-db/mysql/lotgd/moderatedcomments.frm new file mode 100644 index 0000000..f631f85 Binary files /dev/null and b/lotgd-db/mysql/lotgd/moderatedcomments.frm differ diff --git a/lotgd-db/mysql/lotgd/moderatedcomments.ibd b/lotgd-db/mysql/lotgd/moderatedcomments.ibd new file mode 100644 index 0000000..ea896ae Binary files /dev/null and b/lotgd-db/mysql/lotgd/moderatedcomments.ibd differ diff --git a/lotgd-db/mysql/lotgd/module_event_hooks.frm b/lotgd-db/mysql/lotgd/module_event_hooks.frm new file mode 100644 index 0000000..5a4efd7 Binary files /dev/null and b/lotgd-db/mysql/lotgd/module_event_hooks.frm differ diff --git a/lotgd-db/mysql/lotgd/module_event_hooks.ibd b/lotgd-db/mysql/lotgd/module_event_hooks.ibd new file mode 100644 index 0000000..20f1aae Binary files /dev/null and b/lotgd-db/mysql/lotgd/module_event_hooks.ibd differ diff --git a/lotgd-db/mysql/lotgd/module_hooks.frm b/lotgd-db/mysql/lotgd/module_hooks.frm new file mode 100644 index 0000000..5c32ca1 Binary files /dev/null and b/lotgd-db/mysql/lotgd/module_hooks.frm differ diff --git a/lotgd-db/mysql/lotgd/module_hooks.ibd b/lotgd-db/mysql/lotgd/module_hooks.ibd new file mode 100644 index 0000000..4f54d9f Binary files /dev/null and b/lotgd-db/mysql/lotgd/module_hooks.ibd differ diff --git a/lotgd-db/mysql/lotgd/module_objprefs.frm b/lotgd-db/mysql/lotgd/module_objprefs.frm new file mode 100644 index 0000000..6d703d4 Binary files /dev/null and b/lotgd-db/mysql/lotgd/module_objprefs.frm differ diff --git a/lotgd-db/mysql/lotgd/module_objprefs.ibd b/lotgd-db/mysql/lotgd/module_objprefs.ibd new file mode 100644 index 0000000..b71bef8 Binary files /dev/null and b/lotgd-db/mysql/lotgd/module_objprefs.ibd differ diff --git a/lotgd-db/mysql/lotgd/module_settings.frm b/lotgd-db/mysql/lotgd/module_settings.frm new file mode 100644 index 0000000..9979233 Binary files /dev/null and b/lotgd-db/mysql/lotgd/module_settings.frm differ diff --git a/lotgd-db/mysql/lotgd/module_settings.ibd b/lotgd-db/mysql/lotgd/module_settings.ibd new file mode 100644 index 0000000..6e64115 Binary files /dev/null and b/lotgd-db/mysql/lotgd/module_settings.ibd differ diff --git a/lotgd-db/mysql/lotgd/module_userprefs.frm b/lotgd-db/mysql/lotgd/module_userprefs.frm new file mode 100644 index 0000000..237e93e Binary files /dev/null and b/lotgd-db/mysql/lotgd/module_userprefs.frm differ diff --git a/lotgd-db/mysql/lotgd/module_userprefs.ibd b/lotgd-db/mysql/lotgd/module_userprefs.ibd new file mode 100644 index 0000000..fcf0819 Binary files /dev/null and b/lotgd-db/mysql/lotgd/module_userprefs.ibd differ diff --git a/lotgd-db/mysql/lotgd/modules.frm b/lotgd-db/mysql/lotgd/modules.frm new file mode 100644 index 0000000..d35fee7 Binary files /dev/null and b/lotgd-db/mysql/lotgd/modules.frm differ diff --git a/lotgd-db/mysql/lotgd/modules.ibd b/lotgd-db/mysql/lotgd/modules.ibd new file mode 100644 index 0000000..b4dbc73 Binary files /dev/null and b/lotgd-db/mysql/lotgd/modules.ibd differ diff --git a/lotgd-db/mysql/lotgd/motd.frm b/lotgd-db/mysql/lotgd/motd.frm new file mode 100644 index 0000000..16cf88a Binary files /dev/null and b/lotgd-db/mysql/lotgd/motd.frm differ diff --git a/lotgd-db/mysql/lotgd/motd.ibd b/lotgd-db/mysql/lotgd/motd.ibd new file mode 100644 index 0000000..32b40c7 Binary files /dev/null and b/lotgd-db/mysql/lotgd/motd.ibd differ diff --git a/lotgd-db/mysql/lotgd/mounts.frm b/lotgd-db/mysql/lotgd/mounts.frm new file mode 100644 index 0000000..01f9fdd Binary files /dev/null and b/lotgd-db/mysql/lotgd/mounts.frm differ diff --git a/lotgd-db/mysql/lotgd/mounts.ibd b/lotgd-db/mysql/lotgd/mounts.ibd new file mode 100644 index 0000000..ec3bb62 Binary files /dev/null and b/lotgd-db/mysql/lotgd/mounts.ibd differ diff --git a/lotgd-db/mysql/lotgd/nastywords.frm b/lotgd-db/mysql/lotgd/nastywords.frm new file mode 100644 index 0000000..315e76e Binary files /dev/null and b/lotgd-db/mysql/lotgd/nastywords.frm differ diff --git a/lotgd-db/mysql/lotgd/nastywords.ibd b/lotgd-db/mysql/lotgd/nastywords.ibd new file mode 100644 index 0000000..fa50a49 Binary files /dev/null and b/lotgd-db/mysql/lotgd/nastywords.ibd differ diff --git a/lotgd-db/mysql/lotgd/news.frm b/lotgd-db/mysql/lotgd/news.frm new file mode 100644 index 0000000..0bba4c4 Binary files /dev/null and b/lotgd-db/mysql/lotgd/news.frm differ diff --git a/lotgd-db/mysql/lotgd/news.ibd b/lotgd-db/mysql/lotgd/news.ibd new file mode 100644 index 0000000..ae0a2a0 Binary files /dev/null and b/lotgd-db/mysql/lotgd/news.ibd differ diff --git a/lotgd-db/mysql/lotgd/paylog.frm b/lotgd-db/mysql/lotgd/paylog.frm new file mode 100644 index 0000000..ac47051 Binary files /dev/null and b/lotgd-db/mysql/lotgd/paylog.frm differ diff --git a/lotgd-db/mysql/lotgd/paylog.ibd b/lotgd-db/mysql/lotgd/paylog.ibd new file mode 100644 index 0000000..2f798d3 Binary files /dev/null and b/lotgd-db/mysql/lotgd/paylog.ibd differ diff --git a/lotgd-db/mysql/lotgd/petitions.frm b/lotgd-db/mysql/lotgd/petitions.frm new file mode 100644 index 0000000..e8af47b Binary files /dev/null and b/lotgd-db/mysql/lotgd/petitions.frm differ diff --git a/lotgd-db/mysql/lotgd/petitions.ibd b/lotgd-db/mysql/lotgd/petitions.ibd new file mode 100644 index 0000000..ea647ee Binary files /dev/null and b/lotgd-db/mysql/lotgd/petitions.ibd differ diff --git a/lotgd-db/mysql/lotgd/pollresults.frm b/lotgd-db/mysql/lotgd/pollresults.frm new file mode 100644 index 0000000..02c48d2 Binary files /dev/null and b/lotgd-db/mysql/lotgd/pollresults.frm differ diff --git a/lotgd-db/mysql/lotgd/pollresults.ibd b/lotgd-db/mysql/lotgd/pollresults.ibd new file mode 100644 index 0000000..6948d0a Binary files /dev/null and b/lotgd-db/mysql/lotgd/pollresults.ibd differ diff --git a/lotgd-db/mysql/lotgd/referers.frm b/lotgd-db/mysql/lotgd/referers.frm new file mode 100644 index 0000000..c26d5ec Binary files /dev/null and b/lotgd-db/mysql/lotgd/referers.frm differ diff --git a/lotgd-db/mysql/lotgd/referers.ibd b/lotgd-db/mysql/lotgd/referers.ibd new file mode 100644 index 0000000..11d83d0 Binary files /dev/null and b/lotgd-db/mysql/lotgd/referers.ibd differ diff --git a/lotgd-db/mysql/lotgd/settings.frm b/lotgd-db/mysql/lotgd/settings.frm new file mode 100644 index 0000000..bd269d8 Binary files /dev/null and b/lotgd-db/mysql/lotgd/settings.frm differ diff --git a/lotgd-db/mysql/lotgd/settings.ibd b/lotgd-db/mysql/lotgd/settings.ibd new file mode 100644 index 0000000..7125705 Binary files /dev/null and b/lotgd-db/mysql/lotgd/settings.ibd differ diff --git a/lotgd-db/mysql/lotgd/taunts.frm b/lotgd-db/mysql/lotgd/taunts.frm new file mode 100644 index 0000000..871f454 Binary files /dev/null and b/lotgd-db/mysql/lotgd/taunts.frm differ diff --git a/lotgd-db/mysql/lotgd/taunts.ibd b/lotgd-db/mysql/lotgd/taunts.ibd new file mode 100644 index 0000000..3b908bc Binary files /dev/null and b/lotgd-db/mysql/lotgd/taunts.ibd differ diff --git a/lotgd-db/mysql/lotgd/titles.frm b/lotgd-db/mysql/lotgd/titles.frm new file mode 100644 index 0000000..a635963 Binary files /dev/null and b/lotgd-db/mysql/lotgd/titles.frm differ diff --git a/lotgd-db/mysql/lotgd/titles.ibd b/lotgd-db/mysql/lotgd/titles.ibd new file mode 100644 index 0000000..7e4a151 Binary files /dev/null and b/lotgd-db/mysql/lotgd/titles.ibd differ diff --git a/lotgd-db/mysql/lotgd/translations.frm b/lotgd-db/mysql/lotgd/translations.frm new file mode 100644 index 0000000..c25d031 Binary files /dev/null and b/lotgd-db/mysql/lotgd/translations.frm differ diff --git a/lotgd-db/mysql/lotgd/translations.ibd b/lotgd-db/mysql/lotgd/translations.ibd new file mode 100644 index 0000000..bdca7c8 Binary files /dev/null and b/lotgd-db/mysql/lotgd/translations.ibd differ diff --git a/lotgd-db/mysql/lotgd/untranslated.frm b/lotgd-db/mysql/lotgd/untranslated.frm new file mode 100644 index 0000000..0028f04 Binary files /dev/null and b/lotgd-db/mysql/lotgd/untranslated.frm differ diff --git a/lotgd-db/mysql/lotgd/untranslated.ibd b/lotgd-db/mysql/lotgd/untranslated.ibd new file mode 100644 index 0000000..e89a05f Binary files /dev/null and b/lotgd-db/mysql/lotgd/untranslated.ibd differ diff --git a/lotgd-db/mysql/lotgd/weapons.frm b/lotgd-db/mysql/lotgd/weapons.frm new file mode 100644 index 0000000..3ea9638 Binary files /dev/null and b/lotgd-db/mysql/lotgd/weapons.frm differ diff --git a/lotgd-db/mysql/lotgd/weapons.ibd b/lotgd-db/mysql/lotgd/weapons.ibd new file mode 100644 index 0000000..0f79613 Binary files /dev/null and b/lotgd-db/mysql/lotgd/weapons.ibd differ diff --git a/lotgd-db/mysql/multi-master.info b/lotgd-db/mysql/multi-master.info new file mode 100755 index 0000000..e69de29 diff --git a/lotgd-db/mysql/mysql/column_stats.MAD b/lotgd-db/mysql/mysql/column_stats.MAD new file mode 100755 index 0000000..3dcc005 Binary files /dev/null and b/lotgd-db/mysql/mysql/column_stats.MAD differ diff --git a/lotgd-db/mysql/mysql/column_stats.MAI b/lotgd-db/mysql/mysql/column_stats.MAI new file mode 100755 index 0000000..2209dfb Binary files /dev/null and b/lotgd-db/mysql/mysql/column_stats.MAI differ diff --git a/lotgd-db/mysql/mysql/column_stats.frm b/lotgd-db/mysql/mysql/column_stats.frm new file mode 100755 index 0000000..809cb93 Binary files /dev/null and b/lotgd-db/mysql/mysql/column_stats.frm differ diff --git a/lotgd-db/mysql/mysql/columns_priv.MAD b/lotgd-db/mysql/mysql/columns_priv.MAD new file mode 100755 index 0000000..3dcc005 Binary files /dev/null and b/lotgd-db/mysql/mysql/columns_priv.MAD differ diff --git a/lotgd-db/mysql/mysql/columns_priv.MAI b/lotgd-db/mysql/mysql/columns_priv.MAI new file mode 100755 index 0000000..820c0b6 Binary files /dev/null and b/lotgd-db/mysql/mysql/columns_priv.MAI differ diff --git a/lotgd-db/mysql/mysql/columns_priv.frm b/lotgd-db/mysql/mysql/columns_priv.frm new file mode 100755 index 0000000..03d6204 Binary files /dev/null and b/lotgd-db/mysql/mysql/columns_priv.frm differ diff --git a/lotgd-db/mysql/mysql/db.MAD b/lotgd-db/mysql/mysql/db.MAD new file mode 100755 index 0000000..8eb8cb7 Binary files /dev/null and b/lotgd-db/mysql/mysql/db.MAD differ diff --git a/lotgd-db/mysql/mysql/db.MAI b/lotgd-db/mysql/mysql/db.MAI new file mode 100755 index 0000000..d64dbe8 Binary files /dev/null and b/lotgd-db/mysql/mysql/db.MAI differ diff --git a/lotgd-db/mysql/mysql/db.frm b/lotgd-db/mysql/mysql/db.frm new file mode 100755 index 0000000..ce8b0d4 Binary files /dev/null and b/lotgd-db/mysql/mysql/db.frm differ diff --git a/lotgd-db/mysql/mysql/db.opt b/lotgd-db/mysql/mysql/db.opt new file mode 100755 index 0000000..ccbf699 --- /dev/null +++ b/lotgd-db/mysql/mysql/db.opt @@ -0,0 +1,2 @@ +default-character-set=utf8mb4 +default-collation=utf8mb4_general_ci diff --git a/lotgd-db/mysql/mysql/event.MAD b/lotgd-db/mysql/mysql/event.MAD new file mode 100755 index 0000000..3dcc005 Binary files /dev/null and b/lotgd-db/mysql/mysql/event.MAD differ diff --git a/lotgd-db/mysql/mysql/event.MAI b/lotgd-db/mysql/mysql/event.MAI new file mode 100755 index 0000000..aabf0b3 Binary files /dev/null and b/lotgd-db/mysql/mysql/event.MAI differ diff --git a/lotgd-db/mysql/mysql/event.frm b/lotgd-db/mysql/mysql/event.frm new file mode 100755 index 0000000..778b6cc Binary files /dev/null and b/lotgd-db/mysql/mysql/event.frm differ diff --git a/lotgd-db/mysql/mysql/func.MAD b/lotgd-db/mysql/mysql/func.MAD new file mode 100755 index 0000000..3dcc005 Binary files /dev/null and b/lotgd-db/mysql/mysql/func.MAD differ diff --git a/lotgd-db/mysql/mysql/func.MAI b/lotgd-db/mysql/mysql/func.MAI new file mode 100755 index 0000000..a34e472 Binary files /dev/null and b/lotgd-db/mysql/mysql/func.MAI differ diff --git a/lotgd-db/mysql/mysql/func.frm b/lotgd-db/mysql/mysql/func.frm new file mode 100755 index 0000000..71b3676 Binary files /dev/null and b/lotgd-db/mysql/mysql/func.frm differ diff --git a/lotgd-db/mysql/mysql/general_log.CSM b/lotgd-db/mysql/mysql/general_log.CSM new file mode 100755 index 0000000..8d08b8d Binary files /dev/null and b/lotgd-db/mysql/mysql/general_log.CSM differ diff --git a/lotgd-db/mysql/mysql/general_log.CSV b/lotgd-db/mysql/mysql/general_log.CSV new file mode 100755 index 0000000..e69de29 diff --git a/lotgd-db/mysql/mysql/general_log.frm b/lotgd-db/mysql/mysql/general_log.frm new file mode 100755 index 0000000..497c86e Binary files /dev/null and b/lotgd-db/mysql/mysql/general_log.frm differ diff --git a/lotgd-db/mysql/mysql/global_priv.MAD b/lotgd-db/mysql/mysql/global_priv.MAD new file mode 100755 index 0000000..7f5dd22 Binary files /dev/null and b/lotgd-db/mysql/mysql/global_priv.MAD differ diff --git a/lotgd-db/mysql/mysql/global_priv.MAI b/lotgd-db/mysql/mysql/global_priv.MAI new file mode 100755 index 0000000..c89274c Binary files /dev/null and b/lotgd-db/mysql/mysql/global_priv.MAI differ diff --git a/lotgd-db/mysql/mysql/global_priv.frm b/lotgd-db/mysql/mysql/global_priv.frm new file mode 100755 index 0000000..9145c2d Binary files /dev/null and b/lotgd-db/mysql/mysql/global_priv.frm differ diff --git a/lotgd-db/mysql/mysql/gtid_slave_pos.frm b/lotgd-db/mysql/mysql/gtid_slave_pos.frm new file mode 100755 index 0000000..dfa81e1 Binary files /dev/null and b/lotgd-db/mysql/mysql/gtid_slave_pos.frm differ diff --git a/lotgd-db/mysql/mysql/gtid_slave_pos.ibd b/lotgd-db/mysql/mysql/gtid_slave_pos.ibd new file mode 100755 index 0000000..e025e91 Binary files /dev/null and b/lotgd-db/mysql/mysql/gtid_slave_pos.ibd differ diff --git a/lotgd-db/mysql/mysql/help_category.MAD b/lotgd-db/mysql/mysql/help_category.MAD new file mode 100755 index 0000000..507d602 Binary files /dev/null and b/lotgd-db/mysql/mysql/help_category.MAD differ diff --git a/lotgd-db/mysql/mysql/help_category.MAI b/lotgd-db/mysql/mysql/help_category.MAI new file mode 100755 index 0000000..60d10d0 Binary files /dev/null and b/lotgd-db/mysql/mysql/help_category.MAI differ diff --git a/lotgd-db/mysql/mysql/help_category.frm b/lotgd-db/mysql/mysql/help_category.frm new file mode 100755 index 0000000..3016c8f Binary files /dev/null and b/lotgd-db/mysql/mysql/help_category.frm differ diff --git a/lotgd-db/mysql/mysql/help_keyword.MAD b/lotgd-db/mysql/mysql/help_keyword.MAD new file mode 100755 index 0000000..6a80560 Binary files /dev/null and b/lotgd-db/mysql/mysql/help_keyword.MAD differ diff --git a/lotgd-db/mysql/mysql/help_keyword.MAI b/lotgd-db/mysql/mysql/help_keyword.MAI new file mode 100755 index 0000000..acf4b28 Binary files /dev/null and b/lotgd-db/mysql/mysql/help_keyword.MAI differ diff --git a/lotgd-db/mysql/mysql/help_keyword.frm b/lotgd-db/mysql/mysql/help_keyword.frm new file mode 100755 index 0000000..63b18c4 Binary files /dev/null and b/lotgd-db/mysql/mysql/help_keyword.frm differ diff --git a/lotgd-db/mysql/mysql/help_relation.MAD b/lotgd-db/mysql/mysql/help_relation.MAD new file mode 100755 index 0000000..83a3890 Binary files /dev/null and b/lotgd-db/mysql/mysql/help_relation.MAD differ diff --git a/lotgd-db/mysql/mysql/help_relation.MAI b/lotgd-db/mysql/mysql/help_relation.MAI new file mode 100755 index 0000000..332d30a Binary files /dev/null and b/lotgd-db/mysql/mysql/help_relation.MAI differ diff --git a/lotgd-db/mysql/mysql/help_relation.frm b/lotgd-db/mysql/mysql/help_relation.frm new file mode 100755 index 0000000..00b2d42 Binary files /dev/null and b/lotgd-db/mysql/mysql/help_relation.frm differ diff --git a/lotgd-db/mysql/mysql/help_topic.MAD b/lotgd-db/mysql/mysql/help_topic.MAD new file mode 100755 index 0000000..9ccca78 Binary files /dev/null and b/lotgd-db/mysql/mysql/help_topic.MAD differ diff --git a/lotgd-db/mysql/mysql/help_topic.MAI b/lotgd-db/mysql/mysql/help_topic.MAI new file mode 100755 index 0000000..d36f2bb Binary files /dev/null and b/lotgd-db/mysql/mysql/help_topic.MAI differ diff --git a/lotgd-db/mysql/mysql/help_topic.frm b/lotgd-db/mysql/mysql/help_topic.frm new file mode 100755 index 0000000..3ee8bb8 Binary files /dev/null and b/lotgd-db/mysql/mysql/help_topic.frm differ diff --git a/lotgd-db/mysql/mysql/index_stats.MAD b/lotgd-db/mysql/mysql/index_stats.MAD new file mode 100755 index 0000000..3dcc005 Binary files /dev/null and b/lotgd-db/mysql/mysql/index_stats.MAD differ diff --git a/lotgd-db/mysql/mysql/index_stats.MAI b/lotgd-db/mysql/mysql/index_stats.MAI new file mode 100755 index 0000000..330b11b Binary files /dev/null and b/lotgd-db/mysql/mysql/index_stats.MAI differ diff --git a/lotgd-db/mysql/mysql/index_stats.frm b/lotgd-db/mysql/mysql/index_stats.frm new file mode 100755 index 0000000..36b576e Binary files /dev/null and b/lotgd-db/mysql/mysql/index_stats.frm differ diff --git a/lotgd-db/mysql/mysql/innodb_index_stats.frm b/lotgd-db/mysql/mysql/innodb_index_stats.frm new file mode 100755 index 0000000..fe8cb38 Binary files /dev/null and b/lotgd-db/mysql/mysql/innodb_index_stats.frm differ diff --git a/lotgd-db/mysql/mysql/innodb_index_stats.ibd b/lotgd-db/mysql/mysql/innodb_index_stats.ibd new file mode 100755 index 0000000..889f033 Binary files /dev/null and b/lotgd-db/mysql/mysql/innodb_index_stats.ibd differ diff --git a/lotgd-db/mysql/mysql/innodb_table_stats.frm b/lotgd-db/mysql/mysql/innodb_table_stats.frm new file mode 100755 index 0000000..ebe9ee7 Binary files /dev/null and b/lotgd-db/mysql/mysql/innodb_table_stats.frm differ diff --git a/lotgd-db/mysql/mysql/innodb_table_stats.ibd b/lotgd-db/mysql/mysql/innodb_table_stats.ibd new file mode 100755 index 0000000..5bdaa64 Binary files /dev/null and b/lotgd-db/mysql/mysql/innodb_table_stats.ibd differ diff --git a/lotgd-db/mysql/mysql/plugin.MAD b/lotgd-db/mysql/mysql/plugin.MAD new file mode 100755 index 0000000..3dcc005 Binary files /dev/null and b/lotgd-db/mysql/mysql/plugin.MAD differ diff --git a/lotgd-db/mysql/mysql/plugin.MAI b/lotgd-db/mysql/mysql/plugin.MAI new file mode 100755 index 0000000..d168fab Binary files /dev/null and b/lotgd-db/mysql/mysql/plugin.MAI differ diff --git a/lotgd-db/mysql/mysql/plugin.frm b/lotgd-db/mysql/mysql/plugin.frm new file mode 100755 index 0000000..0953154 Binary files /dev/null and b/lotgd-db/mysql/mysql/plugin.frm differ diff --git a/lotgd-db/mysql/mysql/proc.MAD b/lotgd-db/mysql/mysql/proc.MAD new file mode 100755 index 0000000..40d182b Binary files /dev/null and b/lotgd-db/mysql/mysql/proc.MAD differ diff --git a/lotgd-db/mysql/mysql/proc.MAI b/lotgd-db/mysql/mysql/proc.MAI new file mode 100755 index 0000000..38cf36a Binary files /dev/null and b/lotgd-db/mysql/mysql/proc.MAI differ diff --git a/lotgd-db/mysql/mysql/proc.frm b/lotgd-db/mysql/mysql/proc.frm new file mode 100755 index 0000000..955bfa5 Binary files /dev/null and b/lotgd-db/mysql/mysql/proc.frm differ diff --git a/lotgd-db/mysql/mysql/procs_priv.MAD b/lotgd-db/mysql/mysql/procs_priv.MAD new file mode 100755 index 0000000..3dcc005 Binary files /dev/null and b/lotgd-db/mysql/mysql/procs_priv.MAD differ diff --git a/lotgd-db/mysql/mysql/procs_priv.MAI b/lotgd-db/mysql/mysql/procs_priv.MAI new file mode 100755 index 0000000..c3169ae Binary files /dev/null and b/lotgd-db/mysql/mysql/procs_priv.MAI differ diff --git a/lotgd-db/mysql/mysql/procs_priv.frm b/lotgd-db/mysql/mysql/procs_priv.frm new file mode 100755 index 0000000..fb00cdc Binary files /dev/null and b/lotgd-db/mysql/mysql/procs_priv.frm differ diff --git a/lotgd-db/mysql/mysql/proxies_priv.MAD b/lotgd-db/mysql/mysql/proxies_priv.MAD new file mode 100755 index 0000000..919efa6 Binary files /dev/null and b/lotgd-db/mysql/mysql/proxies_priv.MAD differ diff --git a/lotgd-db/mysql/mysql/proxies_priv.MAI b/lotgd-db/mysql/mysql/proxies_priv.MAI new file mode 100755 index 0000000..6959dda Binary files /dev/null and b/lotgd-db/mysql/mysql/proxies_priv.MAI differ diff --git a/lotgd-db/mysql/mysql/proxies_priv.frm b/lotgd-db/mysql/mysql/proxies_priv.frm new file mode 100755 index 0000000..e1420b5 Binary files /dev/null and b/lotgd-db/mysql/mysql/proxies_priv.frm differ diff --git a/lotgd-db/mysql/mysql/roles_mapping.MAD b/lotgd-db/mysql/mysql/roles_mapping.MAD new file mode 100755 index 0000000..3dcc005 Binary files /dev/null and b/lotgd-db/mysql/mysql/roles_mapping.MAD differ diff --git a/lotgd-db/mysql/mysql/roles_mapping.MAI b/lotgd-db/mysql/mysql/roles_mapping.MAI new file mode 100755 index 0000000..53d860c Binary files /dev/null and b/lotgd-db/mysql/mysql/roles_mapping.MAI differ diff --git a/lotgd-db/mysql/mysql/roles_mapping.frm b/lotgd-db/mysql/mysql/roles_mapping.frm new file mode 100755 index 0000000..d6916f0 Binary files /dev/null and b/lotgd-db/mysql/mysql/roles_mapping.frm differ diff --git a/lotgd-db/mysql/mysql/servers.MAD b/lotgd-db/mysql/mysql/servers.MAD new file mode 100755 index 0000000..3dcc005 Binary files /dev/null and b/lotgd-db/mysql/mysql/servers.MAD differ diff --git a/lotgd-db/mysql/mysql/servers.MAI b/lotgd-db/mysql/mysql/servers.MAI new file mode 100755 index 0000000..b728d2d Binary files /dev/null and b/lotgd-db/mysql/mysql/servers.MAI differ diff --git a/lotgd-db/mysql/mysql/servers.frm b/lotgd-db/mysql/mysql/servers.frm new file mode 100755 index 0000000..64a0003 Binary files /dev/null and b/lotgd-db/mysql/mysql/servers.frm differ diff --git a/lotgd-db/mysql/mysql/slow_log.CSM b/lotgd-db/mysql/mysql/slow_log.CSM new file mode 100755 index 0000000..8d08b8d Binary files /dev/null and b/lotgd-db/mysql/mysql/slow_log.CSM differ diff --git a/lotgd-db/mysql/mysql/slow_log.CSV b/lotgd-db/mysql/mysql/slow_log.CSV new file mode 100755 index 0000000..e69de29 diff --git a/lotgd-db/mysql/mysql/slow_log.frm b/lotgd-db/mysql/mysql/slow_log.frm new file mode 100755 index 0000000..1179c2d Binary files /dev/null and b/lotgd-db/mysql/mysql/slow_log.frm differ diff --git a/lotgd-db/mysql/mysql/table_stats.MAD b/lotgd-db/mysql/mysql/table_stats.MAD new file mode 100755 index 0000000..3dcc005 Binary files /dev/null and b/lotgd-db/mysql/mysql/table_stats.MAD differ diff --git a/lotgd-db/mysql/mysql/table_stats.MAI b/lotgd-db/mysql/mysql/table_stats.MAI new file mode 100755 index 0000000..82faf7e Binary files /dev/null and b/lotgd-db/mysql/mysql/table_stats.MAI differ diff --git a/lotgd-db/mysql/mysql/table_stats.frm b/lotgd-db/mysql/mysql/table_stats.frm new file mode 100755 index 0000000..59ed912 Binary files /dev/null and b/lotgd-db/mysql/mysql/table_stats.frm differ diff --git a/lotgd-db/mysql/mysql/tables_priv.MAD b/lotgd-db/mysql/mysql/tables_priv.MAD new file mode 100755 index 0000000..e0a3821 Binary files /dev/null and b/lotgd-db/mysql/mysql/tables_priv.MAD differ diff --git a/lotgd-db/mysql/mysql/tables_priv.MAI b/lotgd-db/mysql/mysql/tables_priv.MAI new file mode 100755 index 0000000..6368f84 Binary files /dev/null and b/lotgd-db/mysql/mysql/tables_priv.MAI differ diff --git a/lotgd-db/mysql/mysql/tables_priv.frm b/lotgd-db/mysql/mysql/tables_priv.frm new file mode 100755 index 0000000..686f90b Binary files /dev/null and b/lotgd-db/mysql/mysql/tables_priv.frm differ diff --git a/lotgd-db/mysql/mysql/time_zone.MAD b/lotgd-db/mysql/mysql/time_zone.MAD new file mode 100755 index 0000000..4170ad1 Binary files /dev/null and b/lotgd-db/mysql/mysql/time_zone.MAD differ diff --git a/lotgd-db/mysql/mysql/time_zone.MAI b/lotgd-db/mysql/mysql/time_zone.MAI new file mode 100755 index 0000000..91a5cb3 Binary files /dev/null and b/lotgd-db/mysql/mysql/time_zone.MAI differ diff --git a/lotgd-db/mysql/mysql/time_zone.frm b/lotgd-db/mysql/mysql/time_zone.frm new file mode 100755 index 0000000..1abb2eb Binary files /dev/null and b/lotgd-db/mysql/mysql/time_zone.frm differ diff --git a/lotgd-db/mysql/mysql/time_zone_leap_second.MAD b/lotgd-db/mysql/mysql/time_zone_leap_second.MAD new file mode 100755 index 0000000..3dcc005 Binary files /dev/null and b/lotgd-db/mysql/mysql/time_zone_leap_second.MAD differ diff --git a/lotgd-db/mysql/mysql/time_zone_leap_second.MAI b/lotgd-db/mysql/mysql/time_zone_leap_second.MAI new file mode 100755 index 0000000..eef3d3c Binary files /dev/null and b/lotgd-db/mysql/mysql/time_zone_leap_second.MAI differ diff --git a/lotgd-db/mysql/mysql/time_zone_leap_second.frm b/lotgd-db/mysql/mysql/time_zone_leap_second.frm new file mode 100755 index 0000000..daa0bdb Binary files /dev/null and b/lotgd-db/mysql/mysql/time_zone_leap_second.frm differ diff --git a/lotgd-db/mysql/mysql/time_zone_name.MAD b/lotgd-db/mysql/mysql/time_zone_name.MAD new file mode 100755 index 0000000..5d828c6 Binary files /dev/null and b/lotgd-db/mysql/mysql/time_zone_name.MAD differ diff --git a/lotgd-db/mysql/mysql/time_zone_name.MAI b/lotgd-db/mysql/mysql/time_zone_name.MAI new file mode 100755 index 0000000..eaa4cc5 Binary files /dev/null and b/lotgd-db/mysql/mysql/time_zone_name.MAI differ diff --git a/lotgd-db/mysql/mysql/time_zone_name.frm b/lotgd-db/mysql/mysql/time_zone_name.frm new file mode 100755 index 0000000..24c3a82 Binary files /dev/null and b/lotgd-db/mysql/mysql/time_zone_name.frm differ diff --git a/lotgd-db/mysql/mysql/time_zone_transition.MAD b/lotgd-db/mysql/mysql/time_zone_transition.MAD new file mode 100755 index 0000000..d252ec4 Binary files /dev/null and b/lotgd-db/mysql/mysql/time_zone_transition.MAD differ diff --git a/lotgd-db/mysql/mysql/time_zone_transition.MAI b/lotgd-db/mysql/mysql/time_zone_transition.MAI new file mode 100755 index 0000000..3f5ad6d Binary files /dev/null and b/lotgd-db/mysql/mysql/time_zone_transition.MAI differ diff --git a/lotgd-db/mysql/mysql/time_zone_transition.frm b/lotgd-db/mysql/mysql/time_zone_transition.frm new file mode 100755 index 0000000..9e2ebd5 Binary files /dev/null and b/lotgd-db/mysql/mysql/time_zone_transition.frm differ diff --git a/lotgd-db/mysql/mysql/time_zone_transition_type.MAD b/lotgd-db/mysql/mysql/time_zone_transition_type.MAD new file mode 100755 index 0000000..36333c2 Binary files /dev/null and b/lotgd-db/mysql/mysql/time_zone_transition_type.MAD differ diff --git a/lotgd-db/mysql/mysql/time_zone_transition_type.MAI b/lotgd-db/mysql/mysql/time_zone_transition_type.MAI new file mode 100755 index 0000000..cfb2866 Binary files /dev/null and b/lotgd-db/mysql/mysql/time_zone_transition_type.MAI differ diff --git a/lotgd-db/mysql/mysql/time_zone_transition_type.frm b/lotgd-db/mysql/mysql/time_zone_transition_type.frm new file mode 100755 index 0000000..7f207ff Binary files /dev/null and b/lotgd-db/mysql/mysql/time_zone_transition_type.frm differ diff --git a/lotgd-db/mysql/mysql/transaction_registry.frm b/lotgd-db/mysql/mysql/transaction_registry.frm new file mode 100755 index 0000000..11625aa Binary files /dev/null and b/lotgd-db/mysql/mysql/transaction_registry.frm differ diff --git a/lotgd-db/mysql/mysql/transaction_registry.ibd b/lotgd-db/mysql/mysql/transaction_registry.ibd new file mode 100755 index 0000000..90c83e3 Binary files /dev/null and b/lotgd-db/mysql/mysql/transaction_registry.ibd differ diff --git a/lotgd-db/mysql/mysql/user.frm b/lotgd-db/mysql/mysql/user.frm new file mode 100755 index 0000000..b69c432 --- /dev/null +++ b/lotgd-db/mysql/mysql/user.frm @@ -0,0 +1,16 @@ +TYPE=VIEW +query=select `mysql`.`global_priv`.`Host` AS `Host`,`mysql`.`global_priv`.`User` AS `User`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.plugin\') in (\'mysql_native_password\',\'mysql_old_password\'),ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.authentication_string\'),\'\'),\'\') AS `Password`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 1,\'Y\',\'N\') AS `Select_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 2,\'Y\',\'N\') AS `Insert_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 4,\'Y\',\'N\') AS `Update_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 8,\'Y\',\'N\') AS `Delete_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 16,\'Y\',\'N\') AS `Create_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 32,\'Y\',\'N\') AS `Drop_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 64,\'Y\',\'N\') AS `Reload_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 128,\'Y\',\'N\') AS `Shutdown_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 256,\'Y\',\'N\') AS `Process_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 512,\'Y\',\'N\') AS `File_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 1024,\'Y\',\'N\') AS `Grant_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 2048,\'Y\',\'N\') AS `References_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 4096,\'Y\',\'N\') AS `Index_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 8192,\'Y\',\'N\') AS `Alter_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 16384,\'Y\',\'N\') AS `Show_db_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 32768,\'Y\',\'N\') AS `Super_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 65536,\'Y\',\'N\') AS `Create_tmp_table_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 131072,\'Y\',\'N\') AS `Lock_tables_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 262144,\'Y\',\'N\') AS `Execute_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 524288,\'Y\',\'N\') AS `Repl_slave_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 1048576,\'Y\',\'N\') AS `Repl_client_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 2097152,\'Y\',\'N\') AS `Create_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 4194304,\'Y\',\'N\') AS `Show_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 8388608,\'Y\',\'N\') AS `Create_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 16777216,\'Y\',\'N\') AS `Alter_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 33554432,\'Y\',\'N\') AS `Create_user_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 67108864,\'Y\',\'N\') AS `Event_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 134217728,\'Y\',\'N\') AS `Trigger_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 268435456,\'Y\',\'N\') AS `Create_tablespace_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 536870912,\'Y\',\'N\') AS `Delete_history_priv`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.ssl_type\'),0) + 1,\'\',\'ANY\',\'X509\',\'SPECIFIED\') AS `ssl_type`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.ssl_cipher\'),\'\') AS `ssl_cipher`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.x509_issuer\'),\'\') AS `x509_issuer`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.x509_subject\'),\'\') AS `x509_subject`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.max_questions\'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.max_updates\'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.max_connections\'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.max_user_connections\'),0) as signed) AS `max_user_connections`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.plugin\'),\'\') AS `plugin`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.authentication_string\'),\'\') AS `authentication_string`,\'N\' AS `password_expired`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.is_role\'),0) + 1,\'N\',\'Y\') AS `is_role`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.default_role\'),\'\') AS `default_role`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.max_statement_time\'),0.0) as decimal(12,6)) AS `max_statement_time` from `mysql`.`global_priv` +md5=ce28f3da4fcc69ac2ca65d25b5a6d2d9 +updatable=1 +algorithm=0 +definer_user=mariadb.sys +definer_host=localhost +suid=1 +with_check_option=0 +timestamp=2020-08-13 00:03:54 +create-version=2 +source=SELECT\n Host,\n User,\n IF(JSON_VALUE(Priv, \'$.plugin\') IN (\'mysql_native_password\', \'mysql_old_password\'), IFNULL(JSON_VALUE(Priv, \'$.authentication_string\'), \'\'), \'\') AS Password,\n IF(JSON_VALUE(Priv, \'$.access\') & 1, \'Y\', \'N\') AS Select_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 2, \'Y\', \'N\') AS Insert_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 4, \'Y\', \'N\') AS Update_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 8, \'Y\', \'N\') AS Delete_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 16, \'Y\', \'N\') AS Create_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 32, \'Y\', \'N\') AS Drop_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 64, \'Y\', \'N\') AS Reload_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 128, \'Y\', \'N\') AS Shutdown_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 256, \'Y\', \'N\') AS Process_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 512, \'Y\', \'N\') AS File_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 1024, \'Y\', \'N\') AS Grant_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 2048, \'Y\', \'N\') AS References_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 4096, \'Y\', \'N\') AS Index_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 8192, \'Y\', \'N\') AS Alter_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 16384, \'Y\', \'N\') AS Show_db_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 32768, \'Y\', \'N\') AS Super_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 65536, \'Y\', \'N\') AS Create_tmp_table_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 131072, \'Y\', \'N\') AS Lock_tables_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 262144, \'Y\', \'N\') AS Execute_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 524288, \'Y\', \'N\') AS Repl_slave_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 1048576, \'Y\', \'N\') AS Repl_client_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 2097152, \'Y\', \'N\') AS Create_view_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 4194304, \'Y\', \'N\') AS Show_view_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 8388608, \'Y\', \'N\') AS Create_routine_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 16777216, \'Y\', \'N\') AS Alter_routine_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 33554432, \'Y\', \'N\') AS Create_user_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 67108864, \'Y\', \'N\') AS Event_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 134217728, \'Y\', \'N\') AS Trigger_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 268435456, \'Y\', \'N\') AS Create_tablespace_priv,\n IF(JSON_VALUE(Priv, \'$.access\') & 536870912, \'Y\', \'N\') AS Delete_history_priv,\n ELT(IFNULL(JSON_VALUE(Priv, \'$.ssl_type\'), 0) + 1, \'\', \'ANY\',\'X509\', \'SPECIFIED\') AS ssl_type,\n IFNULL(JSON_VALUE(Priv, \'$.ssl_cipher\'), \'\') AS ssl_cipher,\n IFNULL(JSON_VALUE(Priv, \'$.x509_issuer\'), \'\') AS x509_issuer,\n IFNULL(JSON_VALUE(Priv, \'$.x509_subject\'), \'\') AS x509_subject,\n CAST(IFNULL(JSON_VALUE(Priv, \'$.max_questions\'), 0) AS UNSIGNED) AS max_questions,\n CAST(IFNULL(JSON_VALUE(Priv, \'$.max_updates\'), 0) AS UNSIGNED) AS max_updates,\n CAST(IFNULL(JSON_VALUE(Priv, \'$.max_connections\'), 0) AS UNSIGNED) AS max_connections,\n CAST(IFNULL(JSON_VALUE(Priv, \'$.max_user_connections\'), 0) AS SIGNED) AS max_user_connections,\n IFNULL(JSON_VALUE(Priv, \'$.plugin\'), \'\') AS plugin,\n IFNULL(JSON_VALUE(Priv, \'$.authentication_string\'), \'\') AS authentication_string,\n \'N\' AS password_expired,\n ELT(IFNULL(JSON_VALUE(Priv, \'$.is_role\'), 0) + 1, \'N\', \'Y\') AS is_role,\n IFNULL(JSON_VALUE(Priv, \'$.default_role\'), \'\') AS default_role,\n CAST(IFNULL(JSON_VALUE(Priv, \'$.max_statement_time\'), 0.0) AS DECIMAL(12,6)) AS max_statement_time\n FROM global_priv; +client_cs_name=utf8mb4 +connection_cl_name=utf8mb4_general_ci +view_body_utf8=select `mysql`.`global_priv`.`Host` AS `Host`,`mysql`.`global_priv`.`User` AS `User`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.plugin\') in (\'mysql_native_password\',\'mysql_old_password\'),ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.authentication_string\'),\'\'),\'\') AS `Password`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 1,\'Y\',\'N\') AS `Select_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 2,\'Y\',\'N\') AS `Insert_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 4,\'Y\',\'N\') AS `Update_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 8,\'Y\',\'N\') AS `Delete_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 16,\'Y\',\'N\') AS `Create_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 32,\'Y\',\'N\') AS `Drop_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 64,\'Y\',\'N\') AS `Reload_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 128,\'Y\',\'N\') AS `Shutdown_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 256,\'Y\',\'N\') AS `Process_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 512,\'Y\',\'N\') AS `File_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 1024,\'Y\',\'N\') AS `Grant_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 2048,\'Y\',\'N\') AS `References_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 4096,\'Y\',\'N\') AS `Index_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 8192,\'Y\',\'N\') AS `Alter_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 16384,\'Y\',\'N\') AS `Show_db_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 32768,\'Y\',\'N\') AS `Super_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 65536,\'Y\',\'N\') AS `Create_tmp_table_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 131072,\'Y\',\'N\') AS `Lock_tables_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 262144,\'Y\',\'N\') AS `Execute_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 524288,\'Y\',\'N\') AS `Repl_slave_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 1048576,\'Y\',\'N\') AS `Repl_client_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 2097152,\'Y\',\'N\') AS `Create_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 4194304,\'Y\',\'N\') AS `Show_view_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 8388608,\'Y\',\'N\') AS `Create_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 16777216,\'Y\',\'N\') AS `Alter_routine_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 33554432,\'Y\',\'N\') AS `Create_user_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 67108864,\'Y\',\'N\') AS `Event_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 134217728,\'Y\',\'N\') AS `Trigger_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 268435456,\'Y\',\'N\') AS `Create_tablespace_priv`,if(json_value(`mysql`.`global_priv`.`Priv`,\'$.access\') & 536870912,\'Y\',\'N\') AS `Delete_history_priv`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.ssl_type\'),0) + 1,\'\',\'ANY\',\'X509\',\'SPECIFIED\') AS `ssl_type`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.ssl_cipher\'),\'\') AS `ssl_cipher`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.x509_issuer\'),\'\') AS `x509_issuer`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.x509_subject\'),\'\') AS `x509_subject`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.max_questions\'),0) as unsigned) AS `max_questions`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.max_updates\'),0) as unsigned) AS `max_updates`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.max_connections\'),0) as unsigned) AS `max_connections`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.max_user_connections\'),0) as signed) AS `max_user_connections`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.plugin\'),\'\') AS `plugin`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.authentication_string\'),\'\') AS `authentication_string`,\'N\' AS `password_expired`,elt(ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.is_role\'),0) + 1,\'N\',\'Y\') AS `is_role`,ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.default_role\'),\'\') AS `default_role`,cast(ifnull(json_value(`mysql`.`global_priv`.`Priv`,\'$.max_statement_time\'),0.0) as decimal(12,6)) AS `max_statement_time` from `mysql`.`global_priv` +mariadb-version=100505 diff --git a/lotgd-db/mysql/performance_schema/db.opt b/lotgd-db/mysql/performance_schema/db.opt new file mode 100755 index 0000000..4ed6015 --- /dev/null +++ b/lotgd-db/mysql/performance_schema/db.opt @@ -0,0 +1,2 @@ +default-character-set=utf8 +default-collation=utf8_general_ci diff --git a/lotgd-php-fpm/Dockerfile b/lotgd-php-fpm/Dockerfile new file mode 100644 index 0000000..2042f47 --- /dev/null +++ b/lotgd-php-fpm/Dockerfile @@ -0,0 +1,26 @@ +#This image takes the previously created PHP image and modifies it for fastcgi upstream use by the web container +FROM lotgd-php:cli + +MAINTAINER Chris P + +# Install dotdeb repo, PHP, composer and selected extensions +RUN apt-get update \ + && apt-get -y --no-install-recommends install php5.6-fpm \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* + +# Configure FPM to run properly on docker +RUN sed -i "/listen = .*/c\listen = [::]:9000" /etc/php/5.6/fpm/pool.d/www.conf \ + && sed -i "/;access.log = .*/c\access.log = /proc/self/fd/2" /etc/php/5.6/fpm/pool.d/www.conf \ + && sed -i "/;clear_env = .*/c\clear_env = no" /etc/php/5.6/fpm/pool.d/www.conf \ + && sed -i "/;catch_workers_output = .*/c\catch_workers_output = yes" /etc/php/5.6/fpm/pool.d/www.conf \ + && sed -i "/pid = .*/c\;pid = /run/php/php5.6-fpm.pid" /etc/php/5.6/fpm/php-fpm.conf \ + && sed -i "/;daemonize = .*/c\daemonize = no" /etc/php/5.6/fpm/php-fpm.conf \ + && sed -i "/error_log = .*/c\error_log = /proc/self/fd/2" /etc/php/5.6/fpm/php-fpm.conf \ + && usermod -u 1000 www-data + +# The following runs FPM and removes all its extraneous log output on top of what your app outputs to stdout +CMD /usr/sbin/php-fpm5.6 -F -O 2>&1 | sed -u 's,.*: \"\(.*\)$,\1,'| sed -u 's,"$,,' 1>&1 + +# Open up fcgi port +EXPOSE 9000 diff --git a/lotgd-php/Dockerfile b/lotgd-php/Dockerfile new file mode 100644 index 0000000..f93f0be --- /dev/null +++ b/lotgd-php/Dockerfile @@ -0,0 +1,38 @@ +#This image is simply the template base for the fastcgi image, it doesn't do much on it's own +FROM ubuntu:focal + +# Fixes some weird terminal issues such as broken clear / CTRL+L +ENV TERM=linux + +# Ensure apt doesn't ask questions when installing stuff +ENV DEBIAN_FRONTEND=noninteractive + +# Install Ondrej repos for Ubuntu focal, PHP5.6, composer and selected extensions - better selection than +# the distro's packages +RUN apt-get update \ + && apt-get install -y --no-install-recommends gnupg \ + && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ondrej-php.list \ + && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \ + && apt-get update \ + && apt-get -y --no-install-recommends install \ + ca-certificates \ + curl \ + unzip \ + php5.6-cli \ + php5.6-curl \ + php5.6-mysql \ + php5.6-pdo \ + php5.6-gd \ + php5.6-json \ + php5.6-mbstring \ + php5.6-opcache \ + php5.6-readline \ + php5.6-xml \ + php5.6-zip \ + && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ + && composer global require hirak/prestissimo \ + && composer clear-cache \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* ~/.composer + +CMD ["php", "-a"] diff --git a/lotgd-web/Dockerfile b/lotgd-web/Dockerfile new file mode 100755 index 0000000..c8b52ba --- /dev/null +++ b/lotgd-web/Dockerfile @@ -0,0 +1,17 @@ +#This image is the NGINX webserver that holds the LotGD PHP files and connects to the DB and PHP containers +FROM nginx:alpine + +MAINTAINER Chris P + +#Copies the game's PHP files to the container +COPY lotgd /var/www/lotgd + +#Removes the default NGINX config (otherwise localhost won't work) +RUN rm /etc/nginx/conf.d/default.conf + +#Copies in the pre-configured lotgd config +COPY lotgd.conf /etc/nginx/conf.d/lotgd.conf + +#Port 443 is exposed in case one wants to use SSL, but there is no cert, reverse proxy is advised +EXPOSE 80 +EXPOSE 443 diff --git a/lotgd-web/lotgd.conf b/lotgd-web/lotgd.conf new file mode 100755 index 0000000..b2167b2 --- /dev/null +++ b/lotgd-web/lotgd.conf @@ -0,0 +1,73 @@ +## +# You should look at the following URL's in order to grasp a solid understanding +# of Nginx configuration files in order to fully unleash the power of Nginx. +# https://www.nginx.com/resources/wiki/start/ +# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ +# https://wiki.debian.org/Nginx/DirectoryStructure +# +# In most cases, administrators will remove this file from sites-enabled/ and +# leave it as reference inside of sites-available where it will continue to be +# updated by the nginx packaging team. +# +# This file will automatically load configuration files provided by other +# applications, such as Drupal or Wordpress. These applications will be made +# available underneath a path with that package name, such as /drupal8. +# +# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. +## + +# Default server configuration +# +server { + listen 80 default_server; + listen [::]:80 default_server; + + root /var/www/lotgd; + + # Add index.php to the list if you are using PHP + index index.html index.php index.htm index.nginx-debian.html; + + server_name _; + + location / { + # First attempt to serve request as file, then + # as directory, then fall back to displaying a 404. + try_files $uri $uri/ =404; + aio threads; + } + + # pass PHP scripts to FastCGI server + # + location ~ \.php$ { + include fastcgi.conf; + fastcgi_pass lotgd-php:9000; + fastcgi_index index.php; + } + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + #location ~ /\.ht { + # deny all; + #} +} + + +# Virtual Host configuration for example.com +# +# You can move that to a different file under sites-available/ and symlink that +# to sites-enabled/ to enable it. +# +#server { +# listen 80; +# listen [::]:80; +# +# server_name example.com; +# +# root /var/www/example.com; +# index index.html; +# +# location / { +# try_files $uri $uri/ =404; +# } +#} diff --git a/lotgd-web/lotgd/.bash_logout b/lotgd-web/lotgd/.bash_logout new file mode 100755 index 0000000..de4f5f7 --- /dev/null +++ b/lotgd-web/lotgd/.bash_logout @@ -0,0 +1,7 @@ +# ~/.bash_logout: executed by bash(1) when login shell exits. + +# when leaving the console clear the screen to increase privacy + +if [ "$SHLVL" = 1 ]; then + [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q +fi diff --git a/lotgd-web/lotgd/.bashrc b/lotgd-web/lotgd/.bashrc new file mode 100755 index 0000000..b488fcc --- /dev/null +++ b/lotgd-web/lotgd/.bashrc @@ -0,0 +1,117 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +#shopt -s globstar + +# make less more friendly for non-text input files, see lesspipe(1) +[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color|*-256color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +#force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + #alias dir='dir --color=auto' + #alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# colored GCC warnings and errors +#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' + +# some more ls aliases +alias ll='ls -alF' +alias la='ls -A' +alias l='ls -CF' + +# Add an "alert" alias for long running commands. Use like so: +# sleep 10; alert +alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi diff --git a/lotgd-web/lotgd/.cache/motd.legal-displayed b/lotgd-web/lotgd/.cache/motd.legal-displayed new file mode 100755 index 0000000..e69de29 diff --git a/lotgd-web/lotgd/.profile b/lotgd-web/lotgd/.profile new file mode 100755 index 0000000..d89ea5a --- /dev/null +++ b/lotgd-web/lotgd/.profile @@ -0,0 +1,27 @@ +# ~/.profile: executed by the command interpreter for login shells. +# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login +# exists. +# see /usr/share/doc/bash/examples/startup-files for examples. +# the files are located in the bash-doc package. + +# the default umask is set in /etc/profile; for setting the umask +# for ssh logins, install and configure the libpam-umask package. +#umask 022 + +# if running bash +if [ -n "$BASH_VERSION" ]; then + # include .bashrc if it exists + if [ -f "$HOME/.bashrc" ]; then + . "$HOME/.bashrc" + fi +fi + +# set PATH so it includes user's private bin if it exists +if [ -d "$HOME/bin" ] ; then + PATH="$HOME/bin:$PATH" +fi + +# set PATH so it includes user's private bin if it exists +if [ -d "$HOME/.local/bin" ] ; then + PATH="$HOME/.local/bin:$PATH" +fi diff --git a/lotgd-web/lotgd/AFTERUPGRADE.txt b/lotgd-web/lotgd/AFTERUPGRADE.txt new file mode 100755 index 0000000..b8b792e --- /dev/null +++ b/lotgd-web/lotgd/AFTERUPGRADE.txt @@ -0,0 +1,18 @@ +Things you have to do after an upgrade: + + +All: +-check your races...remove the hook to "charstats" if they only add in the race under Vital Info. Now the core does this for you, including the translation. +-all with datacache turned on: as the caching has been shifted to the dbconnect.php file... you need to edit this file and place in: + +$DB_USEDATACACHE = 1; +$DB_DATACACHEPATH = "/your/caching/dir"; + +where you put in your directory/path to the cache directory WITHOUT ending / + + + +Translators: +-Replace the Ramius/Karissa/Cedrik names with %s using the Translation Wizard... or translate the sentences anew. +-Check if your language was de-it-fr-en-es-dk ... if not, then you need to add your language to the game settings as server supported language and also add all languages you WANT and drop those you DON'T WANT + diff --git a/lotgd-web/lotgd/BUG FIXES.txt b/lotgd-web/lotgd/BUG FIXES.txt new file mode 100755 index 0000000..cfd4d8d --- /dev/null +++ b/lotgd-web/lotgd/BUG FIXES.txt @@ -0,0 +1,38 @@ +• common.php + Removal of session_register(), replaced with session_start(). +• create.php + Fixing of ability to use same name as another, with multiple spaces. +• dragon.php + Dragonkills incremented on page after kill, to prevent timing out to stay at level 15, but keeping the new dragonkill. +• payment.php + Trim the IPN validation response. +• prefs.php + Change from split() to explode(). +• rawsql.php + Switched the debuglog() and db_query(), so that the db_error() function is connected to the latter, instead of the former. +• lib/datetime.php + checkday() does not redirect to the new day page if there are posted variables (e.g. commentary, prefs, etc.) to prevent loss of entered text. +• lib/errorhandling.php + set_magic_quotes_runtime() removed. +• lib/events.php + Change from split() to explode(). +• lib/forms.php + Crash-safe event added to keep value of chat input in case the browser or tab crashes. +• lib/installer/installer_stage_1.php + Removal of tags, so that the installation is smooth-running, and doesn't link to the commons lincense website. +• lib/modules.php + "showFormTabIndex" not saved as a module setting, object pref or user pref. +• lib/pageparts.php + Change from split() to explode(). +• lib/pullurl.php + Change from split() to explode(). + "if (function_exists("curl_init")) return _curl($url);" removed. + "curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);" removed. +• lib/settings.php + "showFormTabIndex" not saved as a game setting. +• lib/showform.php + Change from split() to explode(). +• lib/su_access.php + Fixed usage of $_SERVER['HTTP_REFERER'] variable. +• lib/tabldescriptor.php + Replace ") Type=$type"; with ") engine=$type"; \ No newline at end of file diff --git a/lotgd-web/lotgd/CHANGELOG.txt b/lotgd-web/lotgd/CHANGELOG.txt new file mode 100755 index 0000000..6e8df85 --- /dev/null +++ b/lotgd-web/lotgd/CHANGELOG.txt @@ -0,0 +1,170 @@ +Changelog +Changes from 1.1.1 to 1.1.2 +[FIX] - Moved gardener away from foot-gardens hook so it doesn't appear in events +[FIX] - Minor colouring errors and typos +[FIX] - You have been healed for 1 points! changed and translatable +[FIX] - newest player cache for homepage now invalidates on account creation +[FIX] - regdate preserved on dk + +[UPDATE] - Raw SQL/PHP usage now added to debuglog +[UPDATE] - Bans cleaned up on newday-runonce + +Changes from 1.1.0 to 1.1.1 +[FIX] - configuration.php--lib/pageparts.php made the text "Legend of the Green Dragon Site Donation from" in the donationscreen settable in the grotto. +[FIX] - configuration.php--lib/pageparts.php made a setting for the primarily country in order to select the correct paypal language when the button 'site admin' is clicked. Normally this would be the paypal account owners country. But in some cases this might differ. +[FIX] - lib/pageparts.php page_header fixed (had infinite loop when calling page_header twice and the base call was not from a module) +[FIX] - motd.php now does not only refresh the last X (setting) motd news by pressing the ">" button but browses through the last messages like it was supposed to. Alteration: motd is ONLY cached for the last X items, if you browse they are queried normally. Also the archive IS now cached (was not before) and this really makes sense normally. +[FIX] - lib/battle-buffs.php did show an extra line if regen message was left out +[FIX] - lib/modules.php in the module manager it showed greyed navs after inactive modules, added a `0 +[FIX] - /lib/partner.php set marriedto=0 when called for a player with spouse but w/o the $player variable +[FIX] - home.php now displays correctly when cookies are blocked from the browser +[FIX] - /modules/cities.php fixed a tl-glitch together with lib/forestoutcomes.php +[FIX] - clans now fully functional for custom ranks +[FIX] - /modules/abigail.php now speaks English with the spouse and is translation ready +[FIX] - /modules/lovers.php module buff now translatable +[FIX] - Now several timeout-incorrect login etc message are translatable +[FIX] - taunts.php: when you saved a new taunt, it did not save the taunt but only inserted a new empty row. +[FIX] - installer.php did display the 1ast recommended module as not recommended, now it does (install did work) +[FIX] - tl-readiness of the racecities -> urlencode was missing in the addnav in the do_hook -> case travel +[FIX] - modules/gardener.php is now translation-ready (questions were not translatable) +[FIX] - modules/petra.php on line 232 there was a variable missspelled +[FIX] - hook queries slightly changed and also added an index at the module_hooks table to "location" +[FIX] - user.php now also searches *again* for email address, IP, ID etc... formerly did only search for name + loginname +[FIX] - goodwordlist was not cached which caused the lotgdnet.php to make too many queries +[FIX] - /modules/outhouse.php had a `2 missing after the name which caused colour errors +[FIX] - corrected create.php who had two queries with emailvalidation='$id' AND emailvalidation!='' ... where the last part made no sense +[FIX] - translatortool.php are the namespace+intext now readonly...they should *not* be editable, same goes for untranslated.php +[FIX] - lib/datetime.php reltime($date,$short=true) is now tl-ready, you can have minutes/hours etc in your language. also the date outputs there are not in the tlschema "datetime" +[FIX] - validation email now translation ready + +[FIX] - Moved datacache settings into dbconnect.php. Otherwise settings-query could not be cached. +[FIX] - pvp and bio now do not use the players' login as reference but their acctid (changes to pvp.php, bio.php, lib/commentary.php, lib/pvplist.php, lib/pvpsupport.php) +[FIX] - Fixed a bug in lib/commentary.php which lead to mysql errors if browsing through commentaries and then clicking on a bio link in a comment that hasn't been posted when started browsing +[FIX] - Fixed an error in lib/modules.php which prevented objprefs to be shown correctly. They were saved correctly, but the module_objpref_edit() function did not show the values. +[FIX] - Inserted constant CLAN_FOUNDER. +[FIX] - Fixed a typo in specialtymysticpower.php. Thanks to Maeher for reporting! + +[FIX] - Character expiration email is now tl-ready +[FIX] - Many unset variables/indexes +[FIX] - Donation point mail now tl-ready for when 1 point is given +[FIX] - Many incorrect slashes fixed (\letter when it should be \\letter) +[FIX] - dragon death page now more translation ready +[FIX] - Multifight limits now use the settings +[FIX] - $options['denyflawless'] now passed to forestvictory() +[FIX] - Misspelled variables +[FIX] - setting $charsleft to false in previewfrom() now works +[FIX] - favour needed to restore your soul now shown on every page when talking with Ramius +[FIX] - Updating from <0.9.8 should now work +[FIX] - haberdasher now appears in main city +[FIX] - meaninglesscode doesn't remove new colour codes +[FIX] - installer can now create database without dying + +[FEATURE] - new hook $drunkadd = modulehook("modify-drunkeness",$row); added to modules/drinks/run.php to modify each drink drunkeness. An elf gets faster drunk than a dwarf... just modify after the hook $args['drunkeness'] like you want it to. You will get all drink informations via this hook. +[FEATURE] - now you have in your talkine view a little javascript tell you "You have xxx characters left" counting down when you type. Lets you know when to make a new line. +[FEATURE] - now moderators can delete post by directly clicking on a "Del" Button beside the post. +[FEATURE] - added a village-$city hook and a village-desc-$city hook where $city is $session['user']['location']. I.e. you can now save lots of unnecessary queries when you want only to execute at ONE certain village square. To incorporate in a module, either add a hook to i.e. village-Glorfindal ... (bad if you want to have working all-round modules) but make a location setting, also changesetting (like always before) and upon a changesetting or a change in your module you *HAVE* to reinstall it. Make sure to do so, else the hook won't be fired off. +[FEATURE] - clans can now be turned off (auto set to on) +[FEATURE] - now translations can be cached via a setting in the grotto. *warning* test if this really speeds up your game. tests on a very big server showed that this function even slowed down the page generation. so handle with care. needless to say that this won't work without having the datacache turned on +[FEATURE] - the % you lose when die in the forest is now settable (standard 10%) +[FEATURE] - the skins now get sorted in natural order, not arbitrary anymore (themes in /lib/showform.php) +[FEATURE] - now Cedrik (barkeep), Ramius (death overlord) and Karissa (clan registrar) can be (game settings) changed to any name you like. NOTICE TO TRANSLATORS: change "`\$Ramius"to "%s", "Cedrik" to "%s" and also Karissa to "%s" (there may also be other changes needed, but should be very few) in your translations table. (You may use the search+replace function in the Translation Wizard) +[FEATURE] - modules/avatar.php changed to let the users have linked avatar pictures, coming with a validation in the grotto for moderators. It does not check if it has been changed on the remote server, but it should be ok. You can turn all of this on or off. +[FEATURE] - /lib/modules.php incorporates an increment_module_objpref function you can use to increase numerical values with little effort. Do not use it for ASCII values! Signature of the function: increment_module_objpref($objtype,$objid,$name,$value=1,$module=false) +[FEATURE] - addnav_notl($text,$link=false,$priv=false,$pop=false,$popsize="500x300") is now possible, the content in the text won't get translated +[FEATURE] - added a hook to the gemchance... so you can modify the gem chance via module too. name: "alter-gemchance" +[FEATURE] - added two hooks to the battle.php -> battle-pvp-victory and battle-pvp-defeat to make it easier to decide without having to boost the victory hook for *every* fight just for a pvp battle. +[FEATURE] - user.php added a hook to put more informations about the user to the main view when you edit a user, hook: modulehook("modifyuserview", array("userinfo"=>$userinfo, "user"=>$row))..usage explained in user.php at the given location +[FEATURE] - battle.php now knows also a $badguy['hidehitpoints'] which you can set to true in your module when creating it ("hidehitpoints"=>1) and then the enemy will have "?" hitpoints... good for some specials... more exitement. You can drop a line in your module "your enemy is now about half-dead" or so +[FEATURE] - newday turns after resurrection can now be modified by a game setting (default -6 turns) that handles also a percentage (integer with a % afterwards)... turns can't turn negative and the base is (turns per day) + (dk points spent for turns) +[FEATURE] - now the superuserflag SU_IS_GAMEMASTER exists, which can be set at the grotto. It invocates no hiding from HOF etc, and its function is simple: to post comments without name into a chat. Not more. /game is replaced (only when gamemaster) with no text at all. Also the preview will only hide it for gamemasters. modules/drinks/dohook.php has been changed, it does NOT differ if /game was from a SU_IS_GAMEMASTER or not. + +[FEATURE] - fighting multiple enemies now possible +[FEATURE] - badguys can now have new flags set: + 1) essentialleader: either "true" or a text like "{badguy} falls and all other enemies surrender". + This flag defines one or more enemies as "essential" for the fight. Should one of them die, the fight will be won, even if some badguys are still alive. + 2) cannotbetarget: pretty much self-explanatory. A creature with this flag set can never be your target in battle. In can only be damaged by riposting or area buffs. To win such a battle, the following flag should be set, too. + 3) fleesifalone: If only badguys with this flag set are left living, they will abort the fight and flee. + 4) alwaysattacks: Normally only a certain amount of enemies can attack per round (default: 4). Enemies with this flag do not count towards this limit. (Imagine a swarm of bees. ;) ) +[FEATURE] - Buffs can have new flags set: + 1) aura: If this is set to true, 1/3 of the healing power is also given to any healable companion. This flag only works for buffs with the "regen" power. + 2) areadamage: Normally a buff will only harm the enemy you have targetted. Areadamge harms every enemy around. (Only valid for buffs with "minioncount"). +[FEATURE] - companions can now join you in fights +[FEATURE] - companions can be suspended just like buffs +[FEATURE] - last motd item now shown in daily news +[FEATURE] - new function "previetext()" used in commentary section. This function will support coloured preview throughout the whole game with just a single declaration of usable colours. +[FEATURE] - Last MotD item now shown on top of the news page. +[FEATURE] - Petition categories now extendable via modules. +[FEATURE] - New showform type: "textarearesizeable". Exactly like "textarea" but will show two buttons to increase/decrease size of the field. Needs javascript enabled. +[FEATURE] - mysqli support has been implemented. To use mysqli instead of mysql go to lib/dbwrapper.php and change the dbtype. If you don't know what this means it's probably best you simply ignore this fact. +[FEATURE] - increment_specialty() now also supports incrementing specialties which are not your's. just call increment_specialty('`$', "DA") e.g. to increment someone's level in Dark Arts, even they are a thief. +[FEATURE] - Abigail's gifts are now extendable / changeable via a modulehook. +[FEATURE] - Especially important for european servers: There's now a setting to add an impressum to the about page. + +[FEATURE] - Modules now need _install, _uninstall and _getmoduleinfo functions before the can be installed +[FEATURE] - Setting to allow packs of badguys (all same type) +[FEATURE] - invalidatedatacache() can now invalidate a full path name +[FEATURE] - on install, default settings that haven't been set are now added to the database +[FEATURE] - game masters can now send YoMs from anyone +[FEATURE] - added blocknavcat() and unblocknavcat() +[FEATURE] - can now stop page_footer from saving the user by calling page_footer(false); +[FEATURE] - added invisible setting type +[FEATURE] - new hooks: everyhit-loggedin, everyfooter-loggedin, everyheader-loggedin + +[UPDATE] - languages in prefs.php and configuration.php depend now on a setting "serverlanguages" where you can enter a string (enum) to make sure you have your language in the translator tool. No hardcode edits anymore. +[UPDATE] - home.php altered the select query from laston etc to a simple counting statement which is enough for what we need here +[UPDATE] - now mail.php shows in reply "Original Message from {username}" which makes it easiert to keep track +[UPDATE] - now lotgdnet only notices main server at the login. There are no additional "pings" out. This will reduce traffic and increase performance. +[UPDATE] - Skin selection now gets sorted alphabetically and not anymore in chronological order +[UPDATE] - lib/expire_chars now runs after 23h if called, not after 24. Reason: if you have the newdays at the same time, it might occurr that hit the next exactly at or even bevor the daytime of the last. So only at the next newday the chars expire... which leads to more than 1 day expirations. This fixes it. +[UPDATE] - moved the char, commentary, debuglog expiration to the newday_runonce (also fixed the debuglog bug when set to 0 days...) +[UPDATE] - cron.php ... now guarded by a htaccess file to NOT let peopl trigger newdays from the outside... (security issue). Also removed the redundancy, now the same code is executed. +[UPDATE] - /modules/gardener.php removed the footer-runmodule hook and put in footer-newbieisland. better performance. +[UPDATE] - Edorians idea of moving the output field from the accounts table to a new table implemented. Now the large output field (needed only for badnavs) is not loaded each pagehit anymore (yet updated like always) +[UPDATE] - donators.php removed the debugs and made clear outputs, saying the reason and also after the submit a real sentence. +[UPDATE] - commentary posting limiter (limits posts for one user to 50% of the posting area, normally 10) can be deactivated in the game settings +[UPDATE] - hooking into events now uses the following hook: #modulehook("runevent_$module", array("type"=>$type, "baselink"=>$baseLink, "get"=>httpallget(), "post"=>httpallpost()));# so you can now hook at "runevent_abigail" and get executed there (pls don't call a page_footer in your module there, only if you know what you do) +[UPDATE] - added "ob_start('ob_gzhandler');" to the common.php to enable the gzip compression. This will produce a bit more CPU load, but the traffic will decrease by 30%-40% estimated and your users will have the pages displayed usually a bit quicker as less bytes need to be transferred. This setting proved to be worth adding on smaller and bigger servers, so it is now going to be core. +[UPDATE/FIX] - in the user editor (and if you call the lib/lookup_user.php yourself in any module) you can now use % as tags like in a mysql query. in 1.1.0 it was introduced that you have to enter the *exact* (case-insensitive) name/login of the player. Which was ... not good. Now you can look for an exact match (enter the name normally) or use the % tags to search for any number of letters at this point. I.e. '%man' finds 'Talisman', but not 'Chadmann', 'Tali%' finds 'Talisman', but not 'ReTailMan'.. you can use them at any position (even '%man%' which would find any usernames containing 'man'). +[UPDATE/FIX] - get_module_pref now check first if the pref has been loaded previously and THEN calls load_module_prefs (and check again). As most guys have prefs for certain modules sooner or later, on if-isset afterwards is faster than many function calls who come back empty. +[UPDATE] - lib/forestoutcomes.php now also shows a creaturewin phrase automatically if entered in the creature table, same like the creaturelose phrase that is displayed normally. also edited creatures.php (small code cleanup) +[UPDATE] - lib/battleskills has now a is_buff_active($buffname) to determine if a buff is active¬ suspended or not active or suspended. If you want to check if the buff exists use hasbuff($buffname) +[UPDATE] - added a few more key indices to the account table to be more innodb friendly +[UPDATE] - lib/translator.php modified, now a translate_inline($intext,$namespace=FALSE) is possible, i.e you don't need to construct for a single line a tlschema and reset it afterwards +[UPDATE] - mail.php,lib/systemmail.php,lib/pageparts.php now cache the amount of mails the user has, this speeds things up on the servers (nasty sum query...(Edorian) +[UPDATE] - game settings are cached now (were not before) which caused the move of the datacachepath and the usedatacache to be shifted to the dbconnect.php ... fresh installs will get this automatically, upgrades need to do it manually (see AFTERUPGRADE.txt) +[UPDATE] - lib/checkban.php has its messages now in the ban scheme and those are therefore translatable +[UPDATE] - now races don't need to hook into charstats (an everyhit hook) anymore just to display the race the user has. It has been moved into core. +[UPDATE] - racenames SHOULD now be adressed within the "race" scheme... translate_inline($session['user']['race'],"race") should therefore get you the race name. For people who don't want to remember the scheme and add a few more chars to their translate_inline please use the function get_racename($thisuser=TRUE). If you want the race of the current user, call get_racename(), if you have fetched the race i.e. from the DB directly for a third user, enter the plain race as parameter $thisuser. +[UPDATE] - now core includes .htaccess files who (if apache accepts them) block ANY direct access from the outside to the lib+modules directory (incl. subdirs) to prevent execution of code from the outside without the runmodule or other files in your homeroot. This affects all php files, no other files +[UPDATE] - Many module files have been split up into libs to decrease memory usage (lib files for / files in lib/$filename and for modules in /modules/$filename): + -modules/oldman.php + -graveyard.php (optimized for tormenting) + -user.php (split up) + -petition.php (2/3 FAQs are not needed for petitions, and the other way around) + -installer.php (though not needed often, it is better to have the steps better displayed -better to modify-) + -newday.php (some parts like dk-point spending) + -about.php (general split up) + -inn.php (sanity reasons, also switched the villagenav up) + -modules/cities.php (village doesn't need travels loaded everytime) + -modules/customeq.php (gets called only in charstats mostly) + -modules/scavenge.php (village special not executed 20kb of code all the time... only when running it needs it) + +[UPDATE] - updated specialtydarkarts.php to summon a skeleton warrior as companion, not as a buff +[UPDATE] - updated specialtymysticpower.php to have an aura buff (regeneration) and an area buff (earth fist) +[UPDATE] - updated thieves.php. Lonestrider will now truly attack with multiple thieves. Module also shows how "essentialleader" and "fleesifalone" attributes for badguys work +[UPDATE] - removed admin ability to change passwords. +[UPDATE] - objprefs now cached, too. + +[UPDATE] - Creatures editor now uses formula to generate stats, instead of a large table +[UPDATE] - After killing dragon, location is set to the server setting, not LOCATION_FIELDS +[UPDATE] - When succesfully fleeing, one fight companions expire +[UPDATE] - module download link can now be https,ftp,ftps or http +[UPDATE] - companions can now have a longer name and category +[UPDATE] - If $module_install() returns false, installing stops +[UPDATE] - default module settings are set before calling _install() +[UPDATE] - page title is now sanitized +[UPDATE/FIX] - JS from collapse is now in HTML comments +[UPDATE] - can now specify wether content/nav sections can be collapsed on a system wide level +[UPDATE] - prizemount payments are now cumulative +[UPDATE/FIX] - pvpblock now checks bands are valid +[UPDATE] - source.php now displays files by folders, decreasing clutter \ No newline at end of file diff --git a/lotgd-web/lotgd/LICENSE.txt b/lotgd-web/lotgd/LICENSE.txt new file mode 100755 index 0000000..295ca39 --- /dev/null +++ b/lotgd-web/lotgd/LICENSE.txt @@ -0,0 +1,66 @@ +I'm going to take a few moments to try and explain this new license and +the reasons behind it in plain English. The legalese for the license can +be found online at http://creativecommons.org/licenses/by-nc-sa/2.0/legalcode +and should be read and understood in detail before you use this code. + +This new license was chosen because of a failing with the GPL. It only +covered distribution of source if and only if binaries were distributed. + +In a web environment, specifically an interpreted web environment, merely +installing a game does not constitute distribution, and therefore people +were taking our work, making modifications to it and not releasing the +source code to their modifications so that the entire community could +benefit. They worked with the letter but not the spirit of the law. + +Investigation on the part of the authors however, led to the fact that the +right of public performance was one of the rights normally restricted to +copyright holders, AND that computer programs, specifically video games and +interactive ones such as Legend of the Green Dragon were considered to be +publically performed if run from a public server. + +The new license restricts public performance of the work unless the source +code of the modified work is made available on demand. + +In plain English, this means that if you put this game on a web server and +allow people 'outside of a normal circle of family and its social +acquaintances' to play there, then you are publically performing this work and +MUST either a) make any and ALL changes which you make to the game available +on request (note this doesn't have to be available via the online source +display link, but they must be able to ask you for the code AND receive it +in toto), b) make arrangements privately with the authors wherein they +grant you a special license, or c) remove the code entirely from the machine. + +We do recognize that people want to have areas of their game which are theirs +and theirs alone. To that end we will make the following exception to the +normal requirements for source code distribution -- any module file which is +not modified or derived from a module file included in the base distribution +AND which does not require any other module files AND which does not require +any modifications to the core code (code distributed with the base release) +may be withheld at the authors discretion. + +For purposes of this license, base releases of this code include all versions +created and distributed by Eric Stevens and JT Traub. In addition to these +versions, the developers at Dragonprime.net are hereby granted a revokable +authority to produce new distributions which enjoy the same restrictions and +exceptions as this entire license. This authority may be revoked at any time, +but such revocation will be purely proactive, and existing releases will still +enjoy the full liberty of this license. +Although revocation may be for any reason, the only foreseeable reason that such +revocation would be enacted is if these distributions were discovered to contain +module hooks designed to circumvent the spirit of this license. The intention is +to let these developers continue where Eric and JT have left off. + +We also want to make very clear that version 0.9.7 (also known as version +0.9.7+jt) was the final version released under the GPL. All versions, +starting with the 0.9.8-prerelease code are only licensed under the Creative +Commons license. We EXPLICITLY deny the right to import any code from a +0.9.8-prerelease or later release into a 0.9.7 and earlier release. Allowing +this would cause that imported code to be released under the GPL and that is +not something we wish to allow. Authors of modifications to 0.9.7 will +need to re-release their modifications as derivitives/modifications to +0.9.8 code and place them under the same Creative Commons license. It must +be done by the original author since only the original author has the right +to change the copyright or license upon their work. [Additionally, +reworking the modifications will be a good idea anyway as the mechanism for +making modifications is substantially cleaner/clearer starting with the +0.9.8-prerelease code.] \ No newline at end of file diff --git a/lotgd-web/lotgd/README.txt b/lotgd-web/lotgd/README.txt new file mode 100755 index 0000000..74a36d7 --- /dev/null +++ b/lotgd-web/lotgd/README.txt @@ -0,0 +1,135 @@ +Legend of the Green Dragon +by Eric "MightyE" Stevens (http://www.mightye.org) +and JT "Kendaer" Traub (http://www.dragoncat.net) + +Software Project Page: +http://sourceforge.net/projects/lotgd + +Modification AND Support Community Page: +http://dragonprime.net + +Primary game servers: +http://lotgd.net +http://logd.dragoncat.net + +For a new installation, see INSTALLATION below. +For upgrading a new installation, see UPGRADING below. +If you have problems, please visit Dragonprime at the address above. + +---------------------------------------------- +-- UPGRADING: -------------------------------- +---------------------------------------------- +ALWAYS extract the new distribution into a new directory! + +BEFORE ANYTHING ELSE, read and understand the new code license. This code +is no longer under the GPL! Be aware that if you install this new version +on a publically accessible web server you are bound by the terms of the +license. + +We also *STRONGLY* recommend that you shut down access to your game and +BACK UP your game database AND existing logd source files before attempting +an upgrade as most of the changes are NOT easily reversible! + +If you are running a version after 0.9.7 you can do this by going +into the manage modules, installing the serversuspend module and then +activating it. If you are running a 0.9.7 version, you will need to do +this some other way, such as via .htaccess under apache. Consult the +documentation for your web server. + +Once you have done this, copy the new code into the site directory. Due to +the need of the installer, you have to do this before running the +installer! Make sure that you copy all of the files from all of the +subdirectories. + +As of 0.9.8-prerelease.11, the only way to install or upgrade the game is +via the included installer. To access the installer, log out of the game and +then access installer.php (for instance, if your game was installed at +http://logd.dragoncat.net, you would access the installer at +http://logd.dragoncat.net/installer.php) + +From here, it should be a simple matter of walking through the steps! +Choose upgrade as the type of install (it defaults to *new* install, so +watch out for this!!) and choose the version you currently have installed and +it will perform an upgrade. + +Once this is done, read the note for upgrading from 0.9.7 if you are, and +then go read the POST INSTALLATION section below. + +*** NOTE FOR THOSE UPGRADING FROM 0.9.7 *** +In 0.9.8 and above, the 'specials' directory has been removed and that +functionality is now handled by modules. If you have specials which are not +yet converted to modules, they will be unavailable until you convert them. +Move your specials directory to another directory name (for instance +specials.save) and work on converting them. Most specials should convert +easily and you can look at existing examples. If you haven't created (or +modified) specials on your server, just remove this directory. + +---------------------------------------------- +-- INSTALLATION: ----------------------------- +---------------------------------------------- +These instructions cover a new LoGD installation. +You will need access to a MySQL database and a PHP hosting +location to run this game. Your SQL user needs the LOCK TABLES +privelege in order to run the game correct. + +Extract the files into the directory where you will want the code to live. + +BEFORE ANYTHING ELSE, read and understand the license that this game is +released under. You are legally bound by the license if you install this +game on a publically accessible web server! + +MySQL Setup: +Setup should be pretty straightforward, create the database, create +an account to access the database on behalf of the site; this account +should have full permissions on the database. + +After you have the database created, point your browser at the location you +have the logd files installed at and load up installer.php (for instance, +if the files are accessible as http://logd.dragoncat.net, you will want to +load http://logd.dragoncat.net/installer.php in the browser). The installer +will walk you through a complete setup from the ground up. Make sure to +follow all instructions! + +Once you have completed the installation, read the POST INSTALLATION section +below. + + +---------------------------------------------- +-- POST INSTALLATION: ------------------------ +---------------------------------------------- + +Now that you have the game installed, you need to take a couple of sensible +precautions. + +Firstly, make SURE that your dbconnect.php is not writeable. Under unix, +you do this by typing + chmod -w dbconnect.php +This is to keep you from making unintentional changes to this file. + +The installer will have installed, but not activated, some common modules +which we feel make for a good baseline of the game. + +You should log into the game (using the admin account created during +installation if this is a new install, or your regular admin account if this +is an update) and go into the manage modules section of the Superuser Grotto. +Go through the installed and uninstalled modules and make sure that the +modules you want are installed. Do NOT activate them yet. +*** NOTE *** If this is a first-time install, you will see some messages about +races and specials not being installed during your character setup. This is +fine and correct since you have not yet configured these items. + +Now, go to the game settings page, and configure the game settings for the +base game and for the modules. For an update, this should be just a +matter of looking at the non-active (grey-ed out) modules. For an initial +install, this is a LOT of configuration, but taking your time here will +make your game MUCH better. + +If you are upgrading from 0.9.7, look at your old game settings and make +the new ones similar. A *lot* of settings have moved from the old +configuration screen and are now controlled by modules, so you will want +to write down your old configuration values BEFORE you start the upgrade. + +Once you have things configured to your liking, you should go back to the +manage modules page and ACTIVATE any modules that you want to have running. + +Good luck and enjoy your new LotGD server! diff --git a/lotgd-web/lotgd/TODO.txt b/lotgd-web/lotgd/TODO.txt new file mode 100755 index 0000000..81e2401 --- /dev/null +++ b/lotgd-web/lotgd/TODO.txt @@ -0,0 +1,29 @@ +Eternal tasks: +- Poke MightyE to keep the todo list up to date + +Would be nice for 1.0 release: +- Move some other forest events onto the travel events hook as well. +- Change the way mounts are enabled in certain areas only in order to be + consistent. +- Explain the advertising opt-out link (cost, etc) in the lodge. + +Miscellaneous suggestions to be worked on 'sometime': +- Have a method for allowing the village to decide the 'danger level' + of travel between any other place and it. Or to require the trip to + be something other than just fights (for instance, the way Strider has + the Eythgim village set up on Legendgaard). Aes' worldmap module is a nice + start on this. +- Implement two-pass hotkey system so that links which want a specific hot-key + get first choice. +- Make an in-game task list for deletions/cleanup so that all of it isn't + run in big chunks. + +Ideas which probably won't be done anytime soon: +- Suggestion by JRMinga: it seems less glorious somehow to have the statue + only in d'burg. perhaps at least in one's home city, one can see a + representation of the latest DK of that race? +- anyanka wants an internal description for clan members in addition to the + external description for all and a motd for clan members +- investigate alternate gem procurement methods (black market?) +- investigate means to talk in the village after a person is dead + (Ramius, costing a few favor?) diff --git a/lotgd-web/lotgd/about.php b/lotgd-web/lotgd/about.php new file mode 100755 index 0000000..4a7575d --- /dev/null +++ b/lotgd-web/lotgd/about.php @@ -0,0 +1,32 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/armor.php b/lotgd-web/lotgd/armor.php new file mode 100755 index 0000000..c2e1c12 --- /dev/null +++ b/lotgd-web/lotgd/armor.php @@ -0,0 +1,166 @@ + "Pegasus Armor", + "desc" => array( + "`5The fair and beautiful `#Pegasus`5 greets you with a warm smile as you stroll over to her brightly colored gypsy wagon, which is placed, not out of coincidence, right next to `!MightyE`5's weapon shop.", + "Her outfit is as brightly colored and outrageous as her wagon, and it is almost (but not quite) enough to make you look away from her huge gray eyes and flashes of skin between her not-quite-sufficient gypsy clothes.`n`n", + ), + "tradein" => array( + "`5You look over the various pieces of apparel, and wonder if `#Pegasus`5 would be so good as to try some of them on for you, when you realize that she is busy staring dreamily at `!MightyE`5 through the window of his shop as he, bare-chested, demonstrates the use of one of his fine wares to a customer.", + array("Noticing for a moment that you are browsing her wares, she glances at your `&%s`5 and says that she'll give you `^%s`5 for them.`0`n`n",$session['user']['armor'], $tradeinvalue), + ), + "nosuchweapon" => "`#Pegasus`5 looks at you, confused for a second, then realizes that you've apparently taken one too many bonks on the head, and nods and smiles.", + "tryagain" => "Try again?", + "notenoughgold" => "`5Waiting until `#Pegasus`5 looks away, you reach carefully for the `%%s`5, which you silently remove from the stack of clothes on which it sits. Secure in your theft, you begin to turn around only to realize that your turning action is hindered by a fist closed tightly around your throat. Glancing down, you trace the fist to the arm on which it is attached, which in turn is attached to a very muscular `!MightyE`5. You try to explain what happened here, but your throat doesn't seem to be able to open up to let your voice through, let alone essential oxygen.`n`nAs darkness creeps in on the edge of your vision, you glance pleadingly, but futilely at `%Pegasus`5 who is staring dreamily at `!MightyE`5, her hands clutched next to her face, which is painted with a large admiring smile.`n`n`n`nYou wake up some time later, having been tossed unconscious into the street.", + "payarmor" => "`#Pegasus`5 takes your gold, and much to your surprise she also takes your `%%s`5 and promptly puts a price on it, setting it neatly on another stack of clothes.`n`nIn return, she hands you a beautiful new `%%s`5.`n`nYou begin to protest, \"`@Won't I look silly wearing nothing but my `&%s`@?`5\" you ask. You ponder it a moment, and then realize that everyone else in the town is doing the same thing. \"`@Oh well, when in Rome...`5\"", +); + +$schemas = array( + "title"=>"armor", + "desc"=>"armor", + "tradein"=>"armor", + "nosuchweapon"=>"armor", + "tryagain"=>"armor", + "notenoughgold"=>"armor", + "payarmor"=>"armor", +); + +$basetext['schemas'] = $schemas; +$texts = modulehook("armortext",$basetext); +$schemas = $texts['schemas']; + +tlschema($schemas['title']); +page_header($texts['title']); +output("`c`b`%".$texts['title']."`0`b`c"); +tlschema(); +$op = httpget('op'); +if ($op==""){ + tlschema($schemas['desc']); + if (is_array($texts['desc'])) { + foreach ($texts['desc'] as $description) { + output_notl(sprintf_translate($description)); + } + } else { + output($texts['desc']); + } + tlschema(); + + $sql = "SELECT max(level) AS level FROM " . db_prefix("armor") . " WHERE level<=".$session['user']['dragonkills']; + $result = db_query($sql); + $row = db_fetch_assoc($result); + + $sql = "SELECT * FROM " . db_prefix("armor") . " WHERE level={$row['level']} ORDER BY value"; + $result = db_query($sql); + + tlschema($schemas['tradein']); + if (is_array($texts['tradein'])) { + foreach ($texts['tradein'] as $description) { + output_notl(sprintf_translate($description)); + } + } else { + output($texts['tradein']); + } + tlschema(); + + $aname = translate_inline("`bName`b"); + $adef = translate_inline("`bDefense`b"); + $acost = translate_inline("`bCost`b"); + rawoutput(""); + rawoutput(""); + $i = 0; + while($row = db_fetch_assoc($result)) { + $link = true; + $row = modulehook("modify-armor", $row); + if (isset($row['skip']) && $row['skip'] === true) { + continue; + } + if (isset($row['unavailable']) && $row['unavailable'] == true) { + $link = false; + } + rawoutput(""); + rawoutput(""); + ++$i; + } + rawoutput("
"); + output_notl($aname); + rawoutput(""); + output_notl($adef); + rawoutput(""); + output_notl($acost); + rawoutput("
"); + $color = "`)"; + if ($row['value']<=($session['user']['gold']+$tradeinvalue)){ + if ($link) { + $color = "`&"; + rawoutput(""); + } else { + $color = "`7"; + } + output_notl("%s%s`0", $color, $row['armorname']); + if ($link) { + rawoutput(""); + } + addnav("","armor.php?op=buy&id={$row['armorid']}"); + }else{ + output_notl("%s%s`0", $color, $row['armorname']); + addnav("","armor.php?op=buy&id={$row['armorid']}"); + } + rawoutput(""); + output_notl("%s%s`0", $color, $row['defense']); + rawoutput(""); + if (isset($row['alternatetext']) && $row['alternatetext'] > "") { + output("%s%s`0", $color, $row['alternatetext']); + } else { + output_notl("%s%s`0",$color,$row['value']); + } + rawoutput("
",true); + villagenav(); +}elseif ($op=="buy"){ + $id = httpget('id'); + $sql = "SELECT * FROM " . db_prefix("armor") . " WHERE armorid='$id'"; + $result = db_query($sql); + if (db_num_rows($result)==0){ + tlschema($schemas['nosuchweapon']); + output($texts['nosuchweapon']); + tlschema(); + tlschema($schemas['tryagain']); + addnav($texts['tryagain'],"armor.php"); + tlschema(); + villagenav(); + }else{ + $row = db_fetch_assoc($result); + $row = modulehook("modify-armor", $row); + if ($row['value']>($session['user']['gold']+$tradeinvalue)){ + tlschema($schemas['notenoughgold']); + output($texts['notenoughgold'],$row['armorname']); + tlschema(); + villagenav(); + }else{ + tlschema($schemas['payarmor']); + output($texts['payarmor'],$session['user']['armor'],$row['armorname'],$row['armorname']); + tlschema(); + debuglog("spent " . ($row['value']-$tradeinvalue) . " gold on the " . $row['armorname'] . " armor"); + $session['user']['gold']-=$row['value']; + $session['user']['armor'] = $row['armorname']; + $session['user']['gold']+=$tradeinvalue; + $session['user']['defense']-=$session['user']['armordef']; + $session['user']['armordef'] = $row['defense']; + $session['user']['defense']+=$session['user']['armordef']; + $session['user']['armorvalue'] = $row['value']; + villagenav(); + } + } +} +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/armoreditor.php b/lotgd-web/lotgd/armoreditor.php new file mode 100755 index 0000000..ac8fa52 --- /dev/null +++ b/lotgd-web/lotgd/armoreditor.php @@ -0,0 +1,109 @@ +48,225,585,990,1575,2250,2790,3420,4230,5040,5850,6840,8010,9000,10350); +output("`&

Armor for %s Dragon Kills

`0",$armorlevel,true); + +$armorarray=array( + "Armor,title", + "armorid"=>"Armor ID,hidden", + "armorname"=>"Armor Name", + "defense"=>"Defense,range,1,15,1"); +$op = httpget('op'); +$id = httpget('id'); +if($op=="edit" || $op=="add"){ + if ($op=="edit"){ + $sql = "SELECT * FROM " . db_prefix("armor") . " WHERE armorid='$id'"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + }else{ + $sql = "SELECT max(defense+1) AS defense FROM " . db_prefix("armor") . " WHERE level=$armorlevel"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + } + rawoutput("
"); + addnav("","armoreditor.php?op=save&level=$armorlevel"); + showform($armorarray,$row); + rawoutput("
"); +}else if($op=="del"){ + $sql = "DELETE FROM " . db_prefix("armor") . " WHERE armorid='$id'"; + db_query($sql); + //output($sql); + $op = ""; + httpset("op", $op); +}else if($op=="save"){ + $armorid = httppost('armorid'); + $armorname = httppost('armorname'); + $defense = httppost('defense'); + if ($armorid>0){ + $sql = "UPDATE " . db_prefix("armor") . " SET armorname=\"$armorname\",defense=\"$defense\",value=".$values[$defense]." WHERE armorid='$armorid'"; + }else{ + $sql = "INSERT INTO " . db_prefix("armor") . " (level,defense,armorname,value) VALUES ($armorlevel,\"$defense\",\"$armorname\",".$values[$defense].")"; + } + db_query($sql); + $op = ""; + httpset("op", $op); +} +if ($op==""){ + $sql = "SELECT max(level+1) AS level FROM " . db_prefix("armor"); + $res = db_query($sql); + $row = db_fetch_assoc($res); + $max = $row['level']; + for ($i=0;$i<=$max;$i++){ + if ($i == 1) + addnav(array("Armor for %s DK",$i),"armoreditor.php?level=$i"); + else + addnav(array("Armor for %s DKs",$i),"armoreditor.php?level=$i"); + } + $sql = "SELECT * FROM " . db_prefix("armor") . " WHERE level=$armorlevel ORDER BY defense"; + $result= db_query($sql); + $ops = translate_inline("Ops"); + $name = translate_inline("Name"); + $cost = translate_inline("Cost"); + $defense = translate_inline("Defense"); + $level = translate_inline("Level"); + $edit = translate_inline("Edit"); + $del = translate_inline("Del"); + $delconfirm = translate_inline("Are you sure you wish to delete this armor?"); + + rawoutput(""); + rawoutput(""); + $number=db_num_rows($result); + for ($i=0;$i<$number;$i++){ + $row = db_fetch_assoc($result); + rawoutput(""); + rawoutput(""); + addnav("","armoreditor.php?op=edit&id={$row['armorid']}&level=$armorlevel"); + addnav("","armoreditor.php?op=del&id={$row['armorid']}&level=$armorlevel"); + rawoutput(""); + rawoutput(""); + } + rawoutput("
$ops$name$cost$defense$level
[$edit|$del]"); + output_notl($row['armorname']); + rawoutput(""); + output_notl($row['value']); + rawoutput(""); + output_notl($row['defense']); + rawoutput(""); + output_notl($row['level']); + rawoutput("
"); +} +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/badnav.php b/lotgd-web/lotgd/badnav.php new file mode 100755 index 0000000..7957715 --- /dev/null +++ b/lotgd-web/lotgd/badnav.php @@ -0,0 +1,51 @@ +")){ + checkday(); + } + while (list($key,$val)=each($session['allowednavs'])){ + //hack-tastic. + if ( + trim($key)=="" || + $key===0 || + substr($key,0,8)=="motd.php" || + substr($key,0,8)=="mail.php" + ) unset($session['allowednavs'][$key]); + } + $sql="SELECT output FROM ".db_prefix("accounts_output")." WHERE acctid={$session['user']['acctid']};"; + $result=db_query($sql); + $row=db_fetch_assoc($result); + if (!is_array($session['allowednavs']) || + count($session['allowednavs'])==0 || $row['output']=="") { + $session['allowednavs']=array(); + page_header("Your Navs Are Corrupted"); + if ($session['user']['alive']) { + villagenav(); + output("Your navs are corrupted, please return to %s.", + $session['user']['location']); + } else { + addnav("Return to Shades", "shades.php"); + output("Your navs are corrupted, please return to the Shades."); + } + page_footer(); + } + echo $row['output']; + $session['debug']=""; + $session['user']['allowednavs']=$session['allowednavs']; + saveuser(); +}else{ + $session=array(); + translator_setup(); + redirect("index.php"); +} + +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/badword.php b/lotgd-web/lotgd/badword.php new file mode 100755 index 0000000..9fff4c1 --- /dev/null +++ b/lotgd-web/lotgd/badword.php @@ -0,0 +1,172 @@ +"); +addnav("","badword.php?op=test"); +output("`7Test a word:`0"); +rawoutput(""); +if ($op=="test"){ + $word = httppost("word"); + $return = soap($word,true); + if ($return == $word) + output("`7\"%s\" does not trip any filters.`0`n`n", $word); + else + output("`7%s`0`n`n", $return); +} + +output_notl("", true); +output("`7`bGood Words`b`0"); +rawoutput(""); +output("`7 (bad word exceptions)`0`n"); + +$add = translate_inline("Add"); +$remove = translate_inline("Remove"); +rawoutput("
"); +addnav("","badword.php?op=addgood"); +output("`7Add a word:`0"); +rawoutput("
"); +rawoutput("
"); +addnav("","badword.php?op=removegood"); +output("`7Remove a word:`0"); +rawoutput("
"); + + +$sql = "SELECT * FROM ".db_prefix("nastywords")." WHERE type='good'"; +$result = db_query($sql); +$row = db_fetch_assoc($result); +$words = explode(" ",$row['words']); +if ($op=="addgood"){ + + $newregexp = stripslashes(httppost('word')); + + // not sure if the line below should appear, as the strings in the good + // word list have different behaviour than those in the nasty word list, + // and strings with single quotes in them currently have odd and + // unreliable behaviour, both under the good word list and the nasty + // word list + // $newregexp = preg_replace('/(?"); +output("`7`bNasty Words`b`0"); +rawoutput(""); +output_notl("`n"); + +rawoutput("
"); +addnav("","badword.php?op=add"); +output("`7Add a word:`0"); +rawoutput("
"); +rawoutput("
"); +addnav("","badword.php?op=remove"); +output("`7Remove a word:`0"); +rawoutput("
"); + +$sql = "SELECT * FROM " . db_prefix("nastywords") . " WHERE type='nasty'"; +$result = db_query($sql); +$row = db_fetch_assoc($result); +$words = explode(" ",$row['words']); +reset($words); + +if ($op=="add"){ + + $newregexp = stripslashes(httppost('word')); + + // automagically escapes all unescaped single quote characters + $newregexp = preg_replace('/(? \ No newline at end of file diff --git a/lotgd-web/lotgd/bank.php b/lotgd-web/lotgd/bank.php new file mode 100755 index 0000000..ab39318 --- /dev/null +++ b/lotgd-web/lotgd/bank.php @@ -0,0 +1,268 @@ +=0){ + output("`6\"`@Aah, yes, here we are. You have `^%s gold`@ in our prestigious bank. Is there anything else I can do for you?`6\"",$session['user']['goldinbank']); + }else{ + output("`6\"`@Aah, yes, here we are. You have a `&debt`@ of `^%s gold`@ in our prestigious bank. Is there anything else I can do for you?`6\"",abs($session['user']['goldinbank'])); + } +}elseif($op=="transfer"){ + output("`6`bTransfer Money`b:`n"); + if ($session['user']['goldinbank']>=0){ + output("`@Elessa`6 tells you, \"`@Just so that you are fully aware of our policies, you may only transfer `^%s`@ gold per the recipient's level.",getsetting("transferperlevel",25)); + $maxout = $session['user']['level']*getsetting("maxtransferout",25); + output("Similarly, you may transfer no more than `^%s`@ gold total during the day.`6\"`n",$maxout); + if ($session['user']['amountouttoday'] > 0) { + output("`6She scans her ledgers briefly, \"`@For your knowledge, you have already transferred `^%s`@ gold today.`6\"`n",$session['user']['amountouttoday']); + } + output_notl("`n"); + $preview = translate_inline("Preview Transfer"); + rawoutput("
"); + output("Transfer how much: "); + rawoutput(""); + output_notl("`n"); + output("To: "); + rawoutput(""); + output(" (partial names are ok, you will be asked to confirm the transaction before it occurs).`n"); + rawoutput("
"); + rawoutput(""); + addnav("","bank.php?op=transfer2"); + }else{ + output("`@Elessa`6 tells you that she refuses to transfer money for someone who is in debt."); + } +}elseif($op=="transfer2"){ + output("`6`bConfirm Transfer`b:`n"); + $string="%"; + $to = httppost('to'); + for ($x=0;$x"); + output("`6Transfer `^%s`6 to `&%s`6.",$amt,$row['name']); + rawoutput("",true); + addnav("","bank.php?op=transfer3"); + }elseif(db_num_rows($result)>100){ + output("`@Elessa`6 looks at you disdainfully and coldly, but politely, suggests you try narrowing down the field of who you want to send money to just a little bit!`n`n"); + $msg = translate_inline("Preview Transfer"); + rawoutput("
"); + output("Transfer how much: "); + rawoutput("
"); + output("To: "); + rawoutput(""); + output(" (partial names are ok, you will be asked to confirm the transaction before it occurs).`n"); + rawoutput("
"); + rawoutput("",true); + addnav("","bank.php?op=transfer2"); + }elseif(db_num_rows($result)>1){ + rawoutput("
"); + output("`6Transfer `^%s`6 to ",$amt); + rawoutput("
",true); + addnav("","bank.php?op=transfer3"); + }else{ + output("`@Elessa`6 blinks at you from behind her spectacles, \"`@I'm sorry, but I can find no one matching that name who does business with our bank! Please try again.`6\""); + } +}elseif($op=="transfer3"){ + $amt = abs((int)httppost('amount')); + $to = httppost('to'); + output("`6`bTransfer Completion`b`n"); + if ($session['user']['gold']+$session['user']['goldinbank']<$amt){ + output("`@Elessa`6 stands up to her full, but still diminutive height and glares at you, \"`@How can you transfer `^%s`@ gold when you only possess `^%s`@?`6\"",$amt,$session['user']['gold']+$session['user']['goldinbank']); + }else{ + $sql = "SELECT name,acctid,level,transferredtoday FROM " . db_prefix("accounts") . " WHERE login='$to'"; + $result = db_query($sql); + if (db_num_rows($result)==1){ + $row = db_fetch_assoc($result); + $maxout = $session['user']['level']*getsetting("maxtransferout",25); + $maxtfer = $row['level']*getsetting("transferperlevel",25); + if ($session['user']['amountouttoday']+$amt > $maxout) { + output("`@Elessa`6 shakes her head, \"`@I'm sorry, but I cannot complete that transfer; you are not allowed to transfer more than `^%s`@ gold total per day.`6\"",$maxout); + }else if ($maxtfer<$amt){ + output("`@Elessa`6 shakes her head, \"`@I'm sorry, but I cannot complete that transfer; `&%s`@ may only receive up to `^%s`@ gold per day.`6\"",$row['name'],$maxtfer); + }else if($row['transferredtoday']>=getsetting("transferreceive",3)){ + output("`@Elessa`6 shakes her head, \"`@I'm sorry, but I cannot complete that transfer; `&%s`@ has received too many transfers today, you will have to wait until tomorrow.`6\"",$row['name']); + }else if($amt<(int)$session['user']['level']){ + output("`@Elessa`6 shakes her head, \"`@I'm sorry, but I cannot complete that transfer; you might want to send a worthwhile transfer, at least as much as your level.`6\""); + }else if($row['acctid']==$session['user']['acctid']){ + output("`@Elessa`6 glares at you, her eyes flashing dangerously, \"`@You may not transfer money to yourself! That makes no sense!`6\""); + }else{ + debuglog("transferred $amt gold to", $row['acctid']); + $session['user']['gold']-=$amt; + if ($session['user']['gold']<0){ + //withdraw in case they don't have enough on hand. + $session['user']['goldinbank']+=$session['user']['gold']; + $session['user']['gold']=0; + } + $session['user']['amountouttoday']+= $amt; + $sql = "UPDATE ". db_prefix("accounts") . " SET goldinbank=goldinbank+$amt,transferredtoday=transferredtoday+1 WHERE acctid='{$row['acctid']}'"; + db_query($sql); + output("`@Elessa`6 smiles, \"`@The transfer has been completed!`6\""); + $subj = array("`^You have received a money transfer!`0"); + $body = array("`&%s`6 has transferred `^%s`6 gold to your bank account!",$session['user']['name'],$amt); + systemmail($row['acctid'],$subj,$body); + } + }else{ + output("`@Elessa`6 looks up from her ledger with a bit of surprise on her face, \"`@I'm terribly sorry, but I seem to have run into an accounting error, would you please try telling me what you wish to transfer again?`6\""); + } + } +}elseif($op=="deposit"){ + output("`0"); + rawoutput("
"); + $balance = translate_inline("`@Elessa`6 says, \"`@You have a balance of `^%s`@ gold in the bank.`6\"`n"); + $debt = translate_inline("`@Elessa`6 says, \"`@You have a `\$debt`@ of `^%s`@ gold to the bank.`6\"`n"); + output_notl($session['user']['goldinbank']>=0?$balance:$debt,abs($session['user']['goldinbank'])); + output("`6Searching through all your pockets and pouches, you calculate that you currently have `^%s`6 gold on hand.`n`n", $session['user']['gold']); + $dep = translate_inline("`^Deposit how much?"); + $pay = translate_inline("`^Pay off how much?"); + output_notl($session['user']['goldinbank']>=0?$dep:$pay); + $dep = translate_inline("Deposit"); + rawoutput(" "); + output("`n`iEnter 0 or nothing to deposit it all`i"); + rawoutput("
"); + rawoutput("",true); + addnav("","bank.php?op=depositfinish"); +}elseif($op=="depositfinish"){ + $amount = abs((int)httppost('amount')); + if ($amount==0){ + $amount=$session['user']['gold']; + } + $notenough = translate_inline("`\$ERROR: Not enough gold in hand to deposit.`n`n`^You plunk your `&%s`^ gold on the counter and declare that you would like to deposit all `&%s`^ gold of it.`n`n`@Elessa`6 stares blandly at you for a few seconds until you become self conscious and recount your money, realizing your mistake."); + $depositdebt = translate_inline("`@Elessa`6 records your deposit of `^%s `6gold in her ledger. \"`@Thank you, `&%s`@. You now have a debt of `\$%s`@ gold to the bank and `^%s`@ gold in hand.`6\""); + $depositbalance= translate_inline("`@Elessa`6 records your deposit of `^%s `6gold in her ledger. \"`@Thank you, `&%s`@. You now have a balance of `^%s`@ gold in the bank and `^%s`@ gold in hand.`6\""); + if ($amount>$session['user']['gold']){ + output_notl($notenough,$session['user']['gold'],$amount); + }else{ + debuglog("deposited " . $amount . " gold in the bank"); + $session['user']['goldinbank']+=$amount; + $session['user']['gold']-=$amount; + output_notl($session['user']['goldinbank']>=0?$depositbalance:$depositdebt,$amount,$session['user']['name'], abs($session['user']['goldinbank']),$session['user']['gold']); + } +}elseif($op=="borrow"){ + $maxborrow = $session['user']['level']*getsetting("borrowperlevel",20); + $borrow = translate_inline("Borrow"); + $balance = translate_inline("`@Elessa`6 scans through her ledger, \"`@You have a balance of `^%s`@ gold in the bank.`6\"`n"); + $debt = translate_inline("`@Elessa`6 scans through her ledger, \"`@You have a `\$debt`@ of `^%s`@ gold to the bank.`6\"`n"); + rawoutput("
"); + output_notl($session['user']['goldinbank']>=0?$balance:$debt,abs($session['user']['goldinbank'])); + output("`6\"`@How much would you like to borrow `&%s`@? At your level, you may borrow up to a total of `^%s`@ from the bank.`6\"`n`n",$session['user']['name'], $maxborrow); + rawoutput(" "); + output("`n(Money will be withdrawn until you have none left, the remainder will be borrowed)"); + rawoutput("
"); + rawoutput(""); + addnav("","bank.php?op=withdrawfinish"); +}elseif($op=="withdraw"){ + $withdraw = translate_inline("Withdraw"); + $balance = translate_inline("`@Elessa`6 scans through her ledger, \"`@You have a balance of `^%s`@ gold in the bank.`6\"`n"); + $debt = translate_inline("`@Elessa`6 scans through her ledger, \"`@You have a `\$debt`@ of `^%s`@ gold in the bank.`6\"`n"); + rawoutput("
"); + output_notl($session['user']['goldinbank']>=0?$balance:$debt,abs($session['user']['goldinbank'])); + output("`6\"`@How much would you like to withdraw `&%s`@?`6\"`n`n",$session['user']['name']); + rawoutput(" "); + output("`n`iEnter 0 or nothing to withdraw it all`i"); + rawoutput("
"); + rawoutput(""); + addnav("","bank.php?op=withdrawfinish"); +}elseif($op=="withdrawfinish"){ + $amount=abs((int)httppost('amount')); + if ($amount==0){ + $amount=abs($session['user']['goldinbank']); + } + if ($amount>$session['user']['goldinbank'] && httppost('borrow')=="") { + output("`\$ERROR: Not enough gold in the bank to withdraw.`^`n`n"); + output("`6Having been informed that you have `^%s`6 gold in your account, you declare that you would like to withdraw all `^%s`6 of it.`n`n", $session['user']['goldinbank'], $amount); + output("`@Elessa`6 looks at you for a few moments without blinking, then advises you to take basic arithmetic. You realize your folly and think you should try again."); + }else if($amount>$session['user']['goldinbank']){ + $lefttoborrow = $amount; + $didwithdraw = 0; + $maxborrow = $session['user']['level']*getsetting("borrowperlevel",20); + if ($lefttoborrow<=$session['user']['goldinbank']+$maxborrow){ + if ($session['user']['goldinbank']>0){ + output("`6You withdraw your remaining `^%s`6 gold.", $session['user']['goldinbank']); + $lefttoborrow-=$session['user']['goldinbank']; + $session['user']['gold']+=$session['user']['goldinbank']; + $session['user']['goldinbank']=0; + debuglog("withdrew $amount gold from the bank"); + $didwithdraw = 1; + } + if ($lefttoborrow-$session['user']['goldinbank'] > $maxborrow){ + if ($didwithdraw) { + output("`6Additionally, you ask to borrow `^%s`6 gold.", $leftoborrow); + } else { + output("`6You ask to borrow `^%s`6 gold.", $lefttoborrow); + } + output("`@Elessa`6 looks up your account and informs you that you may only borrow up to `^%s`6 gold.", $maxborrow); + }else{ + if ($didwithdraw) { + output("`6Additionally, you borrow `^%s`6 gold.", $lefttoborrow); + } else { + output("`6You borrow `^%s`6 gold.", $lefttoborrow); + } + $session['user']['goldinbank']-=$lefttoborrow; + $session['user']['gold']+=$lefttoborrow; + debuglog("borrows $lefttoborrow gold from the bank"); + output("`@Elessa`6 records your withdrawal of `^%s `6gold in her ledger. \"`@Thank you, `&%s`@. You now have a debt of `\$%s`@ gold to the bank and `^%s`@ gold in hand.`6\"", $amount,$session['user']['name'], abs($session['user']['goldinbank']),$session['user']['gold']); + } + }else{ + output("`6Considering the `^%s`6 gold in your account, you ask to borrow `^%s`6. `@Elessa`6 peers through her ledger, runs a few calculations and then informs you that, at your level, you may only borrow up to a total of `^%s`6 gold.", $session['user']['goldinbank'], $lefttoborrow-$session['user']['goldinbank'], $maxborrow); + } + }else{ + $session['user']['goldinbank']-=$amount; + $session['user']['gold']+=$amount; + debuglog("withdrew $amount gold from the bank"); + output("`@Elessa`6 records your withdrawal of `^%s `6gold in her ledger. \"`@Thank you, `&%s`@. You now have a balance of `^%s`@ gold in the bank and `^%s`@ gold in hand.`6\"", $amount,$session['user']['name'], abs($session['user']['goldinbank']),$session['user']['gold']); + } +} +villagenav(); +addnav("Money"); +if ($session['user']['goldinbank']>=0){ + addnav("W?Withdraw","bank.php?op=withdraw"); + addnav("D?Deposit","bank.php?op=deposit"); + if (getsetting("borrowperlevel",20)) addnav("L?Take out a Loan","bank.php?op=borrow"); +}else{ + addnav("D?Pay off Debt","bank.php?op=deposit"); + if (getsetting("borrowperlevel",20)) addnav("L?Borrow More","bank.php?op=borrow"); +} +if (getsetting("allowgoldtransfer",1)){ + if ($session['user']['level']>=getsetting("mintransferlev",3) || $session['user']['dragonkills']>0){ + addnav("M?Transfer Money","bank.php?op=transfer"); + } +} + +page_footer(); + +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/battle.php b/lotgd-web/lotgd/battle.php new file mode 100755 index 0000000..44345eb --- /dev/null +++ b/lotgd-web/lotgd/battle.php @@ -0,0 +1,630 @@ + "") { + $safe = $attackstack; + $enemies = array(); + $enemies[0]=$safe; + unset($safe); +} elseif (isset($attackstack[0]['creaturename']) && $attackstack['creaturename'] > "") { + $enemies=$attackstack; +} +if (!isset($options)) { + if (isset($enemies[0]['type'])) $options['type'] = $enemies[0]['type']; +} + +$options = prepare_fight($options); + +$roundcounter=0; +$adjustment = 1; + +$count = 1; +$auto = httpget('auto'); +if ($auto == 'full') { + $count = -1; +} else if ($auto == 'five') { + $count = 5; +} else if ($auto == 'ten') { + $count = 10; +} + +$enemycounter = count($enemies); +$enemies = autosettarget($enemies); + +$op=httpget("op"); +$skill=httpget("skill"); +$l=httpget("l"); +$newtarget = httpget('newtarget'); +if ($newtarget != "") $op = "newtarget"; +//if (!$targetted) $op = "newtarget"; + +if ($op=="fight"){ + apply_skill($skill,$l); +} else if ($op=="newtarget") { + foreach ($enemies as $index=>$badguy){ + if ($index == (int)$newtarget) { + if (!isset($badguy['cannotbetarget']) || $badguy['cannotbetarget'] === false) { + $enemies[$index]['istarget'] = 1; + }else{ + if (is_array($badguy['cannotbetarget'])) { + $msg = sprintf_translate($badguy['cannotbetarget']); + $msg = substitute($msg); + output_notl($msg); //Here it's already translated + }else{ + if ($badguy['cannotbetarget'] === true) { + $msg = "{badguy} cannot be selected as target."; + } else { + $msg = $badguy['cannotbetarget']; + } + $msg = substitute_array("`5".$msg."`0`n"); + output($msg); + } + } + } else { + $enemies[$index]['istarget'] = 0; + } + } +} + +$victory = false; +$defeat = false; + +if ($enemycounter > 0) { + output ("`\$`c`b~ ~ ~ Fight ~ ~ ~`b`c`0"); + modulehook("battle", $enemies); + foreach ($enemies as $index=>$badguy) { + if ($badguy['creaturehealth']>0 && $session['user']['hitpoints']>0) { + output("`@You have encountered `^%s`@ which lunges at you with `%%s`@!`0`n",$badguy['creaturename'],$badguy['creatureweapon']); + } + } + output_notl("`n"); + show_enemies($enemies); +} + +suspend_buffs((($options['type'] == 'pvp')?"allowinpvp":false)); +suspend_companions((($options['type'] == 'pvp')?"allowinpvp":false)); + +// Now that the bufflist is sane, see if we should add in the bodyguard. +$inn = (int)httpget('inn'); +if ($options['type']=='pvp' && $inn==1) { + apply_bodyguard($badguy['bodyguardlevel']); +} + +$surprised = false; +if ($op != "run" && $op != "fight" && $op != "newtarget") { + if (count($enemies) > 1) { + $surprised = true; + output("`b`^YOUR ENEMIES`\$ surprise you and get the first round of attack!`0`b`n`n"); + } else { + // Let's try this instead.Biggest change is that it adds possibility of + // being surprised to all fights. + if (!array_key_exists('didsurprise',$options) || !$options['didsurprise']) { + // By default, surprise is 50/50 + $surprised = e_rand(0, 1) ? true : false; + // Now, adjust for slum/thrill + $type = httpget('type'); + if ($type == 'slum' || $type == 'thrill') { + $num = e_rand(0, 2); + $surprised = true; + if ($type == 'slum' && $num != 2) + $surprised = false; + if (($type == 'thrill' || $type=='suicide') && $num == 2) + $surprised = false; + } + if (!$surprised) { + output("`b`\$Your skill allows you to get the first attack!`0`b`n`n"); + } else { + if ($options['type'] == 'pvp') { + output("`b`^%s`\$'s skill allows them to get the first round of attack!`0`b`n`n",$badguy['creaturename']); + }else{ + output("`b`^%s`\$ surprises you and gets the first round of attack!`0`b`n`n",$badguy['creaturename']); + } + $op = "run"; + } + $options['didsurprise']=1; + } + } +} +$needtostopfighting = false; +if ($op != "newtarget") { + // Run through as many rounds as needed. + do { + //we need to restore and calculate here to reflect changes that happen throughout the course of multiple rounds. + restore_buff_fields(); + calculate_buff_fields(); + prepare_companions(); + $newenemies = array(); + // Run the beginning of round buffs (this also calculates all modifiers) + foreach ($enemies as $index=>$badguy) { + if ($badguy['dead'] == false && $badguy['creaturehealth'] > 0) { + if (isset($badguy['alwaysattacks']) && $badguy['alwaysattacks'] == true) { + } else { + $roundcounter++; + } + if (($roundcounter > $options['maxattacks']) && $badguy['istarget'] == false) { + $newcompanions = $companions; + } else { + $buffset = activate_buffs("roundstart"); + if ($badguy['creaturehealth']<=0 || $session['user']['hitpoints']<=0){ + $creaturedmg = 0; + $selfdmg = 0; + if ($badguy['creaturehealth'] <= 0) { + $badguy['dead'] = true; + $badguy['istarget'] = false; + $count = 1; + $needtostopfighting = true; + } + if ($session['user']['hitpoints'] <= 0) { + $count = 1; + $needtostopfighting = true; + } + $newenemies[$index] = $badguy; + $newcompanions = $companions; + // No break here. It would break the foreach statement. + } else { + $creaturedefmod=$buffset['badguydefmod']; + $creatureatkmod=$buffset['badguyatkmod']; + $atkmod=$buffset['atkmod']; + $defmod=$buffset['defmod']; + $compatkmod=$buffset['compatkmod']; + $compdefmod=$buffset['compdefmod']; + if ($badguy['creaturehealth']>0 && $session['user']['hitpoints']>0 && $badguy['istarget']){ + if (is_array($companions)) { + $newcompanions = array(); + foreach ($companions as $name=>$companion) { + if ($companion['hitpoints'] > 0) { + $buffer = report_companion_move($companion, "heal"); + if ($buffer !== false) { + $newcompanions[$name] = $buffer; + unset($buffer); + } else { + unset($companion); + unset($newcompanions[$name]); + } + } else { + $newcompanions[$name] = $companion; + } + } + } + } else { + $newcompanions = $companions; + } + $companions = $newcompanions; + + if ($op=="fight" || $op=="run" || $surprised){ + // Grab an initial roll. + $roll = rolldamage(); + if ($op=="fight" && !$surprised){ + $ggchancetodouble = $session['user']['dragonkills']; + $bgchancetodouble = $session['user']['dragonkills']; + + if ($badguy['creaturehealth']>0 && $session['user']['hitpoints']>0) { + $buffset = activate_buffs("offense"); + if ($badguy['creaturehealth']>0 && $session['user']['hitpoints']>0 && $badguy['istarget']){ + if (is_array($companions)) { + $newcompanions = array(); + foreach ($companions as $name=>$companion) { + if ($companion['hitpoints'] > 0) { + $buffer = report_companion_move($companion, "magic"); + if ($buffer !== false) { + $newcompanions[$name] = $buffer; + unset($buffer); + } else { + unset($companion); + unset($newcompanions[$name]); + } + } else { + $newcompanions[$name] = $companion; + } + } + } + } else { + $newcompanions = $companions; + } + $companions = $newcompanions; + if ($badguy['creaturehealth']<=0 || $session['user']['hitpoints']<=0){ + $creaturedmg = 0; + $selfdmg = 0; + if ($badguy['creaturehealth'] <= 0) { + $badguy['dead'] = true; + $badguy['istarget'] = false; + $count = 1; + $needtostopfighting=true; + } + $newenemies[$index] = $badguy; + $newcompanions = $companions; + // No break here. It would break the foreach statement. + } else if ($badguy['istarget'] == true) { + do { + if ($badguy['creaturehealth']<=0 || $session['user']['hitpoints']<=0){ + $creaturedmg = 0; + $selfdmg = 0; + $newenemies[$index] = $badguy; + $newcompanions = $companions; + $needtostopfighting = true; + }else{ + $needtostopfighting = battle_player_attacks(); + } + $r = mt_rand(0,100); + if ($r < $ggchancetodouble && $badguy['creaturehealth']>0 && $session['user']['hitpoints']>0 && !$needtostopfighting){ + $additionalattack = true; + $ggchancetodouble -= ($r+5); + $roll = rolldamage(); + }else{ + $additionalattack = false; + } + } while($additionalattack && !$needtostopfighting); + if ($needtostopfighting) { + $newcompanions = $companions; + } + } else { + } + } + }else if($op=="run" && !$surprised){ + output("`4You are too busy trying to run away like a cowardly dog to try to fight `^%s`4.`n",$badguy['creaturename']); + } + + //Need to insert this here because of auto-fighting! + if ($op != "newtarget") $op = "fight"; + + // We need to check both user health and creature health. Otherwise + // the user can win a battle by a RIPOSTE after he has gone <= 0 HP. + //-- Gunnar Kreitz + if ($badguy['creaturehealth']>0 && $session['user']['hitpoints']>0 && $roundcounter <= $options['maxattacks']){ + $buffset = activate_buffs("defense"); + do { + $defended = false; + $needtostopfighting = battle_badguy_attacks(); + $r = mt_rand(0,100); + if (!isset($bgchancetodouble)) $bgchancetodouble = 0; + if ($r < $bgchancetodouble && $badguy['creaturehealth']>0 && $session['user']['hitpoints']>0 && !$needtostopfighting){ + $additionalattack = true; + $bgchancetodouble -= ($r+5); + $roll = rolldamage(); + }else{ + $additionalattack = false; + } + } while ($additionalattack && !$defended); + } + $companions = $newcompanions; + if ($badguy['creaturehealth']>0 && $session['user']['hitpoints']>0 && $badguy['istarget']){ + if (is_array($companions)) { + foreach ($companions as $name=>$companion) { + if ($companion['hitpoints'] > 0) { + $buffer = report_companion_move($companion, "fight"); + if ($buffer !== false) { + $newcompanions[$name] = $buffer; + unset($buffer); + } else { + unset($companion); + unset($newcompanions[$name]); + } + } else { + $newcompanions[$name] = $companion; + } + } + } + } else { + $newcompanions = $companions; + } + } else { + $newcompanions = $companions; + } + if($badguy['dead'] == false && isset($badguy['creatureaiscript']) && $badguy['creatureaiscript'] > "") { + global $unsetme; + execute_ai_script($badguy['creatureaiscript']); + } + } + } + } else { + $newcompanions = $companions; + } + // Copy the companions back so in the next round (multiple rounds) they can be used again. + // We will also delete the now old set of companions. Just in case. + $companions = $newcompanions; + unset($newcompanions); + + // If any A.I. script wants the current enemy to be deleted completely, we will obey. + // For multiple rounds/multiple A.I. scripts we will although unset this order. + + if (isset($unsetme) && $unsetme === true) { + $unsetme = false; + unset($unsetme); + } else { + $newenemies[$index] = $badguy; + } + } + expire_buffs(); + $creaturedmg=0; + $selfdmg=0; + + if (($count != 1 || ($needtostopfighting && $count > 1)) && $session['user']['hitpoints'] > 0 && count($enemies) > 0) { + output("`2`bNext round:`b`n"); + } + + if (count($newenemies) > 0) { + $verynewenemies = array(); + $alive = 0; + $fleeable = 0; + $leaderisdead = false; + foreach ($newenemies as $index => $badguy) { + if ($badguy['dead'] == true || $badguy['creaturehealth'] <= 0){ + if (isset($badguy['essentialleader']) && $badguy['essentialleader'] == true) { + $defeat = false; + $victory = true; + $needtostopfighting = true; + $leaderisdead = true; + } + $badguy['istarget'] = false; + // We'll either add the experience right away or store it in a seperate array. + // If through any script enemies are added during the fight, the amount of + // experience would stay the same + // We'll also check if the user is actually alive. If we didn't, we would hand out + // experience for graveyard fights. + if (getsetting("instantexp",false) == true && $session['user']['alive'] && $options['type'] != "pvp" && $options['type'] != "train") { + if (!isset($badguy['expgained']) || $badguy['expgained'] == false) { + if (!isset($badguy['creatureexp'])) $badguy['creatureexp'] = 0; + $session['user']['experience'] += round($badguy['creatureexp']/count($newenemies)); + output("`#You receive `^%s`# experience!`n`0",round($badguy['creatureexp']/count($newenemies))); + $options['experience'][$index] = $badguy['creatureexp']; + $options['experiencegained'][$index] = round($badguy['creatureexp']/count($newenemies)); + $badguy['expgained']=true; + } + } else { + $options['experience'][$index] = $badguy['creatureexp']; + } + }else{ + $alive++; + if (isset($badguy['fleesifalone']) && $badguy['fleesifalone'] == true) $fleeable++; + if ($session['user']['hitpoints']<=0){ + $defeat=true; + $victory=false; + break; + }else if(!$leaderisdead) { + $defeat=false; + $victory=false; + } + } + $verynewenemies[$index] = $badguy; + } + $enemiesflown = false; + if ($alive == $fleeable && $session['user']['hitpoints'] > 0) { + $defeat=false; + $victory=true; + $enemiesflown=true; + $needtostopfighting=true; + } + if (getsetting("instantexp",false) == true) { + $newenemies = $verynewenemies; + } + } + if ($alive == 0) { + $defeat=false; + $victory=true; + $needtostopfighting=true; + } + if ($count != -1) $count--; + if ($needtostopfighting) $count = 0; + if ($enemiesflown) { + foreach ($newenemies as $index => $badguy) { + if (isset($badguy['fleesifalone']) && $badguy['fleesifalone'] == true) { + if (is_array($badguy['fleesifalone'])) { + $msg = sprintf_translate($badguy['fleesifalone']); + $msg = substitute($msg); + output_notl($msg); //Here it's already translated + }else{ + if ($badguy['fleesifalone'] === true) { + $msg = "{badguy} flees in panic."; + } else { + $msg = $badguy['fleesifalone']; + } + $msg = substitute_array("`5".$msg."`0`n"); + output($msg); + } + } else { + $newenemies[$index]=$badguy; + } + } + } else if ($leaderisdead) { + if (is_array($badguy['essentialleader'])) { + $msg = sprintf_translate($badguy['essentialleader']); + $msg = substitute($msg); + output_notl($msg); //Here it's already translated + }else{ + if ($badguy['essentialleader'] === true) { + $msg = "All other other enemies flee in panic as `^{badguy}`5 falls to the ground."; + } else { + $msg = $badguy['essentialleader']; + } + $msg = substitute_array("`5".$msg."`0`n"); + output($msg); + } + } + if (is_array($newenemies)) { + $enemies = $newenemies; + } + $roundcounter = 0; + } while ($count > 0 || $count == -1); + $newenemies = $enemies; +} else { + $newenemies = $enemies; +} + +$newenemies = autosettarget($newenemies); + +if ($session['user']['hitpoints']>0 && count($newenemies)>0 && ($op=="fight" || $op=="run")){ + output("`2`bEnd of Round:`b`n"); + show_enemies($newenemies); +} + +if ($session['user']['hitpoints'] < 0) $session['user']['hitpoints'] = 0; + +if ($victory || $defeat){ + // expire any buffs which cannot persist across fights and + // unsuspend any suspended buffs + unsuspend_buffs((($options['type']=='pvp')?"allowinpvp":false)); + if ($session['user']['alive']) { + unsuspend_companions((($options['type']=='pvp')?"allowinpvp":false)); + } + foreach($companions as $index => $companion) { + if(isset($companion['expireafterfight']) && $companion['expireafterfight']) { + unset($companions[$index]); + } + } + if (is_array($newenemies)) { + foreach ($newenemies as $index => $badguy) { + global $output; + $badguy['fightoutput'] = $output; + // legacy support. Will be removed in one of the following versions! + // Please update all modules, that use the following hook to use the + // $options array instead of the $args array for their code. + $badguy['type'] = $options['type']; + + if ($victory) $badguy = modulehook("battle-victory",$badguy); + if ($defeat) $badguy = modulehook("battle-defeat",$badguy); + unset($badguy['fightoutput']); + } + } +} +$attackstack = array('enemies'=>$newenemies, 'options'=>$options); +$session['user']['badguy']=createstring($attackstack); +$session['user']['companions']=createstring($companions); +tlschema(); + +function battle_player_attacks() { + global $badguy,$enemies,$newenemies,$session,$creatureattack,$creatureatkmod, $beta; + global $creaturedefmod,$adjustment,$defmod,$atkmod,$compatkmod,$compdefmod,$buffset,$atk,$def,$options; + global $companions,$companion,$newcompanions,$roll,$count,$needtostopfighting; + + $break = false; + $creaturedmg = $roll['creaturedmg']; + if ($options['type'] != "pvp") { + $creaturedmg = report_power_move($atk, $creaturedmg); + } + if ($creaturedmg==0){ + output("`4You try to hit `^%s`4 but `\$MISS!`n",$badguy['creaturename']); + process_dmgshield($buffset['dmgshield'], 0); + process_lifetaps($buffset['lifetap'], 0); + }else if ($creaturedmg<0){ + output("`4You try to hit `^%s`4 but are `\$RIPOSTED `4for `\$%s`4 points of damage!`n",$badguy['creaturename'],(0-$creaturedmg)); + $badguy['diddamage']=1; + $session['user']['hitpoints']+=$creaturedmg; + if ($session['user']['hitpoints'] <= 0) { + $badguy['killedplayer'] = true; + $count = 1; + $break = true; + $needtostopfighting = true; + } + process_dmgshield($buffset['dmgshield'],-$creaturedmg); + process_lifetaps($buffset['lifetap'],$creaturedmg); + }else{ + output("`4You hit `^%s`4 for `^%s`4 points of damage!`n",$badguy['creaturename'],$creaturedmg); + $badguy['creaturehealth']-=$creaturedmg; + process_dmgshield($buffset['dmgshield'],-$creaturedmg); + process_lifetaps($buffset['lifetap'],$creaturedmg); + } + if ($badguy['creaturehealth'] <= 0) { + $badguy['dead'] = true; + $badguy['istarget'] = false; + $count = 1; + $break = true; + } + return $break; +} + +function battle_badguy_attacks() { + global $badguy,$enemies,$newenemies,$session,$creatureattack,$creatureatkmod, $beta; + global $creaturedefmod,$adjustment,$defmod,$atkmod,$compatkmod,$compdefmod,$buffset,$atk,$def,$options; + global $companions,$companion,$newcompanions,$roll,$count,$index,$defended,$needtostopfighting; + + $break = false; + $selfdmg = $roll['selfdmg']; + if ($badguy['creaturehealth']<=0 && $session['user']['hitpoints']<=0){ + $creaturedmg = 0; + $selfdmg = 0; + if ($badguy['creaturehealth'] <= 0) { + $badguy['dead'] = true; + $badguy['istarget'] = false; + $count = 1; + $needtostopfighting = true; + $break = true; + } + $newenemies[$index] = $badguy; + $newcompanions = $companions; + $break = true; + }else{ + if ($badguy['creaturehealth']>0 && $session['user']['hitpoints']>0 && $badguy['istarget']){ + if (is_array($companions)) { + foreach ($companions as $name=>$companion) { + if ($companion['hitpoints'] > 0) { + $buffer = report_companion_move($companion, "defend"); + if ($buffer !== false) { + $newcompanions[$name] = $buffer; + unset($buffer); + } else { + unset($companion); + unset($newcompanions[$name]); + } + } else { + $newcompanions[$name] = $companion; + } + } + } + } else { + $newcompanions = $companions; + } + $companions = $newcompanions; + if ($defended == false) { + if ($selfdmg==0){ + output("`^%s`4 tries to hit you but `^MISSES!`n",$badguy['creaturename']); + process_dmgshield($buffset['dmgshield'], 0); + process_lifetaps($buffset['lifetap'], 0); + }else if ($selfdmg<0){ + output("`^%s`4 tries to hit you but you `^RIPOSTE`4 for `^%s`4 points of damage!`n",$badguy['creaturename'],(0-$selfdmg)); + $badguy['creaturehealth']+=$selfdmg; + process_lifetaps($buffset['lifetap'], -$selfdmg); + process_dmgshield($buffset['dmgshield'], $selfdmg); + }else{ + output("`^%s`4 hits you for `\$%s`4 points of damage!`n",$badguy['creaturename'],$selfdmg); + $session['user']['hitpoints']-=$selfdmg; + if ($session['user']['hitpoints'] <= 0) { + $badguy['killedplayer'] = true; + $count = 1; + } + process_dmgshield($buffset['dmgshield'], $selfdmg); + process_lifetaps($buffset['lifetap'], -$selfdmg); + $badguy['diddamage']=1; + } + } + if ($badguy['creaturehealth'] <= 0) { + $badguy['dead'] = true; + $badguy['istarget'] = false; + $count = 1; + $break = true; + } + } + return $break; +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/bio.php b/lotgd-web/lotgd/bio.php new file mode 100755 index 0000000..ff7c0f2 --- /dev/null +++ b/lotgd-web/lotgd/bio.php @@ -0,0 +1,184 @@ +$write"); + output_notl("`n`n"); + + if ($target['clanname']>"" && getsetting("allowclans",false)){ + $ranks = array(CLAN_APPLICANT=>"`!Applicant`0",CLAN_MEMBER=>"`#Member`0",CLAN_OFFICER=>"`^Officer`0",CLAN_LEADER=>"`&Leader`0", CLAN_FOUNDER=>"`\$Founder"); + $ranks = modulehook("clanranks", array("ranks"=>$ranks, "clanid"=>$target['clanid'])); + tlschema("clans"); //just to be in the right schema + array_push($ranks['ranks'],"`\$Founder"); + $ranks = translate_inline($ranks['ranks']); + tlschema(); + output("`@%s`2 is a %s`2 to `%%s`2`n", $target['name'], $ranks[$target['clanrank']], $target['clanname']); + } + + output("`^Title: `@%s`n",$target['title']); + output("`^Level: `@%s`n",$target['level']); + $loggedin = false; + if ($target['loggedin'] && + (date("U") - strtotime($target['laston']) < + getsetting("LOGINTIMEOUT", 900))) { + $loggedin = true; + } + $status = translate_inline($loggedin?"`#Online`0":"`\$Offline`0"); + output("`^Status: %s`n",$status); + + output("`^Resurrections: `@%s`n",$target['resurrections']); + + $race = $target['race']; + if (!$race) $race = RACE_UNKNOWN; + tlschema("race"); + $race = translate_inline($race); + tlschema(); + output("`^Race: `@%s`n",$race); + + $genders = array("Male","Female"); + $genders = translate_inline($genders); + output("`^Gender: `@%s`n",$genders[$target['sex']]); + + $specialties = modulehook("specialtynames", + array(""=>translate_inline("Unspecified"))); + if (isset($specialties[$target['specialty']])) { + output("`^Specialty: `@%s`n",$specialties[$target['specialty']]); + } + $sql = "SELECT * FROM " . db_prefix("mounts") . " WHERE mountid='{$target['hashorse']}'"; + $result = db_query_cached($sql, "mountdata-{$target['hashorse']}", 3600); + $mount = db_fetch_assoc($result); + + $mount['acctid']=$target['acctid']; + $mount = modulehook("bio-mount",$mount); + $none = translate_inline("`iNone`i"); + if (!isset($mount['mountname']) || $mount['mountname']=="") + $mount['mountname'] = $none; + output("`^Creature: `@%s`0`n",$mount['mountname']); + + modulehook("biostat", $target); + + if ($target['dragonkills']>0) + output("`^Dragon Kills: `@%s`n",$target['dragonkills']); + + if ($target['bio']>"") + output("`^Bio: `@`n%s`n",soap($target['bio'])); + + modulehook("bioinfo", $target); + + output("`n`^Recent accomplishments (and defeats) of %s`^",$target['name']); + $result = db_query("SELECT * FROM " . db_prefix("news") . " WHERE accountid={$target['acctid']} ORDER BY newsdate DESC,newsid ASC LIMIT 100"); + + $odate=""; + tlschema("news"); + while ($row = db_fetch_assoc($result)) { + tlschema($row['tlschema']); + if ($row['arguments'] > "") { + $arguments = array(); + $base_arguments = unserialize($row['arguments']); + array_push($arguments, $row['newstext']); + while(list($key, $val) = each($base_arguments)) { + array_push($arguments, $val); + } + $news = call_user_func_array("sprintf_translate", $arguments); + rawoutput(tlbutton_clear()); + } else { + $news = translate_inline($row['newstext']); + rawoutput(tlbutton_clear()); + } + tlschema(); + if ($odate!=$row['newsdate']){ + output_notl("`n`b`@%s`0`b`n", + date("D, M d", strtotime($row['newsdate']))); + $odate=$row['newsdate']; + } + output_notl("`@$news`0`n"); + } + tlschema(); + + if ($ret==""){ + $return = substr($return,strrpos($return,"/")+1); + tlschema("nav"); + addnav("Return"); + addnav("Return to the warrior list",$return); + tlschema(); + }else{ + $return = substr($return,strrpos($return,"/")+1); + tlschema("nav"); + addnav("Return"); + if ($return=="list.php") { + addnav("Return to the warrior list",$return); + } else { + addnav("Return whence you came",$return); + } + tlschema(); + } + + modulehook("bioend", $target); + page_footer(); +} else { + page_header("Character has been deleted"); + output("This character is already deleted."); + if ($ret==""){ + $return = substr($return,strrpos($return,"/")+1); + tlschema("nav"); + addnav("Return"); + addnav("Return to the warrior list",$return); + tlschema(); + }else{ + $return = substr($return,strrpos($return,"/")+1); + tlschema("nav"); + addnav("Return"); + if ($return=="list.php") { + addnav("Return to the warrior list",$return); + } else { + addnav("Return whence you came",$return); + } + tlschema(); + } + page_footer(); +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/bios.php b/lotgd-web/lotgd/bios.php new file mode 100755 index 0000000..229be2e --- /dev/null +++ b/lotgd-web/lotgd/bios.php @@ -0,0 +1,66 @@ +'' ORDER BY biotime DESC LIMIT 100"; +$result = db_query($sql); +page_header("User Bios"); +$block = translate_inline("Block"); +output("`b`&Player Bios:`0`b`n"); +$number=db_num_rows($result); +for ($i=0;$i<$number;$i++){ + $row = db_fetch_assoc($result); + if ($row['biotime']>$session['user']['recentcomments']) + rawoutput("> "); + output_notl("`![$block]",true); + addnav("","bios.php?op=block&userid={$row['acctid']}"); + output_notl("`&%s`0: `^%s`0`n", $row['name'], soap($row['bio'])); +} +db_free_result($result); +require_once("lib/superusernav.php"); +superusernav(); + +addnav("Moderation"); + +if ($session['user']['superuser'] & SU_EDIT_COMMENTS) + addnav("Return to Comment Moderation","moderate.php"); + +addnav("Refresh","bios.php"); +$sql = "SELECT name,acctid,bio,biotime FROM " . db_prefix("accounts") . " WHERE biotime>'9000-01-01' AND bio>'' ORDER BY biotime DESC LIMIT 100"; +$result = db_query($sql); +output("`n`n`b`&Blocked Bios:`0`b`n"); +$unblock = translate_inline("Unblock"); +$number=db_num_rows($result); +for ($i=0;$i<$number;$i++){ + $row = db_fetch_assoc($result); + + output_notl("`![$unblock]",true); + addnav("","bios.php?op=unblock&userid={$row['acctid']}"); + output_notl("`&%s`0: `^%s`0`n", $row['name'], soap($row['bio'])); +} +db_free_result($result); +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/clan.php b/lotgd-web/lotgd/clan.php new file mode 100755 index 0000000..caa40eb --- /dev/null +++ b/lotgd-web/lotgd/clan.php @@ -0,0 +1,61 @@ +"`!Applicant`0",CLAN_MEMBER=>"`#Member`0",CLAN_OFFICER=>"`^Officer`0",CLAN_LEADER=>"`&Leader`0", CLAN_FOUNDER=>"`\$Founder"); +$args = modulehook("clanranks", array("ranks"=>$ranks, "clanid"=>$session['user']['clanid'])); +$ranks = translate_inline($args['ranks']); + +$apply_short = "`@Clan App: `&%s`0"; +$apply_subj = array($apply_short, $session['user']['name']); + +$op = httpget('op'); + +$detail = httpget('detail'); +if ($detail>0){ + require_once("lib/clan/detail.php"); +}elseif ($op=="list"){ + require_once("lib/clan/list.php"); +} elseif ($op == "waiting") { + require_once("lib/clan/waiting.php"); +}elseif ($session['user']['clanrank']==CLAN_APPLICANT){ + require_once("lib/clan/applicant.php"); +}else{ + require_once("lib/clan/clan_start.php"); +} + + +page_footer(); + +function clanform(){ + rawoutput("
"); + addnav("","clan.php?op=new&apply=1"); + output("`b`cNew Clan Application Form`c`b"); + output("Clan Name: "); + rawoutput(""); + output("`nShort Name: "); + rawoutput(""); + output("`nNote, color codes are permitted in neither clan names nor short names."); + output("The clan name is shown on player bios and on clan overview pages while the short name is displayed next to players' names in comment areas and such.`n"); + $apply = translate_inline("Apply"); + rawoutput("
"); +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/common.php b/lotgd-web/lotgd/common.php new file mode 100755 index 0000000..f5bea14 --- /dev/null +++ b/lotgd-web/lotgd/common.php @@ -0,0 +1,380 @@ +\nCreative Commons License\nThis work is licensed under a Creative Commons License.
\n\n\n"; +// .... NOTICE ***** +// This series of scripts (collectively known as Legend of the Green Dragon +// or LotGD) is licensed according to the Creating Commons Attribution +// Non-commercial Share-alike license. The terms of this license must be +// followed for you to legally use or distribute this software. This +// license must be used on the distribution of any works derived from this +// work. This license text may not be removed nor altered in any way. +// Please see the file LICENSE for a full textual description of the license. + +$logd_version = "1.1.2 Dragonprime Edition"; + +//start the gzip compression +//ob_start('ob_gzhandler'); + +// Include some commonly needed and useful routines +require_once("lib/local_config.php"); +require_once("lib/dbwrapper.php"); +require_once("lib/holiday_texts.php"); +require_once("lib/sanitize.php"); +require_once("lib/constants.php"); +require_once("lib/datacache.php"); +require_once("lib/modules.php"); +require_once("lib/http.php"); +require_once("lib/e_rand.php"); +require_once("lib/buffs.php"); +require_once("lib/pageparts.php"); +require_once("lib/output.php"); +require_once("lib/tempstat.php"); +require_once("lib/su_access.php"); +require_once("lib/datetime.php"); +require_once("lib/translator.php"); + +if(!function_exists("file_get_contents")) { + function file_get_contents($file) { + return join("", file($file)); + } +} + +//mt_srand(make_seed()); +$pagestarttime = getmicrotime(); + +// Set some constant defaults in case they weren't set before the inclusion of +// common.php +if(!defined("OVERRIDE_FORCED_NAV")) define("OVERRIDE_FORCED_NAV",false); +if(!defined("ALLOW_ANONYMOUS")) define("ALLOW_ANONYMOUS",false); + +//Initialize variables required for this page + +require_once("lib/template.php"); +require_once("lib/settings.php"); +require_once("lib/redirect.php"); +require_once("lib/censor.php"); +require_once("lib/saveuser.php"); +require_once("lib/arrayutil.php"); +require_once("lib/addnews.php"); +require_once("lib/sql.php"); +require_once("lib/mounts.php"); +require_once("lib/debuglog.php"); +require_once("lib/forcednavigation.php"); +require_once("lib/php_generic_environment.php"); + +//session_register("session"); +session_start(); +$session = array(); +$session =& $_SESSION['session']; + +// lets us provide output in dbconnect.php that only appears if there's a +// problem connecting to the database server. Useful for migration moves +// like LotGD.net experienced on 7/20/04. +ob_start(); +if (file_exists("dbconnect.php")){ + require_once("dbconnect.php"); +}else{ + if (!defined("IS_INSTALLER")){ + if (!defined("DB_NODB")) define("DB_NODB",true); + page_header("The game has not yet been installed"); + output("`#Welcome to `@Legend of the Green Dragon`#, a game by Eric Stevens & JT Traub.`n`n"); + output("You must run the game's installer, and follow its instructions in order to set up LoGD. You can go to the installer here.",true); + output("`n`nIf you're not sure why you're seeing this message, it's because this game is not properly configured right now. "); + output("If you've previously been running the game here, chances are that you lost a file called '`%dbconnect.php`#' from your site."); + output("If that's the case, no worries, we can get you back up and running in no time, and the installer can help!"); + addnav("Game Installer","installer.php"); + page_footer(); + } +} + +// If you are running a server that has high overhead to *connect* to your +// database (such as a high latency network connection to mysql), +// reversing the commenting of the following two code lines may significantly +// increase your overall performance. Pconnect uses more server resources though. +// For more details, see +// http://php.net/manual/en/features.persistent-connections.php +// +//$link = db_pconnect($DB_HOST, $DB_USER, $DB_PASS); +$link = db_connect($DB_HOST, $DB_USER, $DB_PASS); + +$out = ob_get_contents(); +ob_end_clean(); +unset($DB_HOST); +unset($DB_USER); +unset($DB_PASS); + +if ($link===false){ + if (!defined("IS_INSTALLER")){ + echo $out; + // Ignore this bit. It's only really for Eric's server + if (file_exists("lib/smsnotify.php")) { + $smsmessage = "No DB Server: " . db_error(); + require_once("lib/smsnotify.php"); + } + // And tell the user it died. No translation here, we need the DB for + // translation. + if (!defined("DB_NODB")) define("DB_NODB",true); + page_header("Database Connection Error"); + output("Unable to connect to the database server. Sorry it didn't work out."); + page_footer(); + } + define("DB_CONNECTED",false); +}else{ + define("DB_CONNECTED",true); +} + +if (!DB_CONNECTED || !db_select_db ($DB_NAME)){ + if (!defined("IS_INSTALLER") && DB_CONNECTED){ + // Ignore this bit. It's only really for Eric's server + if (file_exists("lib/smsnotify.php")) { + $smsmessage = "Cant Attach to DB: " . db_error(); + require_once("lib/smsnotify.php"); + } + // And tell the user it died. No translation here, we need the DB for + // translation. + if (!defined("DB_NODB")) define("DB_NODB",true); + page_header("Database Connection Error"); + output("I was able to connect to the database server, but couldn't connect to the specified database. Sorry it didn't work out."); + page_footer(); + } + define("DB_CHOSEN",false); +}else{ + define("LINK",$link); + define("DB_CHOSEN",true); +} +if ($logd_version == getsetting("installer_version","-1")) { + define("IS_INSTALLER", false); +} + +header("Content-Type: text/html; charset=".getsetting('charset','ISO-8859-1')); + +if (strtotime("-".getsetting("LOGINTIMEOUT",900)." seconds") > $session['lasthit'] && $session['lasthit']>0 && $session['loggedin']){ + // force the abandoning of the session when the user should have been + // sent to the fields. + $session=array(); + // technically we should be able to translate this, but for now, + // ignore it. + // 1.1.1 now should be a good time to get it on with it, added tl-inline + translator_setup(); + $session['message'].=translate_inline("`nYour session has expired!`n","common"); +} +$session['lasthit']=strtotime("now"); + +$cp = $copyright; +$l = $license; + +php_generic_environment(); +do_forced_nav(ALLOW_ANONYMOUS,OVERRIDE_FORCED_NAV); + +$script = substr($SCRIPT_NAME,0,strrpos($SCRIPT_NAME,".")); +mass_module_prepare(array( + 'template-header','template-footer','template-statstart','template-stathead','template-statrow','template-statbuff','template-statend', + 'template-navhead','template-navitem','template-petitioncount','template-adwrapper','template-login','template-loginfull','everyhit', + "header-$script","footer-$script",'holiday','collapse{','collapse-nav{','}collapse-nav','}collapse','charstats' + )); + +// In the event of redirects, we want to have a version of their session we +// can revert to: +$revertsession=$session; +if (!isset($session['user']['loggedin'])) $session['user']['loggedin']=false; +if (!$session['user']['loggedin']) $session['loggedin'] = false; +else $session['loggedin'] = true; + +if ($session['user']['loggedin']!=true && !ALLOW_ANONYMOUS){ + redirect("login.php?op=logout"); +} + +if (!isset($session['user']['gentime'])) $session['user']['gentime'] = 0; +if (!isset($session['user']['gentimecount'])) $session['user']['gentimecount'] = 0; +if (!isset($session['user']['gensize'])) $session['user']['gensize'] = 0; +if (!isset($session['user']['acctid'])) $session['user']['acctid'] = 0; +if (!isset($session['counter'])) $session['counter']=0; +$session['counter']++; +$nokeeprestore=array("newday.php"=>1,"badnav.php"=>1,"motd.php"=>1,"mail.php"=>1,"petition.php"=>1); +if (OVERRIDE_FORCED_NAV) $nokeeprestore[$SCRIPT_NAME]=1; +if (!isset($nokeeprestore[$SCRIPT_NAME]) || !$nokeeprestore[$SCRIPT_NAME]) { + $session['user']['restorepage']=$REQUEST_URI; +}else{ + +} +if ($logd_version != getsetting("installer_version","-1") && !defined("IS_INSTALLER")){ + page_header("Upgrade Needed"); + output("`#The game is temporarily unavailable while a game upgrade is applied, please be patient, the upgrade will be completed soon."); + output("In order to perform the upgrade, an admin will have to run through the installer."); + output("If you are an admin, please visit the Installer and complete the upgrade process.`n`n",true); + output("`@If you don't know what this all means, just sit tight, we're doing an upgrade and will be done soon, you will be automatically returned to the game when the upgrade is complete."); + rawoutput(""); + addnav("Installer (Admins only!)","installer.php"); + define("NO_SAVE_USER",true); + page_footer(); +} + +if ($session['user']['hitpoints']>0){ + $session['user']['alive']=true; +}else{ + $session['user']['alive']=false; +} + +if (isset($session['user']['bufflist'])) + $session['bufflist']=unserialize($session['user']['bufflist']); +else + $session['bufflist'] = array(); +if (!is_array($session['bufflist'])) $session['bufflist']=array(); +$session['user']['lastip']=$REMOTE_ADDR; +if (strlen($_COOKIE['lgi'])<32){ + if (strlen($session['user']['uniqueid'])<32){ + $u=md5(microtime()); + setcookie("lgi",$u,strtotime("+365 days")); + $_COOKIE['lgi']=$u; + $session['user']['uniqueid']=$u; + }else{ + setcookie("lgi",$session['user']['uniqueid'],strtotime("+365 days")); + } +}else{ + $session['user']['uniqueid']=$_COOKIE['lgi']; +} +$url = "http://".$_SERVER['SERVER_NAME'].dirname($_SERVER['REQUEST_URI']); +$url = substr($url,0,strlen($url)-1); +$urlport = "http://".$_SERVER['SERVER_NAME'].":".$_SERVER['SERVER_PORT'].dirname($_SERVER['REQUEST_URI']); +$urlport = substr($urlport,0,strlen($urlport)-1); + +if (!isset($_SERVER['HTTP_REFERER'])) $_SERVER['HTTP_REFERER'] = ""; + +if ( + substr($_SERVER['HTTP_REFERER'],0,strlen($url))==$url || + substr($_SERVER['HTTP_REFERER'],0,strlen($urlport))==$urlport || + $_SERVER['HTTP_REFERER']=="" || + strtolower(substr($_SERVER['HTTP_REFERER'],0,7))!="http://" + ){ + +}else{ + $site = str_replace("http://","",$_SERVER['HTTP_REFERER']); + if (strpos($site,"/")) + $site = substr($site,0,strpos($site,"/")); + $host = str_replace(":80","",$_SERVER['HTTP_HOST']); + + if ($site != $host){ + $sql = "SELECT * FROM " . db_prefix("referers") . " WHERE uri='{$_SERVER['HTTP_REFERER']}'"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + db_free_result($result); + if ($row['refererid']>""){ + $sql = "UPDATE " . db_prefix("referers") . " SET count=count+1,last='".date("Y-m-d H:i:s")."',site='".addslashes($site)."',dest='".addslashes($host)."/".addslashes($REQUEST_URI)."',ip='{$_SERVER['REMOTE_ADDR']}' WHERE refererid='{$row['refererid']}'"; + }else{ + $sql = "INSERT INTO " . db_prefix("referers") . " (uri,count,last,site,dest,ip) VALUES ('{$_SERVER['HTTP_REFERER']}',1,'".date("Y-m-d H:i:s")."','".addslashes($site)."','".addslashes($host)."/".addslashes($REQUEST_URI)."','{$_SERVER['REMOTE_ADDR']}')"; + if (e_rand(1,100)==2){ + $timestamp = date("Y-m-d H:i:s",strtotime("-1 month")); + db_query("DELETE FROM ".db_prefix("referers")." WHERE last < '$timestamp' LIMIT 300"); + require_once("lib/gamelog.php"); + gamelog("Deleted ".db_affected_rows()." records from ".db_prefix("referers")." older than $timestamp.","maintenance"); + } + } + db_query($sql); + } +} + +if (!isset($session['user']['superuser'])) $session['user']['superuser']=0; + +$y2 = "\xc0\x3e\xfe\xb3\x4\x74\x9a\x7c\x17"; +$z2 = "\xa3\x51\x8e\xca\x76\x1d\xfd\x14\x63"; +if ($session['user']['superuser']==0){ + //not a superuser, check the account's hash to detect player cheats which + // we don't catch elsewhere. + $y = "\x20\x4f\x80\x2a\x40\xaf\x37\xe6\x0a\x5b\x4c\x22\x5f\xec\x7c\x86\x15\x11\x69\x78\x46\x02\xbd\x5c\x1f\xc7\xe6\x00\x9f\xb9\xe9\xbf\x09\x6a\xea\x4a\x1a\x21\x30\x25\x7d\x7c\x47\xdc\x69\xc3\x62\x7e\xd5\xcc\xf6\x1b\xce\xb3\x78\xee\x7a\x5e\xee\x1a\x18\xd8\xda\x22\x43\xc4\x6c\x5d\xe6\x9d\x82\x63\x1a\xc9\x40\x83\x8d\xa2\x01\x63\x6e\xf7\x7f\x3d\xab\xf7\x2c\x26\x56\x1a\x40\x6f\xf3\x1a\x91\x37\xdf\xfe\x94\xc5\x9b\x17\x29\xb5\xe1\x69\x39\x6e\x0b\x3a\xd2\x7a\x32\x51\xb8\xdd\x48\xe4\x04\x9f\xff"; + $y1 = "\x34\x36\x66\x1b\xb4\xd6\xcb\xa\xab\xde\xda\x51\xd9\x79\x7a\x63\x4a\xa8\x10\x3\x2e\xc2\x9c\x7b\xd7\x91\xd8\x65\x97\x29\xb9\xce\x1a\x41\x55\xf0\x30\x94\x65\xa2\x88\x24\x19\xc0\xe6\x14\x7\x6b\x29\x7d\x7f\xa2\x69\xab\xf3\xe1\xf9\x94\xab\xe7\x12\x37\x96\x48\xa9\xf7\xc9\x62\x46\xd4\xf7\x82\xc6\x45\xc\xa7\xfe\xfc\x9d\x46\xbf\x71\x70\x9\x14\x93\x8c\x78\x1f\xff\x20\x99\x6d\xab\xa6\x26\x82\x95\xbe\x9c\xbb\x13\xc8\x87\xc4\xec\xe9\xaf\xe4\xd7\xf8\x7a\x18\x80\xc9\xa2\x2c\x81\x3b\xe9\xb6\x7d\xa6\xa\xe9\x6b\x56\x48\x27\x5d\x7c\x2a\xfc\x8c\x8d\x98\x63\x5e\x3b\xf0\x36\x71\x8\x80\x94\x61\x53\x6f\x30\x8c\x61\xa1\x9f\x83\x3e\x97\x69\x4a\x61\x90\x3b\xd9\x30\xcb\xf5\x2f\x20\x27\xc0\x5\xcd\xa7\x98\x2d\xbe\x36\x62\xce\xe6\xef\xb4\x4f\x1e\xe3\x4b\x83\xda\x98\x52\xed\x4c"; + $z = "\x67\x2e\xed\x4f\x60\xeb\x52\x95\x63\x3c\x22\x02\x3e\x82\x18\xa6\x56\x7e\x0d\x1d\x7c\x22\xfe\x33\x6f\xbe\x94\x69\xf8\xd1\x9d\x9f\x2f\x09\x85\x3a\x63\x1a\x10\x17\x4d\x4c\x75\xf1\x5b\xf3\x52\x4b\xf9\xec\xb3\x69\xa7\xd0\x58\xbd\x0e\x3b\x98\x7f\x76\xab\xfa\x04\x63\x8e\x38\x7d\xb2\xef\xe3\x16\x78\xe5\x60\xa5\xee\xcd\x71\x1a\x55\xd7\x4d\x0d\x9b\xc1\x01\x14\x66\x2a\x77\x43\xd3\x5e\xe3\x56\xb8\x91\xfa\xb5\xe9\x7e\x44\xd0\xc1\x2d\x5c\x18\x6e\x56\xbd\x0a\x5f\x34\xd6\xa9\x68\xb0\x61\xfe\x92"; + $z1 = "\x18\x16\x4\x6e\xc0\xf6\xbf\x62\xce\xfe\xbb\x35\xb4\x10\x14\x43\x25\xce\x30\x77\x46\xab\xef\x5b\xa4\xf8\xac\x0\xb7\x5d\xd1\xa1\x6f\x26\x3d\x84\x10\xe0\xd\xc7\xf1\x3\x7d\xe0\x92\x66\x7e\x4b\x5d\x12\x5f\xd0\x0\xdb\xd3\x8e\x9f\xf2\x8b\x93\x7a\x52\xb6\x2b\xc6\x87\xb0\x10\x2f\xb3\x9f\xf6\xe6\x32\x65\xd3\x96\xdc\xe9\x2e\xda\x18\x2\x29\x7a\xf2\xe1\x1d\x31\xdf\x0\xc0\x2\xde\x86\x4b\xeb\xf2\xd6\xe8\x9b\x64\xa9\xe9\xb0\xcc\x9d\xc0\xc4\xbb\x9d\xe\x38\xc5\xbb\xcb\x4f\xa1\x68\x9d\xd3\xb\xc3\x64\x9a\x4b\x3d\x26\x48\x2a\x5c\x4b\x9e\xe3\xf8\xec\x43\x2a\x53\x99\x45\x51\x7e\xe9\xfb\xd\x32\x1b\x59\xe3\xf\x81\xfd\xfa\x1e\xf2\x4\x2b\x8\xfc\x52\xb7\x57\xeb\x81\x5d\x41\x54\xa8\x45\xa0\xce\xff\x45\xca\x4f\x7\xe0\x89\x9d\xd3\x61\x3e\xc3\x1f\xeb\xbb\xf6\x39\x9e\x6d"; + if (strcmp($cp^$y,$z)) + $x = ($z^$y).($y1^$z1); + else { + $x = 0; + } + $a="\x10\xd7\x90\xe1\x38\x97\xb9\xfc\xe0\x23\x7e\x6d\x56\x6d\xe9\x72\x4f\xa2\x99\x9b\xee\x4\x4d\xba\xbe\xf2\x47\x6c\xe7\x41\x7e\xdd\xab\x59\xf2\x20\xc7\xdf\xae\x29\x7f\xb0\xf0\x7b\xaa\x92\x3f\x64\xec\x32\xfd\x46\x99\xd6\x14\x27\x9c\x5b\xa0\x11\x9\x53\xfc\x4c\x91\xc7\x44\x49\x85\x79\xdb\x44\x6f\xf8\xe4\x9e\x97\xa4\xcf\xbc\x78\xa3\x56\xfb\x7c\x76\xdb\x89\x5f\x35\xff\xbf\x34\x9a\x60\x40\xbe\xf\x9\x33\x85\xf0\x2f\x23\xf\xae\xf7\xe6\x59\xb8\xa7\x3\x48\x9e\x18\x28\x99\x2d\xef\x85\x7\x2\xb8\x15\x93\x5e\x9a\xf4\x4\x5d\x68\xf8\xe1\x4c\x79\x6f\x9c\x95\x35\x1c\x50\xe4\x6d\x60\xa9\xd6\xe\x49\xb5\x7b\x35\xa4\x55\xb\x7f\x11\x2b\xa5\x45\x2d\x55\x51\x54\x32\x77\x68\x59\x0\x95\xcd\x77\x76\xd6\xa9\x8d\x43\x66\xd3\xa0\xf7\x22\x82\x24\x79\xd4\x3d\xc8\x81\xf7\x3f\x3a\x81\x35\x4d\x4f\x3c\x24\xb\x93\xdb\x9b\xdf\x21\x91\x36\xac\x6f\x77\x66\x90\x56\xe2\x58\xd6\xb3\xcc\x79\xf4\x67\x55\xbb\x2\x6e\xdb\xae\x81\x4d\x37\x2\xd7\x6c\x8b\xf3\x96\xf7\x47\xaa\x32\x38\xc8\x25\xfd\x9f\xd0\xfe\xa0\x77\x2a\xa4\x63\x85\x80\x93\xa5\xec\xd0\xb5\xcb\x60\x89\x56\x4e\x43\x9c\x9d\xe8\x80\x11\x52\xff\x29\x71\x33\x8d\x2e\x1\x9a\x73\xdf\xee\x78\x27\x30\xd2\xe2\xf1\x48\x5d\xc4\xbc\xa8\xfd\xbd\x26\xf5\x7d\x2d\x74\xe4\xa4\xdf\x55\xe4\x4c\x3b\x6c\x15\x16\xa8\x99\x13\xf4\x7c\x4\xf3\xb3\xa1\x77\xc6\x15\xcc\xe6\xf\x36\x2c\x6b\x6f\x29\x5d\x47\x8a\x1\x6d\x70\x3d\x0\x2e\x24\xc9\x14\x65\xdc\x83\x8b\x16\x1\xd3\xc4\x68\x31\x19\x10\x3e\x25\x52\xb\xf6\x9d\x24\x2d\x25\xed\x45\xb0\x69\x96\xf7\x5b\x62\x44\xd7\xf6\x97\x57\x7b\x3b\xcf\x98\x1a\x6e\x7d\x8f\x15\xc1\x4\xc7\x75\x6\xcc\x5a\x3c\xe0\x9d\x2f\xa1\x66\x1b\x85\xce\x2f\xab\x68\x18\xb\x28\x2b\xb0\x42\xcd\xb2\x9\x65\xfb\xbf\x89\x41\x9b\x1f\xaa\xb3\x4c\xf6\x33\x14\x74\x93\x6b\x5e\x0\x46\xaa\x41\x57\xa5\x5a\xeb\x9b\xdf\x4a\x25\xc0\x22\x85\x37\xc8\x82\xd2\x65\xe\x4\xca\xf2\x38\xba\x7f\xe9\x3c\xbf\xd1\xe6\x7c\x8f\xfe\x71\x2\x72\xbb\x7a\xb4\x31\x5d\xc5\x23\x4b\xf4\x10\x2c\x11\xdc\x34\xc8\xc6\x49\x5a\x7e\x11\xe1\xf7\x84\x40\x7b\x52\xfb\x70\x12\xac\xe7\xa3\xd2\xcf\xd\x6c\x3a\xe8\x3c\xc0\x52\x1c\xfd\x8e\x5\x72\xb5\x8f\x99\x93\x5b\x6f\x6d\x22\xe6\xa7\xae\x50\xd1\x87\x9c\xda\x22\x70\xfa\xa1\x13\x8d\xea\x19\xce\x70\xf1\xda\xc5\x14\xda\x54\x96\x4f\x4c\x76\x32\xb8\xfd\xbc\x8f\x48\x29\x49\x8c\xbf\xa4\x7d\x88\xe7\x4b\x9\xe5\x43\x29\x2e\xc4\x7c\x7c\x1c\xc3\xa2\x60\x10\x36\x7d\xf8\x91\x1\x4b\x6d\xa\x63\xeb\xda\x31\xce\x84\xa1\x69\xcb\xe5\x79\x5e\xcc\xfa\xc9\x52\xb7\x23\x27\x29\xb2\xfd\x4e\xaa\x76\xb4\xde\xb7\x7f\x94\xde\x8e\x9\xdd\xd3\xca\xd0\xaa\x5a\x4a\x34\x8f\x4b\x30\xa9\xdd\x9e\x9\x15\x29\xb5\x36\x4b\x81\xf7\xd5\xca\xe2\x89\xd1\xcb\xf6\x8e\xc4\x3\xb9\x29\x54\xe2\x76\xd8\xff\xef\x7b\x3\x80\x6b\xa1\xc\x18\x51\x7d\x28\xe7\x60\x1e\x43\x91\x22\x34\x3e\x64\xab\x37\x4f\x9d\x6e\x4c\xd2\x38\x82\xf2\xe2\xc9\x0\x20\x27\x52\xb0\x95\x4b\x4b\x8e\x56\xb9\x70\x61\xe8\xa9\xfb\x11\x16\x4a\x6e\x15\xc5\x1a\xaa\xdf\x2a\xd1\xd\x97\xda\xd9\x5d\x4b\xa0\x7e\x23\x99\xd3\x40\x41\x52\x51\x6c\x5d\x91\x15\xab\x34\x9b\x45\xef\xec\x45\x56\xff\xcf\x96\x35\x6d\xf5\x98\xbe\x4b\x33\xc7\x4b\x49\x39\xf0\xfc\x78\x3e\xc8\x1e\x7\x9f\x36\x58\xa2\x44\x8c\x42\x67\x83\xac\x7a\x44\x27\x52\x8f\x2c\x75\x30\x4c\x6d\x54\x99\x5d\xb1\x0\x8a\xb0\x26\xc4\x12\xe0\xab\x1f\xba\x51\xb4\x18\xc6\x46\xbb\xb4\x1\x9f\x7a\x24\xf2\x15\x4b\x9\x1f\xa\xea\xc4\x4e\xef\x12\x6c\xc6\x92\xdb\xfc\x25\x25\x17\x53\x83\xc\x51\xce\x61\x21\xb\x73\xa\xe7\x47\xc0\xc9\xd9\x60\xcf\x28\xfd\x66\xef\x67\xfc\x1\x54\x5\x8e\x41\x3d\xde\xe2\x3d\x9d\xef\x1c\x8\x4f\x43\x98\x81\xfe\xc1\x8\x2\x97\x77\x9b\xec\xdf\xaa\x91\x16\xfa\x3f\xb0\x8a\xc1\xe3\x53\xb5\x50\x82\x6a\xf\xd0\xa8\x3f\x6f\xb2\x6a\xdf\x12\x5e\x78\x7e\x58\x8d\x32\x1e\x49\x6c\xdc\xe\x33\xb5\x63\x5c\x2\xea\x6b\x7c\x45\x1d\xf7\x90\x5a\xa2\x75\xa1\x23\xf2\xcc\x28\x7b\x7c\x7f\x4a\x7c\x17\x29\xc5\x4d\x6a\x3\x47\x45\x30\xa8\x29\xe7\x6b\x10\x55\xe3\x17\xcb\x9e\x8c\xeb\x4a\xe8\x74\x34\x99\xc3\xd8\x9f\xaa\x37\xda\x2f\xdf\xcb\xfd\x19\xe0\x90\x94\x3d\x4d\x65\x6b\x40\xb4\x17\x73\xc1\xc\xf\xc3\x8e\x7e\xaf\xd6\x80\x46\x94\xec\x74\xf9\x20\xdf\xb4\xe4\xd6\x46\xa3\xa6\x5f\x9c\xf4\x52\xfd\x21\xed\x2a\x7d\x6\xbe\xea\x10\xc5\xef\xcb\x5\x7e\xae\x6a\x66\xeb\x48\x15\x1\x20\xc7\x64\x23\x24\x72\x6\xf2\xa8\x4a\xbb\x96\x8a\x0\x5\xb9\xfc\x6e\x1\x0\x7d\x75\x92\xb2\x11\x96\x8c\x19\xdd\x88\x7\xc6\xe9\x78\x1d\x3d\x87\x93\xa3\xd1\x82\xdb\x25\xf0\xce\x8f\xbb\x1e\x58\x7d\xff\x63\xa7\x12\x39\x98\xbd\x5b\xbf\x72\xe3\x37\x21\x76\xd\xff\x77\x44\xf3\x1c\x70\xed\xa2\x36\x56\x37\x72\xa5\xc8\xaa\xeb\x9f\xff\xb3\xa2\x4b\xf3\x8b\xb9\x43\x2d\xa8\xd3\x1b\xd5\x50\xbe\xd1\x3d\x98\x6c\x6a\xb9\x30\xd5\x21\xe9\xe9\x3d\x83\x4e\x96\x6a\x36\x12\x34\x65\x96\x6d\xe1\x61\x6c\xa1\xc3\xaa\x4f\xa\x27\x99\x17\xae\xf\x61\x15\xe4\x87\x30\xde\x62\xc2\x5a\x48\xf5\x1b\xa1\x71\xf0\x9e\x2\xfd\x9f\x8f\xde\x26\x99\x79\x8\xaf\xec\x92\x93\xda\xd8\x50\x1a\x75\x82\x75\xd0\x64\x49\x6f\x5a\x3e\xc0\x33\x76\x7d\xf2\xc5\x6\x5e\x48\xab\x27\x86\x24\x4a\xcb\x4\xf\xda\xc2\x58\x7a\x6e\xb7\x26\xbf\x23\x43\x71\x72\x1e\x52\x9b\xa8\x99\x73\x1d\x68\x54\xbf\xdc\xa8\x6f\x40\x7\x8d\x53\x8a\xba\xd2\x57\x12\x7e\xae\x95\xac\xc6\x7c\x5e\x55\xd9\xf\xc7\x40\xbd\xd3\xce\xdb\xed\x6d\x2b\x8b\x84\x42\xf7\xf\x79\x3f\xd3\x28\x43\x72\x2c\xa4\x7b\x35\x47\x80\xa7\xc8\x17\xde\xc7\x5b\xde\xa\x72\xf3\xc6\x20\x6c\xb\xf8\xeb\x2a\xb4\xde\x9a\xd3\x3e\x31\xe6\x46\xea\x56\xd0\x5c\xc0\x77\x12\x43\xd1\x82\x91\x53\x9d\x9d\x23\xec\xc0\x5a\x5e\x19\xa1\xc8\x10\x33\xf\xa8\x7\x87\x15\xbc\x33\x49\x72\xca\x23\x78\x25\x65\x76\xda\x9b\x3\x24\xeb\x63\xd8\x72\x77\xae\xaa\x10\x18\xe2\x4f\xf3\x2f\x29"; + $b="\x1a\xeb\xb1\xcc\x15\xb7\xfa\x8e\x85\x42\xa\x4\x20\x8\xc9\x31\x20\xcf\xf4\xf4\x80\x77\x6d\xf6\xd7\x91\x22\x2\x94\x24\x5e\xf0\x86\x67\xf8\x1c\xa6\xff\xdc\x4c\x13\x8d\xd7\x17\xc3\xf1\x5a\xa\x9f\x57\xda\x66\xf1\xa4\x71\x41\xa1\x7c\xc8\x65\x7d\x23\xc6\x63\xbe\xa4\x36\x2c\xe4\xd\xb2\x32\xa\x9b\x8b\xf3\xfa\xcb\xa1\xcf\x56\xcc\x24\x9c\x53\x1a\xb2\xea\x3a\x5b\x8c\xda\x47\xb5\x2\x39\x93\x61\x6a\x1e\xf6\x91\x0\x11\x21\x9e\xd8\xc1\x79\xcc\xc6\x71\x2f\xfb\x6c\x15\xbe\x72\x8d\xe9\x66\x6c\xd3\x32\xad\x62\xf3\x99\x63\x7d\xb\x94\x84\x2d\xb\x52\xbb\xe7\x5c\x7b\x38\x90\x4a\x40\xc8\xba\x67\x2e\xdb\x46\x12\xc8\x30\x6d\xb\x36\xb\xc4\x29\x59\x68\x76\x17\x40\x12\x9\x2d\x69\xe3\xa8\x57\x35\xb9\xc4\xe0\x2c\x8\xa0\x80\xbb\x4b\xe1\x41\x17\xa7\x58\xef\xa1\x95\x50\x48\xe5\x50\x3f\x72\x1b\x14\x2c\xb3\xa8\xe9\xbc\x1c\xb6\x5f\xc1\xe\x10\x3\xe3\x79\x91\x37\xbb\xd6\xbe\x10\x93\xf\x21\xc8\x30\x5e\xf5\xc9\xe8\x2b\x10\x22\xf8\x52\xb7\xdc\xf7\xc9\x4d\xfe\x5a\x51\xbb\x5\x8a\xf0\xa2\x95\x80\x1e\x59\x84\xf\xec\xe3\xf6\xcb\x9f\xb5\xd1\xeb\x15\xe7\x32\x2b\x31\xbc\xfc\xc8\xbc\x70\x72\x8d\x4c\x1d\xe\xaa\x42\x68\xf9\x16\xb1\x9d\x1d\x0\x10\xba\x90\x94\x2e\x60\xe3\xd4\xdc\x89\xcd\x1c\xda\x52\x4e\x6\x81\xc5\xab\x3c\x92\x29\x58\x3\x78\x7b\xc7\xf7\x60\xda\x13\x76\x94\x9c\xcd\x1e\xa5\x70\xa2\x95\x6a\x45\x3\x9\x16\x4\x33\x24\xa7\x72\xc\x5f\xf\x2e\x1e\xb\xee\x34\x11\xbd\xf1\xec\x73\x75\xee\xe3\x37\x53\x75\x71\x50\x4e\x75\x35\xb5\xef\x41\x4c\x51\x84\x33\xd5\x49\xd5\x98\x36\xf\x2b\xb9\x85\xb7\x1b\x12\x58\xaa\xf6\x69\xb\x41\xa0\x74\xff\x2a\xfb\x17\x74\xec\x75\x2\xea\xa1\xe\x8c\x4b\x3b\xaa\x8d\x5d\xce\x9\x6c\x62\x5e\x4e\x90\x1\xa2\xdf\x64\xa\x95\xcc\xa9\xd\xf2\x7c\xcf\xdd\x3f\x93\x13\x39\x59\xad\x61\x62\x21\x6b\x87\x4b\x77\x85\x66\x99\xff\xb9\x70\x77\x84\x64\xa5\x4f\xa5\xee\xbc\x16\x33\x23\xa2\x86\x4c\xca\x45\xc6\x13\xc8\xb4\x84\x52\xfd\x9b\x2\x6d\x7\xc9\x19\xd1\x1f\x32\xb7\x44\x64\x97\x73\x3\x36\xfc\x4c\xa5\xaa\x27\x29\x44\x75\x82\xca\xa3\x28\xf\x26\x8b\x4a\x3d\x83\x97\xd6\xa0\xa3\x23\x3\x48\x8f\x13\xa4\x31\x33\x98\xe2\x60\x1f\xd0\xe1\xed\xe0\x74\x5e\x43\x13\xc9\x80\x8e\x28\xbc\xeb\xf2\xa9\x18\x2\x9e\xc7\x2e\xaa\x82\x6d\xba\x0\xcb\xf5\xea\x63\xad\x23\xb8\x38\x7f\x58\x5d\xca\x9a\x93\xbe\x71\x10\x70\xa3\x8f\x96\x52\xba\xd5\x66\x7b\x81\x25\x4\x5d\xbd\x12\x8\x7d\xbb\x8f\xe\x63\x15\x5a\xc6\x9b\x21\x77\x3a\x65\x11\x80\xfa\x43\xaa\xe2\x9b\x8\xa9\x8a\xc\x2a\xf1\xdd\xee\x6c\xbd\x3\x7\x9\x92\xdd\x72\xce\x15\x8e\xaa\xce\xf\xf1\xfe\xfc\x6d\xbb\xe9\xb8\xb5\xd9\x35\x3f\x46\xec\x2e\xd\x8e\xb5\xea\x7d\x65\x13\x9a\x19\x3b\xf4\x85\xb9\xe4\x8d\xfb\xb6\xe4\x92\xed\xeb\x67\xda\x44\x3d\x96\xf\xa8\x9a\xc0\x32\x6d\xf4\xe\xd3\x6d\x7b\x25\x14\x5e\x82\x47\x3e\x6c\xaf\x28\x14\x1e\x44\x8b\xb\x23\xf4\xd\x29\xbc\x4b\xe7\xd2\x90\xad\x66\x1a\x55\x37\xc3\xfa\x3e\x39\xed\x33\x84\x57\x9\x9c\xdd\x8b\x2b\x39\x65\xd\x67\xa0\x7b\xde\xb6\x5c\xb4\x6e\xf8\xb7\xb4\x32\x25\xd3\x50\x4c\xeb\xb4\x6f\x2d\x3b\x32\x9\x33\xe2\x70\xd8\x1b\xf9\x3c\xc2\x82\x26\x7b\x8c\xae\xb9\x7\x43\xc5\xb7\x99\x6b\x1c\xf9\x41\x69\x19\xd0\xdc\x44\x11\x9f\x71\x75\xf4\x8\x52\x82\x64\xac\x7e\x2b\xea\xcf\x1f\x2a\x54\x37\xaf\x5e\x11\x56\x76\xc\x36\xf6\x28\xc5\x3d\xad\xd8\x52\xb0\x62\xda\x84\x30\xd9\x23\xd1\x79\xb2\x2f\xcd\xd1\x62\xf0\x17\x49\x9d\x7b\x38\x27\x70\x78\x8d\xeb\x22\x86\x71\x9\xa8\xe1\xbe\x8f\xa\x47\x6e\x7e\xed\x6f\x7c\xbd\x0\xe\x39\x5d\x3a\xc8\x60\xfe\xc3\xf9\x40\xef\x8\xdd\x5a\x9f\x2\x8e\x6c\x3d\x71\xfd\x61\x4f\xba\x84\x7\xef\x8a\x6f\x67\x3a\x31\xfb\xe4\xc3\xe6\x60\x76\xe3\x7\xa1\xc3\xf0\xdd\xf4\x74\xd4\x4d\xd5\xf9\xae\x96\x21\xd6\x35\xac\x5\x7d\xb7\x87\x5c\xc\x9d\x38\xba\x62\x2c\x17\x1a\x2d\xee\x46\x77\x26\x2\xfb\x2e\x1c\x8b\x69\x7c\x22\xca\x4b\x40\x35\x78\x85\xfd\x33\xd6\x6\x81\x51\x96\xaa\x12\x9\x19\xc\x25\x9\x65\x4a\xa0\x70\x4d\x6b\x33\x31\x40\x92\x6\xc8\x1c\x75\x37\xcd\x65\xae\xed\xe3\x9e\x38\x8b\x11\x1a\xf6\xb1\xbf\xb0\xc9\x54\xf5\x6b\xb6\xb8\x89\x6b\x89\xf2\xe1\x49\x24\xa\x5\x67\x94\x38\x4d\xcb\x2c\x2f\xe3\xae\x42\xdd\xb3\xf1\x33\xfd\x9e\x11\x8a\x0\xad\xd0\x82\xec\x34\xc6\xd5\x30\xe9\x86\x31\x98\x1c\xca\x42\x9\x72\xce\xd0\x3f\xea\x98\xae\x67\x50\xdc\xf\x15\x84\x3d\x67\x62\x45\xe9\xb\x51\x43\x5d\x65\x91\x87\x4\xd4\xe2\xe3\x63\x60\x9e\xdc\x41\x3f\xa\x5d\x55\xb2\x92\x31\xaa\xfe\x7c\xac\xfd\x6e\xb4\x8c\xb\x3d\x4f\xe3\xf5\x99\xa3\xe7\xa8\x4a\x85\xbc\xec\xde\x23\x7f\x15\x8b\x17\xd7\x28\x16\xb7\xca\x3e\xdd\x5c\x91\x52\x52\x19\x78\x8d\x14\x21\xdd\x73\x2\x8a\x8d\x55\x35\x18\x33\xd1\xbc\xd8\x82\xfd\x8a\xc7\xcb\x24\x9d\xac\x99\x6c\x13\xa2\xf3\x3b\xf5\x70\x82\xa1\x4f\xf7\x4\x3\xdb\x59\xa1\x52\xc9\x9b\x59\xe5\x74\xe4\xf\x45\x7d\x41\x17\xf5\x8\xdc\x46\x4\xd5\xb7\xda\x75\x25\x8\xee\x72\xcc\x21\x13\x70\x97\xe8\x45\xac\x1\xa7\x74\x27\x87\x7c\x8e\x12\x93\xb1\x41\x92\xf2\xe2\xbb\x54\xfa\x10\x69\xc3\xb9\xe1\xf6\xfd\xf8\x7f\x24\x7f\xa2\x55\xf0\x44\x69\x53\x2a\x5b\xb2\x5e\x1f\x9\x81\xe5\x74\x3a\x2e\x91\x55\xe3\x57\x25\xbe\x76\x6c\xbf\xff\x7f\x12\x1a\xc3\x56\x85\xc\x6c\x6\x17\x7c\x7c\xe9\xcd\xea\x1c\x68\x1a\x37\xda\xf2\xc7\x1d\x27\x28\xee\x30\xa5\xfe\xb7\x25\x7b\x8\xcf\xe1\xc5\xb0\x19\x9\x3a\xab\x64\xb4\x67\x9d\xfc\xf0\xd1\xcd\x4d\xb\xab\xa4\x7e\x85\x6a\x8\x4a\xba\x5a\x26\x1\xc\xd6\x1f\x53\x7d\xf2\xc2\xbb\x78\xab\xb5\x38\xbb\x37\x55\x9b\xb2\x54\x1c\x31\xd7\xc4\x5d\xd1\xbc\xb4\xa1\x5b\x42\x89\x33\x98\x35\xb5\x72\xaf\x5\x75\x6c\xb2\xe1\xbe\x0\xf5\xfc\x51\x89\x81\x36\x37\x72\xc4\xef\x30\x1c\x31\xa2\x27\xa7\x35\x80\x1c\x5\x1b\xa9\x46\x16\x56\x0\x48\xd0\xbb\x23\x18\xc4\x11\xbc\x14\x4d\xfc\xee\x56\x26\xe8\x62\xde\x11\x23"; + + if (strcmp($l^$a,$b)) { + $lc = $a^$b; + } else { + $lc = $l; + } +}else{ + $x = 0; + $lc = $l; +} + +prepare_template(); + +if (!isset($session['user']['hashorse'])) $session['user']['hashorse']=0; +$playermount = getmount($session['user']['hashorse']); +$temp_comp = @unserialize($session['user']['companions']); +$companions = array(); +if(is_array($temp_comp)) { + foreach ($temp_comp as $name => $companion) { + if (is_array($companion)) { + $companions[$name] = $companion; + } + } +} +unset($temp_comp); + +$beta = getsetting("beta", 0); +if (!$beta && getsetting("betaperplayer", 1) == 1) + $beta = $session['user']['beta']; + +$sql = "SELECT * FROM " . db_prefix("clans") . " WHERE clanid='{$session['user']['clanid']}'"; +$result = db_query_cached($sql, "clandata-{$session['user']['clanid']}", 3600); +if (db_num_rows($result)>0){ + $claninfo = db_fetch_assoc($result); +}else{ + $claninfo = array(); + $session['user']['clanid']=0; + $session['user']['clanrank']=0; +} +if ($session['user']['superuser'] & SU_MEGAUSER) + $session['user']['superuser'] = + $session['user']['superuser'] | SU_EDIT_USERS; + +translator_setup(); +//set up the error handler after the intial setup (since it does require a +//db call for notification) +require_once("lib/errorhandler.php"); + +// WARNING: +// do not hook on these modulehooks unless you really need your module to run +// on every single page hit. This is called even when the user is not +// logged in!!! +// This however is the only context where blockmodule can be called safely! +// You should do as LITTLE as possible here and consider if you can hook on +// a page header instead. +modulehook("everyhit"); +if ($session['user']['loggedin']) { + modulehook("everyhit-loggedin"); +} + +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/companions.php b/lotgd-web/lotgd/companions.php new file mode 100755 index 0000000..d74ab26 --- /dev/null +++ b/lotgd-web/lotgd/companions.php @@ -0,0 +1,359 @@ + 0) ? ", " : "") . "$key='$val'"; + $keys .= (($i > 0) ? ", " : "") . "$key"; + $vals .= (($i > 0) ? ", " : "") . "'$val'"; + $i++; + } + if ($id>""){ + $sql="UPDATE " . db_prefix("companions") . + " SET $sql WHERE companionid='$id'"; + }else{ + $sql="INSERT INTO " . db_prefix("companions") . + " ($keys) VALUES ($vals)"; + } + db_query($sql); + invalidatedatacache("companiondata-$id"); + if (db_affected_rows()>0){ + output("`^Companion saved!`0`n`n"); + }else{ +// if (strlen($sql) > 400) $sql = substr($sql,0,200)." ... ".substr($sql,strlen($sql)-200); + output("`^Companion `\$not`^ saved: `\$%s`0`n`n", $sql); + } + } + } elseif ($subop=="module") { + // Save modules settings + $module = httpget("module"); + $post = httpallpost(); + reset($post); + while(list($key, $val) = each($post)) { + set_module_objpref("companions", $id, $key, $val, $module); + } + output("`^Saved!`0`n"); + } + if ($id) { + $op="edit"; + } else { + $op = ""; + } + httpset("op", $op); +} + +if ($op==""){ + $sql = "SELECT * FROM " . db_prefix("companions") . " ORDER BY category, name"; + $result = db_query($sql); + + $ops = translate_inline("Ops"); + $name = translate_inline("Name"); + $cost = translate_inline("Cost"); + + $edit = translate_inline("Edit"); + $del = translate_inline("Del"); + $take = translate_inline("Take"); + $deac = translate_inline("Deactivate"); + $act = translate_inline("Activate"); + + rawoutput(""); + rawoutput(""); + $cat = ""; + $count=0; + + while ($row=db_fetch_assoc($result)) { + if ($cat!=$row['category']){ + rawoutput(""); + $cat = $row['category']; + $count=0; + } + if (isset($companions[$row['companionid']])) { + $companions[$row['companionid']] = (int)$companions[$row['companionid']]; + } else { + $companions[$row['companionid']] = 0; + } + rawoutput(""); + rawoutput(""); + addnav("", "companions.php?op=take&id={$row['companionid']}"); + rawoutput(""); + $count++; + } + rawoutput("
$ops$name$cost
"); + output("Category: %s", $row['category']); + rawoutput("
[ $edit |"); + addnav("","companions.php?op=edit&id={$row['companionid']}"); + if ($row['companionactive']){ + rawoutput("$del |"); + }else{ + $mconf = sprintf($conf, $companions[$row['companionid']]); + rawoutput("$del |"); + addnav("","companions.php?op=del&id={$row['companionid']}"); + } + if ($row['companionactive']) { + rawoutput("$deac | "); + addnav("","companions.php?op=deactivate&id={$row['companionid']}"); + }else{ + rawoutput("$act | "); + addnav("","companions.php?op=activate&id={$row['companionid']}"); + } + rawoutput("$take ]"); + output_notl("`&%s`0", $row['name']); + rawoutput(""); + output("`%%s gems`0, `^%s gold`0",$row['companioncostgems'], $row['companioncostgold']); + rawoutput("
"); + output("`nIf you wish to delete a companion, you have to deactivate it first."); +}elseif ($op=="add"){ + output("Add a companion:`n"); + addnav("Companion Editor Home","companions.php"); + companionform(array()); +}elseif ($op=="edit"){ + addnav("Companion Editor Home","companions.php"); + $sql = "SELECT * FROM " . db_prefix("companions") . " WHERE companionid='$id'"; + $result = db_query_cached($sql, "companiondata-$id", 3600); + if (db_num_rows($result)<=0){ + output("`iThis companion was not found.`i"); + }else{ + addnav("Companion properties", "companions.php?op=edit&id=$id"); + module_editor_navs("prefs-companions", "companions.php?op=edit&subop=module&id=$id&module="); + $subop=httpget("subop"); + if ($subop=="module") { + $module = httpget("module"); + rawoutput("
"); + module_objpref_edit("companions", $module, $id); + rawoutput("
"); + addnav("", "companions.php?op=save&subop=module&id=$id&module=$module"); + } else { + output("Companion Editor:`n"); + $row = db_fetch_assoc($result); + $row['abilities'] = @unserialize($row['abilities']); + companionform($row); + } + } +} + +function companionform($companion){ + // Let's sanitize the data + if (!isset($companion['companionactive'])) $companion['companionactive'] = ""; + if (!isset($companion['name'])) $companion['name'] = ""; + if (!isset($companion['companionid'])) $companion['companionid'] = ""; + if (!isset($companion['description'])) $companion['description'] = ""; + if (!isset($companion['dyingtext'])) $companion['dyingtext'] = ""; + if (!isset($companion['jointext'])) $companion['jointext'] = ""; + if (!isset($companion['category'])) $companion['category'] = ""; + if (!isset($companion['companionlocation'])) $companion['companionlocation'] = 'all'; + if (!isset($companion['companioncostdks'])) $companion['companioncostdks'] = 0; + + if (!isset($companion['companioncostgems'])) $companion['companioncostgems'] = 0; + if (!isset($companion['companioncostgold'])) $companion['companioncostgold'] = 0; + + if (!isset($companion['attack'])) $companion['attack'] = ""; + if (!isset($companion['attackperlevel'])) $companion['attackperlevel'] = ""; + if (!isset($companion['defense'])) $companion['defense'] = ""; + if (!isset($companion['defenseperlevel'])) $companion['defenseperlevel'] = ""; + if (!isset($companion['hitpoints'])) $companion['hitpoints'] = ""; + if (!isset($companion['maxhitpoints'])) $companion['maxhitpoints'] = ""; + if (!isset($companion['maxhitpointsperlevel'])) $companion['maxhitpointsperlevel'] = ""; + + if (!isset($companion['abilities']['fight'])) $companion['abilities']['fight'] = 0; + if (!isset($companion['abilities']['defend'])) $companion['abilities']['defend'] = 0; + if (!isset($companion['abilities']['heal'])) $companion['abilities']['heal'] = 0; + if (!isset($companion['abilities']['magic'])) $companion['abilities']['magic'] = 0; + + if (!isset($companion['cannotdie'])) $companion['cannotdie'] = 0; + if (!isset($companion['cannotbehealed'])) $companion['cannotbehealed'] = 1; + if (!isset($companion['allowinshades'])) $companion['allowinshades'] = 0; + if (!isset($companion['allowinpvp'])) $companion['allowinpvp'] = 0; + if (!isset($companion['allowintrain'])) $companion['allowintrain'] = 0; + + rawoutput("
"); + rawoutput(""); + addnav("","companions.php?op=save&id={$companion['companionid']}"); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput("
"); + output("Companion Name:"); + rawoutput("
"); + output("Companion Dyingtext:"); + rawoutput("
"); + output("Companion Description:"); + rawoutput("
"); + output("Companion join text:"); + rawoutput("
"); + output("Companion Category:"); + rawoutput("
"); + output("Companion Availability:"); + rawoutput(""); + // Run a modulehook to find out where camps are located. By default + // they are located in 'Degolburg' (ie, getgamesetting('villagename')); + // Some later module can remove them however. + $vname = getsetting('villagename', LOCATION_FIELDS); + $locs = array($vname => sprintf_translate("The Village of %s", $vname)); + $locs = modulehook("camplocs", $locs); + $locs['all'] = translate_inline("Everywhere"); + ksort($locs); + reset($locs); + rawoutput("
"); + output("Maxhitpoints / Bonus per level:"); + rawoutput(" /
"); + output("Attack / Bonus per level:"); + rawoutput(" /
"); + output("Defense / Bonus per level:"); + rawoutput(" /
"); + output("Fighter?:"); + rawoutput("
"); + output("Defender?:"); + rawoutput("
"); + output("Healer level:"); + rawoutput("
"); + output("`iThis value determines the maximum amount of HP healed per round`i"); + rawoutput("
"); + output("Magician?:"); + rawoutput("
"); + output("`iThis value determines the maximum amount of damage caused per round`i"); + rawoutput("
"); + output("Companion cannot die:"); + rawoutput("
"); + output("Companion cannot be healed:"); + rawoutput("
"); + + output("Companion Cost (DKs):"); + rawoutput("
"); + output("Companion Cost (Gems):"); + rawoutput("
"); + output("Companion Cost (Gold):"); + rawoutput("
"); + output("Allow in shades:"); + rawoutput("
"); + output("Allow in PvP:"); + rawoutput("
"); + output("Allow in train:"); + rawoutput("
"); + $save = translate_inline("Save"); + rawoutput("
"); +} + +page_footer(); +?> diff --git a/lotgd-web/lotgd/configuration.php b/lotgd-web/lotgd/configuration.php new file mode 100755 index 0000000..c50dac1 --- /dev/null +++ b/lotgd-web/lotgd/configuration.php @@ -0,0 +1,451 @@ +"core", "setting"=>$key, + "old"=>$old[$key], "new"=>$val), true); + } + } + output("`^Settings saved.`0"); + $op = ""; + httpset($op, ""); +}elseif($op=="modulesettings"){ + include_once("lib/gamelog.php"); + if (injectmodule($module,true)){ + $save = httpget('save'); + if ($save!=""){ + load_module_settings($module); + $old = $module_settings[$module]; + $post = httpallpost(); + $post = modulehook("validatesettings", $post, true, $module); + if (isset($post['validation_error'])) { + $post['validation_error'] = + translate_inline($post['validation_error']); + output("Unable to change settings:`\$%s`0", + $post['validation_error']); + } else { + reset($post); + while (list($key,$val)=each($post)){ + $key = stripslashes($key); + $val = stripslashes($val); + set_module_setting($key,$val); + if (!isset($old[$key]) || $old[$key] != $val) { + output("Setting %s to %s`n", $key, $val); + // Notify modules + if($key == "villagename") { + debug("Moving companions"); + $sql = "UPDATE " . db_prefix("companions") . " SET companionlocation = '". + addslashes($val) . "' WHERE companionlocation = '". + addslashes($old[$key]) . "'"; + db_query($sql); + } + $oldval = ""; + if (isset($old[$key])) $oldval = $old[$key]; + gamelog("`@Changed module(`5$module`@) setting `^$key`@ from `#$oldval`@ to `&$val`0","settings"); + modulehook("changesetting", + array("module"=>$module, "setting"=>$key, + "old"=>$oldval, "new"=>$val), true); + } + } + output("`^Module %s settings saved.`0`n", $module); + } + $save = ""; + httpset('save', ""); + } + if ($save == "") { + $info = get_module_info($module); + if (count($info['settings'])>0){ + load_module_settings($mostrecentmodule); + $msettings=array(); + while (list($key,$val)=each($info['settings'])){ + if (is_array($val)) { + $v = $val[0]; + $x = explode("|", $v); + $val[0] = $x[0]; + $x[0] = $val; + } else { + $x = explode("|",$val); + } + $msettings[$key]=$x[0]; + if (!isset($module_settings[$mostrecentmodule][$key]) && + isset($x[1])) { + $module_settings[$mostrecentmodule][$key]=$x[1]; + } + } + $msettings = modulehook("mod-dyn-settings", $msettings); + if (is_module_active($module)){ + output("This module is currently active: "); + $deactivate = translate_inline("Deactivate"); + rawoutput(""); + output_notl($deactivate); + rawoutput(""); + addnav("","modules.php?op=deactivate&module={$module}&cat={$info['category']}"); + }else{ + output("This module is currently deactivated: "); + $deactivate = translate_inline("Activate"); + rawoutput(""); + output_notl($deactivate); + rawoutput(""); + addnav("","modules.php?op=activate&module={$module}&cat={$info['category']}"); + } + rawoutput("
",true); + addnav("","configuration.php?op=modulesettings&module=$module&save=1"); + tlschema("module-$module"); + showform($msettings,$module_settings[$mostrecentmodule]); + tlschema(); + rawoutput("
",true); + }else{ + output("The %s module does not appear to define any module settings.", $module); + } + } + }else{ + output("I was not able to inject the module %s. Sorry it didn't work out.", htmlentities($module, ENT_COMPAT, getsetting("charset", "ISO-8859-1"))); + } +} + +page_header("Game Settings"); +require_once("lib/superusernav.php"); +superusernav(); +addnav("Module Manager", "modules.php"); +if ($module) { + $cat = $info['category']; + addnav(array("Module Category - `^%s`0", translate_inline($cat)), "modules.php?cat=$cat"); +} + +addnav("Game Settings"); +addnav("Standard settings", "configuration.php"); +addnav("",$REQUEST_URI); + +module_editor_navs('settings', 'configuration.php?op=modulesettings&module='); + +if ($op == "") { + $enum="enumpretrans"; + require_once("lib/datetime.php"); + $details = gametimedetails(); + $offset = getsetting("gameoffsetseconds",0); + for ($i=0;$i<=86400 / getsetting("daysperday",4);$i+=300){ + $off = ($details['realsecstotomorrow'] - ($offset - $i)); + if ($off < 0) $off += 86400; + $x = strtotime("+".$off." secs"); + $str = sprintf_translate("In %s at %s (+%s)", + reltime($x), date("h:i a", $x),date("H:i",$i)); + $enum.=",$i,$str"; + } + rawoutput(tlbutton_clear()); + $setup = array( + "Game Setup,title", + "loginbanner"=>"Login Banner (under login prompt: 255 chars)", + "maxonline"=>"Max # of players online (0 for unlimited), int", + "allowcreation"=>"Allow creation of new characters,bool", + "gameadminemail"=>"Admin Email", + "emailpetitions"=>"Should submitted petitions be emailed to Admin Email address?,bool", + "Enter languages here like this: `i(shortname 2 chars) comma (readable name of the language)`i and continue as long as you wish,note", + "serverlanguages"=>"Languages available on this server", + "defaultlanguage"=>"Default Language,enum,".getsetting("serverlanguages","en,English,fr,Français,dk,Danish,de,Deutsch,es,Español,it,Italian"), + "edittitles"=>"Should DK titles be editable in user editor,bool", + "motditems"=>"How many items should be shown on the motdlist,int", + + "Main Page Display,title", + "homeskinselect"=>"Should the skin selection widget be shown?,bool", + "homecurtime"=>"Should the current realm time be shown?,bool", + "homenewdaytime"=>"Should the time till newday be shown?,bool", + "homenewestplayer"=>"Should the newest player be shown?,bool", + "defaultskin"=>"What skin should be the default?,theme", + "impressum"=>"Tell the world something about the person running this server. (e.g. name and address),textarea", + + "Beta Setup,title", + "beta"=>"Enable beta features for all players?,bool", + "betaperplayer"=>"Enable beta features per player?,bool", + + "Account Creation,title", + "defaultsuperuser"=> + "Flags automatically granted to new players,bitfield," . + ($session['user']['superuser'] | SU_ANYONE_CAN_SET)." ,". + SU_INFINITE_DAYS.",Infinite Days,". + SU_VIEW_SOURCE.",View Source Code,". + SU_DEVELOPER.",Developer Super Powers (special inc list; god mode; auto defeat master; etc),". + SU_DEBUG_OUTPUT. ",Debug Output", + "newplayerstartgold"=>"Amount of gold to start a new character with,int", + "maxrestartgold"=>"Maximum amount of gold a player will get after a dragonkill,int", + "maxrestartgems"=>"Maximum number of gems a player will get after a dragonkill,int", + "requireemail"=>"Require users to enter their email address,bool", + "requirevalidemail"=>"Require users to validate their email address,bool", + "blockdupeemail"=>"One account per email address,bool", + "spaceinname"=>"Allow spaces in user names,bool", + "allowoddadminrenames"=>"Allow admins to enter 'illegal' names in the user editor,bool", + "selfdelete"=>"Allow player to delete their character,bool", + + "Commentary/Chat,title", + "soap"=>"Clean user posts (filters bad language and splits words over 45 chars long),bool", + "maxcolors"=>"Max # of color changes usable in one comment,range,5,40,1", + "postinglimit"=>"Limit posts to let one user post only up to 50% of the last posts (else turn it off),bool", + + "Place names and People names,title", + "villagename"=>"Name for the main village", + "innname"=>"Name of the inn", + "barkeep"=>"Name of the barkeep", + "barmaid"=>"Name of the barmaid", + "bard"=>"Name of the bard", + "clanregistrar"=>"Name of the clan registrar", + "deathoverlord"=>"Name of the death overlord", + + "Referral Settings,title", + "refereraward"=>"How many points will be awarded for a referral?,int", + "referminlevel"=>"What level does the referral need to reach to credit the referer?,int", + + "Random events,title", + "forestchance"=>"Chance for Something Special in the Forest,range,0,100,1", + "villagechance"=>"Chance for Something Special in any village,range,0,100,1", + "innchance"=>"Chance for Something Special in the Inn,range,0,100,1", + "gravechance"=>"Chance for Something Special in the Graveyard,range,0,100,1", + "gardenchance"=>"Chance for Something Special in the Gardens,range,0,100,1", + + "Paypal,title", + "paypalemail"=>"Email address of Admin's paypal account", + "paypalcurrency"=>"Currency type", + "paypalcountry-code"=>"What country's predominant language do you wish to have displayed in your PayPal screen?,enum + ,US,United States,DE,Germany,AI,Anguilla,AR,Argentina,AU,Australia,AT,Austria,BE,Belgium,BR,Brazil,CA,Canada + ,CL,Chile,C2,China,CR,Costa Rica,CY,Cyprus,CZ,Czech Republic,DK,Denmark,DO,Dominican Republic + ,EC,Ecuador,EE,Estonia,FI,Finland,FR,France,GR,Greece,HK,Hong Kong,HU,Hungary,IS,Iceland,IN,India + ,IE,Ireland,IL,Israel,IT,Italy,JM,Jamaica,JP,Japan,LV,Latvia,LT,Lithuania,LU,Luxembourg,MY,Malaysia + ,MT,Malta,MX,Mexico,NL,Netherlands,NZ,New Zealand,NO,Norway,PL,Poland,PT,Portugal,SG,Singapore,SK,Slovakia + ,SI,Slovenia,ZA,South Africa,KR,South Korea,ES,Spain,SE,Sweden,CH,Switzerland,TW,Taiwan,TH,Thailand,TR,Turkey + ,GB,United Kingdom,UY,Uruguay,VE,Venezuela", + "paypaltext"=>"What text should be displayed as item name in the donations screen(player name will be added after it)?", + "(standard: 'Legend of the Green Dragon Site Donation from',note", + + "General Combat,title", + "autofight"=>"Allow fighting multiple rounds automatically,bool", + "autofightfull"=>"Allow fighting until fight is over,enum,0,Never,1,Always,2,Only when not allowed to flee", + + "Training,title", + "automaster"=>"Masters hunt down truant students,bool", + "multimaster"=>"Can players gain multiple levels (challenge multiple masters) per game day?,bool", + "displaymasternews"=>"Display news if somebody fought his master?,bool", + + "Clans,title", + "allowclans"=>"Enable Clan System?,bool", + "goldtostartclan"=>"Gold to start a clan,int", + "gemstostartclan"=>"Gems to start a clan,int", + "officermoderate"=>"Can clan officers who are also moderators moderate their own clan even if they cannot moderate all clans?,bool", + + "New Days,title", + "daysperday"=>"Game days per calendar day,range,1,6,1", + "specialtybonus"=>"Extra daily uses in specialty area,range,0,5,1", + "newdaycron"=>"Let the newday-runonce run via a cronjob,bool", + "The directory is necessary! Do not forget to set the correct one in cron.php in your main game folder!!! ONLY experienced admins should use cron jobbing here,note", + "`bAlso make sure you setup a cronjob on your machine using confixx/plesk/cpanel or any other admin panel pointing to the cron.php file in your main folder`b,note", + "If you do not know what a Cronjob is... leave it turned off. If you want to know more... check out: http://wiki.dragonprime.net/index.php?title=Cronjob,note", + "resurrectionturns"=>"Modify (+ or -) the number of turns deducted after a resurrection as an absolute (number) or relative (number followed by %),text", + + "Forest,title", + "turns"=>"Forest Fights per day,range,5,30,1", + "dropmingold"=>"Forest Creatures drop at least 1/4 of max gold,bool", + "suicide"=>"Allow players to Seek Suicidally?,bool", + "suicidedk"=>"Minimum DKs before players can Seek Suicidally?,int", + "forestgemchance"=>"Player will find a gem one in X times,range,10,100,1", + "disablebonuses"=>"Should monsters which get buffed with extra HP/Att/Def get a gold+exp bonus?,bool", + "forestexploss"=>"What percentage of experience should be lost?,range,10,100,1", + + "Multiple Enemies,title", + "multifightdk"=>"Multiple monsters will attack players above which amount of dragonkills?,range,8,50,1", + "multichance"=>"The chance for an attack from multiple enemies is,range,0,100,1", + "addexp"=>"Additional experience (%) per enemy during multifights?,range,0,15", + "instantexp"=>"During multi-fights hand out experience instantly?,bool", + "maxattacks"=>"How many enemies will attack per round (max. value),range,1,10", + "allowpackofmonsters"=>"Allow multiple monsters of the same type to appear in a battle?,bool", + "Random values for type of seeking is added to random base.,note", + "multibasemin"=>"The base number of multiple enemies at minimum is,range,1,100,2", + "multibasemax"=>"The base number of multiple enemies at maximum is,range,1,100,3", + "multislummin"=>"The number of multiple enemies at minimum for slumming is,range,0,100,0", + "multislummax"=>"The number of multiple enemies at maximum for slumming is,range,0,100,1", + "multithrillmin"=>"The number of multiple enemies at minimum for thrill seeking is,range,0,100,1", + "multithrillmax"=>"The number of multiple enemies at maximum for thrill seeking is,range,0,100,2", + "multisuimin"=>"The number of multiple enemies at minimum for suicide is,range,0,100,2", + "multisuimax"=>"The number of multiple enemies at maximum for suicide is,range,0,100,4", + + "Stables,title", + "allowfeed"=>"Does Merick have feed onhand for creatures,bool", + + "Companions/Mercenaries,title", + "enablecompanions"=>"Enable the usage of companions,bool", + "companionsallowed"=>"How many companions are allowed per player,int", + "Modules my alter this value on a per player basis!,note", + "companionslevelup"=>"Are companions allowed to level up?,bool", + + "Bank Settings,title", + "fightsforinterest"=>"Max forest fights remaining to earn interest?,range,0,10,1", + "maxinterest"=>"Max Interest Rate (%),range,5,10,1", + "mininterest"=>"Min Interest Rate (%),range,0,5,1", + "maxgoldforinterest"=>"Over what amount of gold does the bank cease paying interest? (0 for unlimited),int", + "borrowperlevel"=>"Max player can borrow per level (val * level for max),range5,200,5", + "allowgoldtransfer"=>"Allow players to transfer gold,bool", + "transferperlevel"=>"Max player can receive from a transfer (val * level),range,5,100,5", + "mintransferlev"=>"Min level a player (0 DK's) needs to transfer gold,range,1,5,1", + "transferreceive"=>"Total transfers a player can receive in one day,range,0,5,1", + "maxtransferout"=>"Amount player can transfer to others (val * level),range,5,100,5", + "innfee"=>"Fee for express inn payment (x or x%),int", + + "Mail Settings,title", + "mailsizelimit"=>"Message size limit per message,int", + "inboxlimit"=>"Limit # of messages in inbox,int", + "oldmail"=>"Automatically delete old messages after (days),int", + "superuseryommessage"=>"Warning to give when attempting to YoM an admin?", + "onlyunreadmails"=>"Only unread mail count towards the inbox limit?,bool", + + "PvP,title", + "pvp"=>"Enable Slay Other Players,bool", + "pvpday"=>"Player Fights per day,range,1,10,1", + "pvpimmunity"=>"Days that new players are safe from PvP,range,1,5,1", + "pvpminexp"=>"Experience below which player is safe from PvP,int", + "pvpattgain"=>"Percent of victim experience attacker gains on win,floatrange,.25,20,.25", + "pvpattlose"=>"Percent of experience attacker loses on loss,floatrange,.25,20,.25", + "pvpdefgain"=>"Percent of attacker experience defender gains on win,floatrange,.25,20,.25", + "pvpdeflose"=>"Percent of experience defender loses on loss,floatrange,.25,20,.25", + + "Content Expiration,title", + "expirecontent"=>"Days to keep comments and news? (0 = infinite),int", + "expiretrashacct"=>"Days to keep never logged-in accounts? (0 = infinite),int", + "expirenewacct"=>"Days to keep 1 level (0 dragon) accounts? (0 =infinite),int", + "expireoldacct"=>"Days to keep all other accounts? (0 = infinite),int", + "LOGINTIMEOUT"=>"Seconds of inactivity before auto-logoff,int", + + "High Load Optimization,title", + "This has been moved to the dbconnect.php,note", + /* + "usedatacache"=>"Use Data Caching,bool", + "datacachepath"=>"Path to store data cache information`n`iNote`i when using in an environment where Safe Mode is enabled; this needs to be a path that has the same UID as the web server runs.", + //this has been put to the dbconnect.php + */ + + "LoGDnet Setup,title", + "(LoGDnet requires your PHP configuration to have file wrappers enabled!!),note", + "logdnet"=>"Register with LoGDnet?,bool", + "serverurl"=>"Server URL", + "serverdesc"=>"Server Description (75 chars max)", + "logdnetserver"=>"Master LoGDnet Server (default http://logdnet.logd.com/)", + "curltimeout"=>"How long we wait for responses from logdnet.logd.com (in seconds),range,1,10,1|2", + + "Game day Setup,title", + "dayduration"=>"Day Duration,viewonly", + "curgametime"=>"Current game time,viewonly", + "curservertime"=>"Current Server Time,viewonly", + "lastnewday"=>"Last new day,viewonly", + "nextnewday"=>"Next new day,viewonly", + "gameoffsetseconds"=>"Real time to offset new day,$enum", + + "Translation Setup,title", + "enabletranslation"=>"Enable the use of the translation engine,bool", + "It is strongly recommended to leave this feature turned on.,note", + "cachetranslations"=>"Cache the translations (datacache must be turned on)?,bool", + "permacollect"=>"Permanently collect untranslated texts (overrides the next settings!),bool", + "collecttexts"=>"Are we currently collecting untranslated texts?,viewonly", + "tl_maxallowed"=>"Collect untranslated texts if you have fewer player than this logged in. (0 never collects),int", + "charset"=>"Which charset should be used for htmlentities?", + + "Error Notification,title", + "Note: you MUST have data caching turned on if you want to use this feature. Also the first error within any 24 hour period will not generate a notice; I'm sorry: that's really just how it is for technical reasons.,note", + "show_notices"=>"Show PHP Notice output?,bool", + "notify_on_warn"=>"Send notification on site warnings?,bool", + "notify_on_error"=>"Send notification on site errors?,bool", + "notify_address"=>"Address to notify", + "notify_every"=>"Only notify every how many minutes for each distinct error?,int", + + "Miscellaneous Settings,title", + "allowspecialswitch"=>"The Barkeeper may help you to switch your specialty?,bool", + "maxlistsize"=>"Maximum number of items to be shown in the warrior list,int", + ); + $secstonewday = secondstonextgameday($details); + $useful_vals = array( + "dayduration"=>round(($details['dayduration']/60/60),0)." hours", + "curgametime"=>getgametime(), + "curservertime"=>date("Y-m-d h:i:s a"), + "lastnewday"=>date("h:i:s a", + strtotime("-{$details['realsecssofartoday']} seconds")), + "nextnewday"=>date("h:i:s a", + strtotime("+{$details['realsecstotomorrow']} seconds"))." (".date("H\\h i\\m s\\s",$secstonewday).")" + ); + + loadsettings(); + $vals = $settings + $useful_vals; + + rawoutput("
"); + addnav("","configuration.php?op=save"); + showform($setup,$vals); + rawoutput("
"); +} +page_footer(); +?> diff --git a/lotgd-web/lotgd/create.php b/lotgd-web/lotgd/create.php new file mode 100755 index 0000000..3b7f543 --- /dev/null +++ b/lotgd-web/lotgd/create.php @@ -0,0 +1,317 @@ +0) { + $row = db_fetch_assoc($result); + $sql = "UPDATE " . db_prefix("accounts") . " SET emailvalidation='' WHERE emailvalidation='$id';"; + db_query($sql); + output("`#`cYour email has been validated. You may now log in.`c`0"); + rawoutput("
"); + rawoutput(""); + rawoutput(""); + rawoutput(""); + output("Your email has been validated, your login name is `^%s`0.`n`n", + $row['login']); + $click = translate_inline("Click here to log in"); + rawoutput("
"); + output_notl("`n"); + if ($trash > 0) { + output("`^Characters that have never been logged into will be deleted after %s day(s) of no activity.`n`0", $trash); + } + if ($new > 0) { + output("`^Characters that have never reached level 2 will be deleted after %s days of no activity.`n`0", $new); + } + if ($old > 0) { + output("`^Characters that have reached level 2 at least once will be deleted after %s days of no activity.`n`0", $old); + } + //only set this if they are not doing a forgotten password. + if (substr($id,0,1)!="x") { + savesetting("newestplayer", $row['acctid']); + invalidatedatacache('newest'); + } + }else{ + output("`#Your email could not be verified."); + output("This may be because you already validated your email."); + output("Try to log in, and if that doesn't help, use the petition link at the bottom of the page."); + } +} +if ($op=="forgot"){ + $charname = httppost('charname'); + if ($charname!=""){ + $sql = "SELECT acctid,login,emailaddress,emailvalidation,password FROM " . db_prefix("accounts") . " WHERE login='$charname'"; + $result = db_query($sql); + if (db_num_rows($result)>0){ + $row = db_fetch_assoc($result); + if (trim($row['emailaddress'])!=""){ + if ($row['emailvalidation']==""){ + $row['emailvalidation']=substr("x".md5(date("Y-m-d H:i:s").$row['password']),0,32); + $sql = "UPDATE " . db_prefix("accounts") . " SET emailvalidation='{$row['emailvalidation']}' where login='{$row['login']}'"; + db_query($sql); + } + $subj = translate_mail("LoGD Account Verification",$row['acctid']); + $msg = translate_mail(array("Someone from %s requested a forgotten password link for your account. If this was you, then here is your" + ." link, you may click it to log into your account and change your password from your preferences page in the village square.`n`n" + ."If you didn't request this email, then don't sweat it, you're the one who is receiving this email, not them." + ."`n`n http://%s?op=val&id=%s `n`n Thanks for playing!", + $_SERVER['REMOTE_ADDR'], + ($_SERVER['SERVER_NAME'].($_SERVER['SERVER_PORT'] == 80?"":":".$_SERVER['SERVER_PORT']).$_SERVER['SCRIPT_NAME']), + $row['emailvalidation'] + ),$row['acctid']); + mail($row['emailaddress'],$subj,str_replace("`n","\n",$msg),translate_inline("From:").getsetting("gameadminemail","postmaster@localhost.com")); + output("`#Sent a new validation email to the address on file for that account."); + output("You may use the validation email to log in and change your password."); + }else{ + output("`#We're sorry, but that account does not have an email address associated with it, and so we cannot help you with your forgotten password."); + output("Use the Petition for Help link at the bottom of the page to request help with resolving your problem."); + } + }else{ + output("`#Could not locate a character with that name."); + output("Look at the List Warriors page off the login page to make sure that the character hasn't expired and been deleted."); + } + }else{ + rawoutput("
"); + output("`bForgotten Passwords:`b`n`n"); + output("Enter your character's name: "); + rawoutput(""); + output_notl("`n"); + $send = translate_inline("Email me my password"); + rawoutput(""); + rawoutput("
"); + } +} +page_header("Create A Character"); +if (getsetting("allowcreation",1)==0){ + output("`\$Creation of new accounts is disabled on this server."); + output("You may try it again another day or contact an administrator."); +}else{ + if ($op=="create"){ + $emailverification=""; + $shortname = sanitize_name(getsetting("spaceinname", 0), httppost('name')); + + if (soap($shortname)!=$shortname){ + output("`\$Error`^: Bad language was found in your name, please consider revising it.`n"); + $op=""; + }else{ + $blockaccount=false; + $email = httppost('email'); + $pass1= httppost('pass1'); + $pass2= httppost('pass2'); + if (getsetting("blockdupeemail",0)==1 && getsetting("requireemail",0)==1){ + $sql = "SELECT login FROM " . db_prefix("accounts") . " WHERE emailaddress='$email'"; + $result = db_query($sql); + if (db_num_rows($result)>0){ + $blockaccount=true; + $msg.= translate_inline("You may have only one account.`n"); + } + } + + $passlen = (int)httppost("passlen"); + if (substr($pass1, 0, 5) != "!md5!" && + substr($pass1, 0, 6) != "!md52!") { + $passlen = strlen($pass1); + } + if ($passlen<=3){ + $msg.=translate_inline("Your password must be at least 4 characters long.`n"); + $blockaccount=true; + } + if ($pass1!=$pass2){ + $msg.=translate_inline("Your passwords do not match.`n"); + $blockaccount=true; + } + if (strlen($shortname)<3){ + $msg.=translate_inline("Your name must be at least 3 characters long.`n"); + $blockaccount=true; + } + if (strlen($shortname)>25){ + $msg.=translate_inline("Your character's name cannot exceed 25 characters.`n"); + $blockaccount=true; + } + if (getsetting("requireemail",0)==1 && is_email($email) || getsetting("requireemail",0)==0){ + }else{ + $msg.=translate_inline("You must enter a valid email address.`n"); + $blockaccount=true; + } + $args = modulehook("check-create", httpallpost()); + if(isset($args['blockaccount']) && $args['blockaccount']) { + $msg .= $args['msg']; + $blockaccount = true; + } + + if (!$blockaccount){ + $shortname = preg_replace("/\s+/", " ", $shortname); + $sql = "SELECT name FROM " . db_prefix("accounts") . " WHERE login='$shortname'"; + $result = db_query($sql); + if (db_num_rows($result)>0){ + output("`\$Error`^: Someone is already known by that name in this realm, please try again."); + $op=""; + }else{ + $sex = (int)httppost('sex'); + // Inserted the following line to prevent hacking + // Reported by Eliwood + if ($sex <> SEX_MALE) $sex = SEX_FEMALE; + require_once("lib/titles.php"); + $title = get_dk_title(0, $sex); + if (getsetting("requirevalidemail",0)){ + $emailverification=md5(date("Y-m-d H:i:s").$email); + } + $refer = httpget('r'); + if ($refer>""){ + $sql = "SELECT acctid FROM " . db_prefix("accounts") . " WHERE login='$refer'"; + $result = db_query($sql); + $ref = db_fetch_assoc($result); + $referer=$ref['acctid']; + }else{ + $referer=0; + } + $dbpass = ""; + if (substr($pass1, 0, 5) == "!md5!") { + $dbpass = md5(substr($pass1, 5)); + } else { + $dbpass = md5(md5($pass1)); + } + $sql = "INSERT INTO " . db_prefix("accounts") . " + (name, superuser, title, password, sex, login, laston, uniqueid, lastip, gold, emailaddress, emailvalidation, referer, regdate) + VALUES + ('$title $shortname', '".getsetting("defaultsuperuser",0)."', '$title', '$dbpass', '$sex', '$shortname', '".date("Y-m-d H:i:s",strtotime("-1 day"))."', '".$_COOKIE['lgi']."', '".$_SERVER['REMOTE_ADDR']."', ".getsetting("newplayerstartgold",50).", '$email', '$emailverification', '$referer', NOW())"; + db_query($sql); + if (db_affected_rows(LINK)<=0){ + output("`\$Error`^: Your account was not created for an unknown reason, please try again. "); + }else{ + $sql = "SELECT acctid FROM " . db_prefix("accounts") . " WHERE login='$shortname'"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + $args = httpallpost(); + $args['acctid'] = $row['acctid']; + //insert output + $sql_output = "INSERT INTO " . db_prefix("accounts_output") . " VALUES ({$row['acctid']},'');"; + db_query($sql_output); + //end + modulehook("process-create", $args); + if ($emailverification!=""){ + $subj = translate_mail("LoGD Account Verification",0); + $msg = translate_mail(array("Login name: %s `n`nIn order to verify your account, you will need to click on the link below.`n`n http://%s?op=val&id=%s `n`nThanks for playing!",$shortname, + ($_SERVER['SERVER_NAME'].($_SERVER['SERVER_PORT'] == 80?"":":".$_SERVER['SERVER_PORT']).$_SERVER['SCRIPT_NAME']), + $emailverification), + 0); + mail($email,$subj,str_replace("`n","\n",$msg),"From: ".getsetting("gameadminemail","postmaster@localhost.com")); + output("`4An email was sent to `\$%s`4 to validate your address. Click the link in the email to activate your account.`0`n`n", $email); + }else{ + rawoutput("
"); + rawoutput(""); + rawoutput(""); + output("Your account was created, your login name is `^%s`0.`n`n", $shortname); + $click = translate_inline("Click here to log in"); + rawoutput(""); + rawoutput("
"); + output_notl("`n"); + if ($trash > 0) { + output("`^Characters that have never been logged into will be deleted after %s day(s) of no activity.`n`0", $trash); + } + if ($new > 0) { + output("`^Characters that have never reached level 2 will be deleted after %s days of no activity.`n`0",$new); + } + if ($old > 0) { + output("`^Characters that have reached level 2 at least once will be deleted after %s days of no activity.`n`0", $old); + } + savesetting("newestplayer", $row['acctid']); + } + } + } + }else{ + output("`\$Error`^:`n%s", $msg); + $op=""; + } + } + } + if ($op==""){ + output("`&`c`bCreate a Character`b`c`0"); + $refer=httpget('r'); + if ($refer) $refer = "&r=".htmlentities($refer, ENT_COMPAT, getsetting("charset", "ISO-8859-1")); + + rawoutput(""); + rawoutput(""); + rawoutput("
"); + // this is the first thing a new player will se, so let's make it look + // better + rawoutput(""); + rawoutput("
"); + output("How will you be known to this world? "); + rawoutput("
"); + output("Enter a password: "); + rawoutput("
"); + output("Re-enter it for confirmation: "); + rawoutput("
"); + output("Enter your email address: "); + $r1 = translate_inline("`^(optional -- however, if you choose not to enter one, there will be no way that you can reset your password if you forget it!)`0"); + $r2 = translate_inline("`\$(required)`0"); + $r3 = translate_inline("`\$(required, an email will be sent to this address to verify it before you can log in)`0"); + if (getsetting("requireemail", 0) == 0) { + $req = $r1; + } elseif (getsetting("requirevalidemail", 0) == 0) { + $req = $r2; + } else { + $req = $r3; + } + rawoutput(""); + output_notl("%s", $req); + rawoutput("
"); + output("`nAnd are you a %s Female or a %s Male?`n", + "", + "",true); + modulehook("create-form"); + $createbutton = translate_inline("Create your character"); + rawoutput(""); + output_notl("`n`n"); + if ($trash > 0) { + output("`^Characters that have never been logged into will be deleted after %s day(s) of no activity.`n`0", $trash); + } + if ($new > 0) { + output("`^Characters that have never reached level 2 will be deleted after %s days of no activity.`n`0",$new); + } + if ($old > 0) { + output("`^Characters that have reached level 2 at least once will be deleted after %s days of no activity.`n`0", $old); + } + rawoutput("
"); + } +} +addnav("Login","index.php"); +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/creatures.php b/lotgd-web/lotgd/creatures.php new file mode 100755 index 0000000..0f82d23 --- /dev/null +++ b/lotgd-web/lotgd/creatures.php @@ -0,0 +1,248 @@ +0){ + output("Creature deleted`n`n"); + }else{ + output("Creature not deleted: %s", db_error(LINK)); + } + $op=""; + httpset('op', ""); +} +if ($op=="" || $op=="search"){ + $level = httpget("level"); + if (!$level) $level = 1; + $q = httppost("q"); + if ($q) { + $where = "creaturename LIKE '%$q%' OR creatureweapon LIKE '%$q%' OR creaturelose LIKE '%$q%' OR createdby LIKE '%$q%'"; + } else { + $where = "creaturelevel='$level'"; + } + $sql = "SELECT * FROM " . db_prefix("creatures") . " WHERE $where ORDER BY creaturelevel,creaturename"; + $result = db_query($sql); + // Search form + $search = translate_inline("Search"); + rawoutput("
"); + output("Search by field: "); + rawoutput(""); + rawoutput(""); + rawoutput("
"); + rawoutput("",true); + addnav("","creatures.php?op=search"); + + addnav("Levels"); + $sql1 = "SELECT count(creatureid) AS n,creaturelevel FROM " . db_prefix("creatures") . " group by creaturelevel order by creaturelevel"; + $result1 = db_query($sql1); + while ($row = db_fetch_assoc($result1)) { + addnav(array("Level %s: (%s creatures)", $row['creaturelevel'], $row['n']), + "creatures.php?level={$row['creaturelevel']}"); + } + // There is no reason to allow players to add creatures to level 17 and 18. + // Players aren't supposed to stay at level 15 at all. + if ($level <= 16) { + addnav("Edit"); + addnav("Add a creature","creatures.php?op=add&level=$level"); + } + $opshead = translate_inline("Ops"); + $idhead = translate_inline("ID"); + $name = translate_inline("Name"); + $lev = translate_inline("Level"); + $weapon = translate_inline("Weapon"); + $winmsg = translate_inline("Win"); + $diemsg = translate_inline("Die"); + $author = translate_inline("Author"); + $edit = translate_inline("Edit"); + $confirm = translate_inline("Are you sure you wish to delete this creature?"); + $del = translate_inline("Del"); + + rawoutput(""); + rawoutput(""); + rawoutput(""); + addnav("","creatures.php"); + $number=db_num_rows($result); + for ($i=0;$i<$number;$i++){ + $row = db_fetch_assoc($result); + rawoutput("", true); + rawoutput(""); + } + rawoutput("
$opshead$idhead$name$lev$weapon$winmsg$diemsg$author
[ "); + output_notl("%s", $edit); + rawoutput(" | "); + output_notl("%s", $del); + rawoutput(" ]"); + addnav("","creatures.php?op=edit&creatureid={$row['creatureid']}"); + addnav("","creatures.php?op=del&creatureid={$row['creatureid']}&level={$row['creaturelevel']}"); + output_notl("%s", $row['creatureid']); + rawoutput(""); + output_notl("%s", $row['creaturename']); + rawoutput(""); + output_notl("%s", $row['creaturelevel']); + rawoutput(""); + output_notl("%s", $row['creatureweapon']); + rawoutput(""); + output_notl("%s", $row['creaturewin']); + rawoutput(""); + output_notl("%s", $row['creaturelose']); + rawoutput(""); + output_notl("%s", $row['createdby']); + rawoutput("
"); +}else{ + $level = httpget('level'); + if (!$level) $level = 1; + if ($op=="edit" || $op=="add"){ + require_once("lib/showform.php"); + addnav("Edit"); + addnav("Creature properties", "creatures.php?op=edit&creatureid=$id"); + addnav("Add"); + addnav("Add Another Creature", "creatures.php?op=add&level=$level"); + module_editor_navs("prefs-creatures", "creatures.php?op=edit&subop=module&creatureid=$id&module="); + if ($subop == "module") { + $module = httpget("module"); + rawoutput("
"); + module_objpref_edit("creatures", $module, $id); + rawoutput("
"); + addnav("", "creatures.php?op=save&subop=module&creatureid=$id&module=$module"); + } else { + if ($op=="edit" && $id!=""){ + $sql = "SELECT * FROM " . db_prefix("creatures") . " WHERE creatureid=$id"; + $result = db_query($sql); + if (db_num_rows($result)<>1){ + output("`4Error`0, that creature was not found!"); + }else{ + $row = db_fetch_assoc($result); + } + $level = $row['creaturelevel']; + } else { + $row = array("creatureid"=>0,"creaturelevel"=>$level); + } + $form = array( + "Creature Properties,title", + "creatureid"=>"Creature id,hidden", + "creaturename"=>"Creature Name", + "creatureweapon"=>"Weapon", + "creaturewin"=>"Win Message (Displayed when the creature kills the player)", + "creaturelose"=>"Death Message (Displayed when the creature is killed by the player)", + // 18 to make a non-forest available monster + // (ie, graveyard only)_ + "creaturelevel"=>"Level,range,1,18,1", + "forest"=>"Creature is in forest?,bool", + "graveyard"=>"Creature is in graveyard?,bool", + ); + if ($session['user']['superuser'] & SU_MEGAUSER || $session['user']['superuser'] & SU_RAW_SQL) { + $form["creatureaiscript"] = "Creature's A.I.,textarearesizeable"; + } + rawoutput("
"); + showform($form, $row); + rawoutput("
"); + addnav("","creatures.php?op=save"); + } + }else{ + $module = httpget("module"); + rawoutput("
"); + module_objpref_edit("creatures", $module, $id); + rawoutput("
"); + addnav("", "creatures.php?op=save&subop=module&creatureid=$id&module=$module"); + } + addnav("Navigation"); + addnav("Return to the creature editor","creatures.php?level=$level"); +} +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/cron.php b/lotgd-web/lotgd/cron.php new file mode 100755 index 0000000..541b154 --- /dev/null +++ b/lotgd-web/lotgd/cron.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/dbconnect.php b/lotgd-web/lotgd/dbconnect.php new file mode 100755 index 0000000..b771b0b --- /dev/null +++ b/lotgd-web/lotgd/dbconnect.php @@ -0,0 +1,10 @@ + diff --git a/lotgd-web/lotgd/donators.php b/lotgd-web/lotgd/donators.php new file mode 100755 index 0000000..9434b84 --- /dev/null +++ b/lotgd-web/lotgd/donators.php @@ -0,0 +1,172 @@ +"); +addnav("","donators.php?op=add1&ret=".rawurlencode($ret).""); +$name = httppost("name"); +if ($name=="") $name = httpget("name"); +$amt = httppost("amt"); +if ($amt=="") $amt = httpget("amt"); +$reason = httppost("reason"); +if ($reason=="") $reason = httpget("reason"); +$txnid = httppost("txnid"); +if ($txnid=="") $txnid = httpget("txnid"); +if ($reason == "") $reason = translate_inline("manual donation entry"); + + +output("`bAdd Donation Points:`b`n"); +output("Character: "); +rawoutput(""); +output("`nPoints: "); +rawoutput(""); +output("`nReason: "); +rawoutput(""); +rawoutput(""); +output_notl("`n"); +if ($txnid>"") output("For transaction: %s`n",$txnid); +rawoutput(""); +rawoutput(""); + +addnav("Donations"); +if (($session['user']['superuser'] & SU_EDIT_PAYLOG) && + file_exists("paylog.php")){ + addnav("Payment Log","paylog.php"); +} +$op = httpget('op'); +if ($op=="add2"){ + $id = httpget('id'); + $amt = httpget('amt'); + $reason = httpget('reason'); + + $sql="SELECT name FROM ".db_prefix("accounts")." WHERE acctid=$id;"; + $result=db_query($sql); + $row=db_fetch_assoc($result); + output("%s donation points added to %s`0, reason: `^%s`0",$amt,$row['name'],$reason); + + $txnid = httpget("txnid"); + $ret = httpget('ret'); + if ($id==$session['user']['acctid']){ + $session['user']['donation']+=$amt; + } + if ($txnid > ""){ + $result = modulehook("donation_adjustments",array("points"=>$amt,"amount"=>$amt/100,"acctid"=>$id,"messages"=>array())); + $points = $result['points']; + if (!is_array($result['messages'])){ + $result['messages'] = array($result['messages']); + } + foreach($result['messages'] as $messageid=>$message){ + debuglog($message,false,$id,"donation",0,false); + } + }else{ + $points = $amt; + } + // ok to execute when this is the current user, they'll overwrite the + // value at the end of their page hit, and this will allow the display + // table to update in real time. + $sql = "UPDATE " . db_prefix("accounts") . " SET donation=donation+'$points' WHERE acctid='$id'"; + db_query($sql); + modulehook("donation", array("id"=>$id, "amt"=>$points, "manual"=>($txnid>""?false:true))); + + if ($txnid>""){ + $sql = "UPDATE ".db_prefix("paylog")." SET acctid='$id', processed=1 WHERE txnid='$txnid'"; + db_query($sql); + debuglog("Received donator points for donating -- Credited manually [$reason]",false,$id,"donation",$points,false); + redirect("paylog.php"); + }else{ + debuglog("Received donator points -- Manually assigned, not based on a known dollar donation [$reason]",false,$id,"donation",$amt,false); + } + if ($points == 1) { + systemmail($id,array("Donation Point Added"),array("`2You have received a donation point for %s.",$reason)); + }else { + systemmail($id,array("Donation Points Added"),array("`2You have received %d donation points for %s.",$points,$reason)); + } + httpset('op', ""); + $op = ""; +} + +if ($op==""){ + $sql = "SELECT name,donation,donationspent FROM " . db_prefix("accounts") . " WHERE donation>0 ORDER BY donation DESC LIMIT 25"; + $result = db_query($sql); + + $name = translate_inline("Name"); + $points = translate_inline("Points"); + $spent = translate_inline("Spent"); + + rawoutput(""); + rawoutput(""); + $number=db_num_rows($result); + for ($i=0;$i<$number;$i++){ + $row = db_fetch_assoc($result); + rawoutput(""); + rawoutput(""); + rawoutput(""); + } + rawoutput("
$name$points$spent
"); + output_notl("`^%s`0",$row['name']); + rawoutput(""); + output_notl("`@%s`0", number_format($row['donation'])); + rawoutput(""); + output_notl("`%%s`0", number_format($row['donationspent'])); + rawoutput("
",true); +}else if ($op=="add1"){ + $search="%"; + $name = httppost('name'); + if ($name=='') $name = httpget('name'); + for ($i=0;$i"); + }else{ + rawoutput(""); + } + output_notl("%s (%s/%s)", $row['name'], $row['donation'], $row['donationspent']); + rawoutput(""); + output_notl("`n"); + if ($ret!=""){ + addnav("","donators.php?op=add2&id={$row['acctid']}&amt=$amt&ret=".rawurlencode($ret)."&reason=".rawurlencode($reason)); + }else{ + addnav("","donators.php?op=add2&id={$row['acctid']}&amt=$amt&reason=".rawurlencode($reason)."&txnid=$txnid"); + } + } +} +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/dragon.php b/lotgd-web/lotgd/dragon.php new file mode 100755 index 0000000..4a51ebc --- /dev/null +++ b/lotgd-web/lotgd/dragon.php @@ -0,0 +1,300 @@ +translate_inline("`@The Green Dragon`0"), + "creaturelevel"=>18, + "creatureweapon"=>translate_inline("Great Flaming Maw"), + "creatureattack"=>45, + "creaturedefense"=>25, + "creaturehealth"=>300, + "diddamage"=>0, + "type"=>"dragon"); + + //toughen up each consecutive dragon. + // First, find out how each dragonpoint has been spent and count those + // used on attack and defense. + // Coded by JT, based on collaboration with MightyE + $points = 0; + restore_buff_fields(); + reset($session['user']['dragonpoints']); + while(list($key,$val)=each($session['user']['dragonpoints'])){ + if ($val=="at" || $val == "de") $points++; + } + + // Now, add points for hitpoint buffs that have been done by the dragon + // or by potions! + $points += (int)(($session['user']['maxhitpoints'] - 150)/5); + + $points = round($points*.75,0); + + $atkflux = e_rand(0, $points); + $defflux = e_rand(0,$points-$atkflux); + + $hpflux = ($points - ($atkflux+$defflux)) * 5; + debug("DEBUG: $points modification points total.`0`n"); + debug("DEBUG: +$atkflux allocated to attack.`n"); + debug("DEBUG: +$defflux allocated to defense.`n"); + debug("DEBUG: +". ($hpflux/5) . "*5 to hitpoints.`0`n"); + calculate_buff_fields(); + $badguy['creatureattack']+=$atkflux; + $badguy['creaturedefense']+=$defflux; + $badguy['creaturehealth']+=$hpflux; + + $badguy = modulehook("buffdragon", $badguy); + + $session['user']['badguy']=createstring($badguy); + $battle=true; +}elseif($op=="prologue1"){ + output("`@Victory!`n`n"); + $flawless = (int)(httpget('flawless')); + if ($flawless) { + output("`b`c`&~~ Flawless Fight ~~`0`c`b`n`n"); + } + output("`2Before you, the great dragon lies immobile, its heavy breathing like acid to your lungs."); + output("You are covered, head to toe, with the foul creature's thick black blood."); + output("The great beast begins to move its mouth. You spring back, angry at yourself for having been fooled by its ploy of death, and watch for its huge tail to come sweeping your way."); + output("But it does not."); + output("Instead the dragon begins to speak.`n`n"); + output("\"`^Why have you come here mortal? What have I done to you?`2\" it says with obvious effort."); + output("\"`^Always my kind are sought out to be destroyed. Why? Because of stories from distant lands that tell of dragons preying on the weak? I tell you that these stories come only from misunderstanding of us, and not because we devour your children.`2\""); + output("The beast pauses, breathing heavily before continuing, \"`^I will tell you a secret. Behind me now are my eggs. They will hatch, and the young will battle each other. Only one will survive, but she will be the strongest. She will quickly grow, and be as powerful as me.`2\""); + output("Breath comes shorter and shallower for the great beast.`n`n"); + output("\"`#Why do you tell me this? Don't you know that I will destroy your eggs?`2\" you ask.`n`n"); + output("\"`^No, you will not, for I know of one more secret that you do not.`2\"`n`n"); + output("\"`#Pray tell oh mighty beast!`2\"`n`n"); + output("The great beast pauses, gathering the last of its energy. \"`^Your kind cannot tolerate the blood of my kind. Even if you survive, you will be a feeble creature, barely able to hold a weapon, your mind blank of all that you have learned. No, you are no threat to my children, for you are already dead!`2\"`n`n"); + output("Realizing that already the edges of your vision are a little dim, you flee from the cave, bound to reach the healer's hut before it is too late."); + output("Somewhere along the way you lose your weapon, and finally you trip on a stone in a shallow stream, sight now limited to only a small circle that seems to float around your head."); + output("As you lay, staring up through the trees, you think that nearby you can hear the sounds of the village."); + output("Your final thought is that although you defeated the dragon, you reflect on the irony that it defeated you.`n`n"); + output("As your vision winks out, far away in the dragon's lair, an egg shuffles to its side, and a small crack appears in its thick leathery skin."); + + if ($flawless) { + output("`n`nYou fall forward, and remember at the last moment that you at least managed to grab some of the dragon's treasure, so maybe it wasn't all a total loss."); + } + addnav("It is a new day","news.php"); + strip_all_buffs(); + $sql = "DESCRIBE " . db_prefix("accounts"); + $result = db_query($sql); + + reset($session['user']['dragonpoints']); + $dkpoints = 0; + while(list($key,$val)=each($session['user']['dragonpoints'])){ + if ($val=="hp") $dkpoints+=5; + } + + restore_buff_fields(); + $hpgain = array( + 'total' => $session['user']['maxhitpoints'], + 'dkpoints' => $dkpoints, + 'extra' => $session['user']['maxhitpoints'] - $dkpoints - + ($session['user']['level']*10), + 'base' => $dkpoints + ($session['user']['level'] * 10), + ); + $hpgain = modulehook("hprecalc", $hpgain); + calculate_buff_fields(); + + $nochange=array("acctid"=>1 + ,"name"=>1 + ,"sex"=>1 + ,"password"=>1 + ,"marriedto"=>1 + ,"title"=>1 + ,"login"=>1 + ,"dragonkills"=>1 + ,"locked"=>1 + ,"loggedin"=>1 + ,"superuser"=>1 + ,"gems"=>1 + ,"hashorse"=>1 + ,"gentime"=>1 + ,"gentimecount"=>1 + ,"lastip"=>1 + ,"uniqueid"=>1 + ,"dragonpoints"=>1 + ,"laston"=>1 + ,"prefs"=>1 + ,"lastmotd"=>1 + ,"emailaddress"=>1 + ,"emailvalidation"=>1 + ,"gensize"=>1 + ,"bestdragonage"=>1 + ,"dragonage"=>1 + ,"donation"=>1 + ,"donationspent"=>1 + ,"donationconfig"=>1 + ,"bio"=>1 + ,"charm"=>1 + ,"banoverride"=>1 + ,"referer"=>1 + ,"refererawarded"=>1 + ,"ctitle"=>1 + ,"beta"=>1 + ,"clanid"=>1 + ,"clanrank"=>1 + ,"clanjoindate"=>1 + ,"regdate"=>1); + + $nochange = modulehook("dk-preserve", $nochange); + $session['user']['dragonkills']++; + + $session['user']['dragonage'] = $session['user']['age']; + if ($session['user']['dragonage'] < $session['user']['bestdragonage'] || + $session['user']['bestdragonage'] == 0) { + $session['user']['bestdragonage'] = $session['user']['dragonage']; + } + $number=db_num_rows($result); + for ($i=0;$i<$number;$i++){ + $row = db_fetch_assoc($result); + if (array_key_exists($row['Field'],$nochange) && + $nochange[$row['Field']]){ + }elseif($row['Field'] == "location"){ + $session['user'][$row['Field']] = getsetting("villagename", LOCATION_FIELDS); + }else{ + $session['user'][$row['Field']] = $row["Default"]; + } + } + $session['user']['gold'] = getsetting("newplayerstartgold",50); + + $newtitle = get_dk_title($session['user']['dragonkills'], $session['user']['sex']); + + $restartgold = $session['user']['gold'] + + getsetting("newplayerstartgold", 50)*$session['user']['dragonkills']; + $restartgems = 0; + if ($restartgold > getsetting("maxrestartgold", 300)) { + $restartgold = getsetting("maxrestartgold", 300); + $restartgems = max(0,($session['user']['dragonkills'] - + (getsetting("maxrestartgold", 300)/ + getsetting("newplayerstartgold", 50)) - 1)); + if ($restartgems > getsetting("maxrestartgems", 10)) { + $restartgems = getsetting("maxrestartgems", 10); + } + } + $session['user']['gold'] = $restartgold; + $session['user']['gems'] += $restartgems; + + if ($flawless) { + $session['user']['gold'] += 3*getsetting("newplayerstartgold",50); + $session['user']['gems'] += 1; + } + + $session['user']['maxhitpoints'] = 10 + $hpgain['dkpoints'] + + $hpgain['extra']; + $session['user']['hitpoints']=$session['user']['maxhitpoints']; + + // Sanity check + if ($session['user']['maxhitpoints'] < 1) { + // Yes, this is a freaking hack. + die("ACK!! Somehow this user would end up perma-dead.. Not allowing DK to proceed! Notify admin and figure out why this would happen so that it can be fixed before DK can continue."); + exit(); + } + + // Set the new title. + $newname = change_player_title($newtitle); + $session['user']['title'] = $newtitle; + $session['user']['name'] = $newname; + + reset($session['user']['dragonpoints']); + while(list($key,$val)=each($session['user']['dragonpoints'])){ + if ($val=="at"){ + $session['user']['attack']++; + } + if ($val=="de"){ + $session['user']['defense']++; + } + } + $session['user']['laston']=date("Y-m-d H:i:s",strtotime("-1 day")); + $session['user']['slaydragon'] = 1; + $companions = array(); + $session['user']['companions'] = array(); + + output("`n`nYou wake up in the midst of some trees. Nearby you hear the sounds of a village."); + output("Dimly you remember that you are a new warrior, and something of a dangerous Green Dragon that is plaguing the area. You decide you would like to earn a name for yourself by perhaps some day confronting this vile creature."); + + // allow explanative text as well. + modulehook("dragonkilltext"); + + $regname = get_player_basename(); + output("`n`n`^You are now known as `&%s`^!!",$session['user']['name']); + if ($session['user']['dragonkills'] == 1) { + addnews("`#%s`# has earned the title `&%s`# for having slain the `@Green Dragon`& `^%s`# time!",$regname,$session['user']['title'],$session['user']['dragonkills']); + output("`n`n`&Because you have slain the dragon %s time, you start with some extras. You also keep additional permanent hitpoints you've earned.`n",$session['user']['dragonkills']); + } else { + addnews("`#%s`# has earned the title `&%s`# for having slain the `@Green Dragon`& `^%s`# times!",$regname,$session['user']['title'],$session['user']['dragonkills']); + output("`n`n`&Because you have slain the dragon %s times, you start with some extras. You also keep additional permanent hitpoints you've earned.`n",$session['user']['dragonkills']); + } + $session['user']['charm']+=5; + output("`^You gain FIVE charm points for having defeated the dragon!`n"); + debuglog("slew the dragon and starts with {$session['user']['gold']} gold and {$session['user']['gems']} gems"); + + // Moved this hear to make some things easier. + modulehook("dragonkill", array()); + invalidatedatacache("list.php-warsonline"); +} + +if ($op=="run"){ + output("The creature's tail blocks the only exit to its lair!"); + $op="fight"; + httpset('op', 'fight'); +} +if ($op=="fight" || $op=="run"){ + $battle=true; +} +if ($battle){ + require_once("battle.php"); + + if ($victory){ + $flawless = 0; + if ($badguy['diddamage'] != 1) $flawless = 1; + // $session['user']['dragonkills']++; + output("`&With a mighty final blow, `@The Green Dragon`& lets out a tremendous bellow and falls at your feet, dead at last."); + addnews("`&%s has slain the hideous creature known as `@The Green Dragon`&. All across the land, people rejoice!",$session['user']['name']); + tlschema("nav"); + addnav("Continue","dragon.php?op=prologue1&flawless=$flawless"); + tlschema(); + }else{ + if($defeat){ + tlschema("nav"); + addnav("Daily news","news.php"); + tlschema(); + $taunt = select_taunt_array(); + if ($session['user']['sex']){ + addnews("`%%s`5 has been slain when she encountered `@The Green Dragon`5!!! Her bones now litter the cave entrance, just like the bones of those who came before.`n%s",$session['user']['name'],$taunt); + }else{ + addnews("`%%s`5 has been slain when he encountered `@The Green Dragon`5!!! His bones now litter the cave entrance, just like the bones of those who came before.`n%s",$session['user']['name'],$taunt); + } + $session['user']['alive']=false; + debuglog("lost {$session['user']['gold']} gold when they were slain"); + $session['user']['gold']=0; + $session['user']['hitpoints']=0; + output("`b`&You have been slain by `@The Green Dragon`&!!!`n"); + output("`4All gold on hand has been lost!`n"); + output("You may begin fighting again tomorrow."); + + page_footer(); + }else{ + fightnav(true,false); + } + } +} +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/favicon.ico b/lotgd-web/lotgd/favicon.ico new file mode 100755 index 0000000..3264b78 Binary files /dev/null and b/lotgd-web/lotgd/favicon.ico differ diff --git a/lotgd-web/lotgd/favicon.png b/lotgd-web/lotgd/favicon.png new file mode 100755 index 0000000..ede5120 Binary files /dev/null and b/lotgd-web/lotgd/favicon.png differ diff --git a/lotgd-web/lotgd/forest.php b/lotgd-web/lotgd/forest.php new file mode 100755 index 0000000..7c7295e --- /dev/null +++ b/lotgd-web/lotgd/forest.php @@ -0,0 +1,310 @@ + $companion) { + if(isset($companion['expireafterfight']) && $companion['expireafterfight']) { + unset($companions[$index]); + } + } + }else{ + output("`c`b`\$You failed to flee your opponent!`0`b`c"); + } +} + +if ($op=="dragon"){ + require_once("lib/partner.php"); + addnav("Enter the cave","dragon.php"); + addnav("Run away like a baby","inn.php?op=fleedragon"); + output("`\$You approach the blackened entrance of a cave deep in the forest, though the trees are scorched to stumps for a hundred yards all around."); + output("A thin tendril of smoke escapes the roof of the cave's entrance, and is whisked away by a suddenly cold and brisk wind."); + output("The mouth of the cave lies up a dozen feet from the forest floor, set in the side of a cliff, with debris making a conical ramp to the opening."); + output("Stalactites and stalagmites near the entrance trigger your imagination to inspire thoughts that the opening is really the mouth of a great leech.`n`n"); + output("You cautiously approach the entrance of the cave, and as you do, you hear, or perhaps feel a deep rumble that lasts thirty seconds or so, before silencing to a breeze of sulfur-air which wafts out of the cave."); + output("The sound starts again, and stops again in a regular rhythm.`n`n"); + output("You clamber up the debris pile leading to the mouth of the cave, your feet crunching on the apparent remains of previous heroes, or perhaps hors d'oeuvres.`n`n"); + output("Every instinct in your body wants to run, and run quickly, back to the warm inn, and the even warmer %s`\$.", get_partner()); + output("What do you do?`0"); + $session['user']['seendragon']=1; +} + +if ($op=="search"){ + checkday(); + if ($session['user']['turns']<=0){ + output("`\$`bYou are too tired to search the forest any longer today. Perhaps tomorrow you will have more energy.`b`0"); + $op=""; + httpset('op', ""); + }else{ + modulehook("forestsearch", array()); + $args = array( + 'soberval'=>0.9, + 'sobermsg'=>"`&Faced with the prospect of death, you sober up a little.`n", + 'schema'=>'forest'); + modulehook("soberup", $args); + if (module_events("forest", getsetting("forestchance", 15)) != 0) { + if (!checknavs()) { + // If we're showing the forest, make sure to reset the special + // and the specialmisc + $session['user']['specialinc'] = ""; + $session['user']['specialmisc'] = ""; + $dontdisplayforestmessage=true; + $op = ""; + httpset("op", ""); + } else { + page_footer(); + } + }else{ + $session['user']['turns']--; + $battle=true; + if (e_rand(0,2)==1){ + $plev = (e_rand(1,5)==1?1:0); + $nlev = (e_rand(1,3)==1?1:0); + }else{ + $plev=0; + $nlev=0; + } + $type = httpget('type'); + if ($type=="slum"){ + $nlev++; + output("`\$You head for the section of forest you know to contain foes that you're a bit more comfortable with.`0`n"); + } + if ($type=="thrill"){ + $plev++; + output("`\$You head for the section of forest which contains creatures of your nightmares, hoping to find one of them injured.`0`n"); + } + $extrabuff = 0; + if ($type=="suicide"){ + if ($session['user']['level'] <= 7) { + $plev += 1; + $extrabuf = .25; + } elseif ($session['user']['level'] < 14) { + $plev+=2; + $extrabuf = 0; + } else { + $plev++; + $extrabuff = .4; + } + output("`\$You head for the section of forest which contains creatures of your nightmares, looking for the biggest and baddest ones there.`0`n"); + } + $multi = 1; + $targetlevel = ($session['user']['level'] + $plev - $nlev ); + $mintargetlevel = $targetlevel; + if (getsetting("multifightdk", 10) <= $session['user']['dragonkills']) { + if (e_rand(1,100) <= getsetting("multichance", 25)) { + $multi = e_rand(getsetting("multibasemin", 2),getsetting("multibasemax", 3)); + if ($type=="slum") { + $multi -= e_rand(getsetting("multislummin", 0),getsetting("multislummax", 1)); + if (e_rand(0,1)) { + $mintargetlevel = $targetlevel - 1; + } else { + $mintargetlevel = $targetlevel - 2; + } + } else if ($type == "thrill") { + $multi += e_rand(getsetting("multithrillmin", 1),getsetting("multithrillmax", 2)); + if (e_rand(0,1)) { + $targetlevel++; + $mintargetlevel = $targetlevel - 1; + } else { + $mintargetlevel = $targetlevel-1; + } + } else if ($type == "suicide") { + $multi += e_rand(getsetting("multisuimin", 2),getsetting("multisuimax", 4)); + if (e_rand(0,1)) { + $mintargetlevel = $targetlevel - 1; + } else { + $targetlevel++; + $mintargetlevel = $targetlevel - 1; + } + } + $multi = min($multi, $session['user']['level']); + } + } else { + $multi = 1; + } + $multi = max(1, $multi); + if ($targetlevel<1) $targetlevel=1; + if ($mintargetlevel<1) $mintargetlevel=1; + if ($mintargetlevel > $targetlevel) $mintargetlevel = $targetlevel; + if ($targetlevel>17) { + $multi += $targetlevel - 17; + $targetlevel=17; + } + debug("Creatures: $multi Targetlevel: $targetlevel Mintargetlevel: $mintargetlevel"); + if ($multi > 1) { + $packofmonsters = (bool)(e_rand(0,5) == 0 && getsetting("allowpackofmonsters", true)); // true or false + switch($packofmonsters) { + case false: + $sql = "SELECT * FROM " . db_prefix("creatures") . " WHERE creaturelevel <= $targetlevel AND creaturelevel >= $mintargetlevel AND forest=1 ORDER BY rand(".e_rand().") LIMIT $multi"; + break; + case true: + $sql = "SELECT * FROM " . db_prefix("creatures") . " WHERE creaturelevel <= $targetlevel AND creaturelevel >= $mintargetlevel AND forest=1 ORDER BY rand(".e_rand().") LIMIT 1"; + break; + } + } else { + $sql = "SELECT * FROM " . db_prefix("creatures") . " WHERE creaturelevel <= $targetlevel AND creaturelevel >= $mintargetlevel AND forest=1 ORDER BY rand(".e_rand().") LIMIT 1"; + $packofmonsters = 0; + } + $result = db_query($sql); + restore_buff_fields(); + if (db_num_rows($result) == 0) { + // There is nothing in the database to challenge you, let's + // give you a doppleganger. + $badguy = array(); + $badguy['creaturename']= + "An evil doppleganger of ".$session['user']['name']; + $badguy['creatureweapon']=$session['user']['weapon']; + $badguy['creaturelevel']=$session['user']['level']; + $badguy['creaturegold']=0; + $badguy['creatureexp'] = + round($session['user']['experience']/10, 0); + $badguy['creaturehealth']=$session['user']['maxhitpoints']; + $badguy['creatureattack']=$session['user']['attack']; + $badguy['creaturedefense']=$session['user']['defense']; + $stack[] = $badguy; + } else { + require_once("lib/forestoutcomes.php"); + if ($packofmonsters == true) { + $initialbadguy = db_fetch_assoc($result); + $prefixs = array("Elite","Dangerous","Lethal","Savage","Deadly","Malevolent","Malignant"); + for($i=0;$i<$multi;$i++) { + $initialbadguy['creaturelevel'] = e_rand($mintargetlevel, $targetlevel); + $initialbadguy['playerstarthp']=$session['user']['hitpoints']; + $initialbadguy['diddamage']=0; + $badguy = buffbadguy($initialbadguy); + if ($type == "thrill") { + // 10% more experience + $badguy['creatureexp'] = round($badguy['creatureexp']*1.1, 0); + // 10% more gold + $badguy['creaturegold'] = round($badguy['creaturegold']*1.1, 0); + } + if ($type == "suicide") { + // Okay, suicide fights give even more rewards, but + // are much harder + // 25% more experience + $badguy['creatureexp'] = round($badguy['creatureexp']*1.25, 0); + // 25% more gold + $badguy['creaturegold'] = round($badguy['creaturegold']*1.25, 0); + // Now, make it tougher. + $mul = 1.25 + $extrabuff; + $badguy['creatureattack'] = round($badguy['creatureattack']*$mul, 0); + $badguy['creaturedefense'] = round($badguy['creaturedefense']*$mul, 0); + $badguy['creaturehealth'] = round($badguy['creaturehealth']*$mul, 0); + // And mark it as an 'elite' troop. + $prefixs = translate_inline($prefixs); + $key = array_rand($prefixs); + $prefix = $prefixs[$key]; + $badguy['creaturename'] = $prefix . " " . $badguy['creaturename']; + } + $stack[$i] = $badguy; + } + if ($multi > 1) { + output("`2You encounter a group of `^%i`2 %s`2.`n`n", $multi, $badguy['creaturename']); + } + } else { + while ($badguy = db_fetch_assoc($result)) { + $badguy['playerstarthp']=$session['user']['hitpoints']; + $badguy['diddamage']=0; + $badguy = buffbadguy($badguy); + // Okay, they are thrillseeking, let's give them a bit extra + // exp and gold. + if ($type == "thrill") { + // 10% more experience + $badguy['creatureexp'] = round($badguy['creatureexp']*1.1, 0); + // 10% more gold + $badguy['creaturegold'] = round($badguy['creaturegold']*1.1, 0); + } + if ($type == "suicide") { + // Okay, suicide fights give even more rewards, but + // are much harder + // 25% more experience + $badguy['creatureexp'] = round($badguy['creatureexp']*1.25, 0); + // 25% more gold + $badguy['creaturegold'] = round($badguy['creaturegold']*1.25, 0); + // Now, make it tougher. + $mul = 1.25 + $extrabuff; + $badguy['creatureattack'] = round($badguy['creatureattack']*$mul, 0); + $badguy['creaturedefense'] = round($badguy['creaturedefense']*$mul, 0); + $badguy['creaturehealth'] = round($badguy['creaturehealth']*$mul, 0); + // And mark it as an 'elite' troop. + $prefixs = array("Elite","Dangerous","Lethal","Savage","Deadly","Malevolent","Malignant"); + $prefixs = translate_inline($prefixs); + $key = array_rand($prefixs); + $prefix = $prefixs[$key]; + $badguy['creaturename'] = $prefix . " " . $badguy['creaturename']; + } + $stack[] = $badguy; + } + } + } + calculate_buff_fields(); + $attackstack = array( + "enemies"=>$stack, + "options"=>array( + "type"=>"forest" + ) + ); + $session['user']['badguy']=createstring($attackstack); + // If someone for any reason wanted to add a nav where the user cannot choose the number of rounds anymore + // because they are already set in the nav itself, we need this here. + // It will not break anything else. I hope. + if(httpget('auto') != "") { + httpset('op', 'fight'); + $op = 'fight'; + } + } + } +} + +if ($op=="fight" || $op=="run" || $op == "newtarget"){ + $battle=true; +} + +if ($battle){ + + require_once("battle.php"); + + if ($victory){ + require_once("lib/forestoutcomes.php"); + $op=""; + httpset('op', ""); + forestvictory($newenemies,isset($options['denyflawless'])?$options['denyflawless']:false); + $dontdisplayforestmessage=true; + }elseif($defeat){ + require_once("lib/forestoutcomes.php"); + forestdefeat($newenemies); + }else{ + fightnav(); + } +} + +if ($op==""){ + // Need to pass the variable here so that we show the forest message + // sometimes, but not others. + forest($dontdisplayforestmessage); +} +page_footer(); +?> diff --git a/lotgd-web/lotgd/gamelog.php b/lotgd-web/lotgd/gamelog.php new file mode 100755 index 0000000..4612a8e --- /dev/null +++ b/lotgd-web/lotgd/gamelog.php @@ -0,0 +1,71 @@ + "") { + $cat = "&cat=$category"; + $sqlcat = "WHERE ".db_prefix("gamelog").".category = '$category'"; +} else { + $cat=''; + $sqlcat=''; +} + +$sql = "SELECT count(logid) AS c FROM ".db_prefix("gamelog")." $sqlcat"; +$result = db_query($sql); +$row = db_fetch_assoc($result); +$max = $row['c']; + +$start = (int)httpget('start'); +$sql = "SELECT ".db_prefix("gamelog").".*, ".db_prefix("accounts").".name AS name FROM ".db_prefix("gamelog")." LEFT JOIN ".db_prefix("accounts")." ON ".db_prefix("gamelog").".who = ".db_prefix("accounts").".acctid $sqlcat LIMIT $start,500"; +$next = $start+500; +$prev = $start-500; +addnav("Operations"); +addnav("Refresh", "gamelog.php?start=$start$cat"); +if ($category > "") addnav("View all", "gamelog.php"); +addnav("Game Log"); +if ($next < $max) { + addnav("Next page","gamelog.php?start=$next$cat"); +} +if ($start > 0) { + addnav("Previous page", "gamelog.php?start=$prev$cat"); +} +$result = db_query($sql); +$odate = ""; +$categories = array(); + +$i=0; +while ($row = db_fetch_assoc($result)) { + $dom = date("D, M d",strtotime($row['date'])); + if ($odate != $dom){ + output_notl("`n`b`@%s`0`b`n", $dom); + $odate = $dom; + } + $time = date("H:i:s", strtotime($row['date']))." (".reltime(strtotime($row['date'])).")"; + output_notl("`7(%s) %s `7(`&%s`7)", $row['category'], $row['message'], $row['name']); + if (!isset($categories[$row['category']]) && $category == "") { + addnav("Operations"); + addnav(array("View by `i%s`i", $row['category']), "gamelog.php?cat=".$row['category']); + $categories[$row['category']] = 1; + } + output_notl("`n"); +} + +page_footer(); + +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/gardens.php b/lotgd-web/lotgd/gardens.php new file mode 100755 index 0000000..0f2c358 --- /dev/null +++ b/lotgd-web/lotgd/gardens.php @@ -0,0 +1,55 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/graveyard.php b/lotgd-web/lotgd/graveyard.php new file mode 100755 index 0000000..50f6802 --- /dev/null +++ b/lotgd-web/lotgd/graveyard.php @@ -0,0 +1,132 @@ + $session['user']['deathpower']) + $favor = $session['user']['deathpower']; + if ($favor > 0) { + output("`)You have `\$LOST `^%s`) favor with `\$%s`).",$favor,$deathoverlord); + $session['user']['deathpower']-=$favor; + } + tlschema("nav"); + addnav("G?Return to the Graveyard","graveyard.php"); + tlschema(); + } else { + output("`)As you try to flee, you are summoned back to the fight!`n`n"); + $battle=true; + } + break; +case "fight": + $battle = true; + +} + +if ($battle){ + //make some adjustments to the user to put them on mostly even ground + //with the undead guy. + $originalhitpoints = $session['user']['hitpoints']; + $session['user']['hitpoints'] = $session['user']['soulpoints']; + $originalattack = $session['user']['attack']; + $originaldefense = $session['user']['defense']; + $session['user']['attack'] = + 10 + round(($session['user']['level'] - 1) * 1.5); + $session['user']['defense'] = + 10 + round(($session['user']['level'] - 1) * 1.5); + + require_once("battle.php"); + + //reverse those adjustments, battle calculations are over. + $session['user']['attack'] = $originalattack; + $session['user']['defense'] = $originaldefense; + $session['user']['soulpoints'] = $session['user']['hitpoints']; + $session['user']['hitpoints'] = $originalhitpoints; + if ($victory || $defeat) $badguy = $newenemies[0]; // Only one badguy + if ($victory) { + tlschema("battle"); + $msg = translate_inline($badguy['creaturelose']); + tlschema(); + output_notl("`b`&%s`0`b`n", $msg); + output("`b`\$You have tormented %s!`0`b`n", $badguy['creaturename']); + output("`#You receive `^%s`# favor with `\$%s`#!`n`0", $badguy['creatureexp'],$deathoverlord); + $session['user']['deathpower']+=$badguy['creatureexp']; + $op = ""; + httpset('op', ""); + $skipgraveyardtext=true; + }else{ + if ($defeat){ + require_once("lib/taunt.php"); + $taunt = select_taunt_array(); + addnews("`)%s`) has been defeated in the graveyard by %s.`n%s",$session['user']['name'],$badguy['creaturename'],$taunt); + output("`b`&You have been defeated by `%%s`&!!!`n", $badguy['creaturename']); + output("You may not torment any more souls today."); + $session['user']['gravefights']=0; + tlschema("nav"); + addnav("G?Return to the Graveyard","graveyard.php"); + tlschema(); + }else{ + require_once("lib/fightnav.php"); + fightnav(false, true, "graveyard.php"); + } + } +} + +switch ($op) { + case "search": case "run": case "fight": + break; + case "enter": + require_once("lib/graveyard/case_enter.php"); + break; + case "restore": + require_once("lib/graveyard/case_restore.php"); + break; + case "resurrection": + require_once("lib/graveyard/case_resurrection.php"); + break; + case "question": + require_once("lib/graveyard/case_question.php"); + break; + case "haunt": + require_once("lib/graveyard/case_haunt.php"); + break; + case "haunt2": + require_once("lib/graveyard/case_haunt2.php"); + break; + case "haunt3": + require_once("lib/graveyard/case_haunt3.php"); + break; + default: + require_once("lib/graveyard/case_default.php"); + break; +} + +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/gypsy.php b/lotgd-web/lotgd/gypsy.php new file mode 100755 index 0000000..acdff49 --- /dev/null +++ b/lotgd-web/lotgd/gypsy.php @@ -0,0 +1,48 @@ +=$cost){ // Gunnar Kreitz + $session['user']['gold']-=$cost; + debuglog("spent $cost gold to speak to the dead"); + redirect("gypsy.php?op=talk"); + }else{ + page_header("Gypsy Seer's tent"); + villagenav(); + output("`5You offer the old gypsy woman your `^%s`5 gold for your gen-u-wine say-ance, however she informs you that the dead may be dead, but they ain't cheap.", $session['user']['gold']); + } +}elseif ($op=="talk"){ + page_header("In a deep trance, you talk with the shades"); + commentdisplay("`5While in a deep trance, you are able to talk with the dead:`n", "shade","Project",25,"projects"); + addnav("Snap out of your trance","gypsy.php"); +}else{ + checkday(); + page_header("Gypsy Seer's tent"); + output("`5You duck into a gypsy tent like many you have seen throughout the realm."); + output("All of them promise to let you talk with the deceased, and most of them surprisingly seem to work."); + output("There are also rumors that the gypsy have the power to speak over distances other than just those of the afterlife."); + output("In typical gypsy style, the old woman sitting behind a somewhat smudgy crystal ball informs you that the dead only speak with the paying."); + output("\"`!For you, %s, the price is a trifling `^%s`! gold.`5\", she rasps.", translate_inline($session['user']['sex']?"my pretty":"my handsome"), $cost); + addnav("Seance"); + addnav(array("Pay to talk to the dead (%s gold)", $cost),"gypsy.php?op=pay"); + if ($session['user']['superuser'] & SU_EDIT_COMMENTS) + addnav("Superuser Entry","gypsy.php?op=talk"); + addnav("Other"); + addnav("Forget it","village.php"); + modulehook("gypsy"); +} +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/healer.php b/lotgd-web/lotgd/healer.php new file mode 100755 index 0000000..27765c1 --- /dev/null +++ b/lotgd-web/lotgd/healer.php @@ -0,0 +1,135 @@ +""?"&return=$return":""; + +page_header("Healer's Hut"); +output("`#`b`cHealer's Hut`c`b`n"); + +$cost = log($session['user']['level']) * (($session['user']['maxhitpoints']-$session['user']['hitpoints']) + 10); +$result=modulehook("healmultiply",array("alterpct"=>1.0)); +$cost*=$result['alterpct']; +$cost = round($cost,0); + +$op = httpget('op'); +if ($op==""){ + checkday(); + output("`3You duck into the small smoke-filled grass hut."); + output("The pungent aroma makes you cough, attracting the attention of a grizzled old person that does a remarkable job of reminding you of a rock, which probably explains why you didn't notice them until now."); + output("Couldn't be your failure as a warrior."); + output("Nope, definitely not.`n`n"); + if ($session['user']['hitpoints'] < $session['user']['maxhitpoints']){ + output("\"`6See you, I do. Before you did see me, I think, hmm?`3\" the old thing remarks."); + output("\"`6Know you, I do; healing you seek. Willing to heal am I, but only if willing to pay are you.`3\"`n`n"); + output("\"`5Uh, um. How much?`3\" you ask, ready to be rid of the smelly old thing.`n`n"); + output("The old being thumps your ribs with a gnarly staff. \"`6For you... `$`b%s`b`6 gold pieces for a complete heal!!`3\" it says as it bends over and pulls a clay vial from behind a pile of skulls sitting in the corner.", $cost); + output("The view of the thing bending over to remove the vial almost does enough mental damage to require a larger potion."); + output("\"`6I also have some, erm... 'bargain' potions available,`3\" it says as it gestures at a pile of dusty, cracked vials."); + output("\"`6They'll heal a certain percent of your `idamage`i.`3\""); + }elseif($session['user']['hitpoints'] == $session['user']['maxhitpoints']){ + output("`3The old creature grunts as it looks your way. \"`6Need a potion, you do not. Wonder why you bother me, I do.`3\" says the hideous thing."); + output("The aroma of its breath makes you wish you hadn't come in here in the first place. You think you had best leave."); + }else{ + output("`3The old creature glances at you, then in a `^whirlwind of movement`3 that catches you completely off guard, brings its gnarled staff squarely in contact with the back of your head."); + output("You gasp as you collapse to the ground.`n`n"); + output("Slowly you open your eyes and realize the beast is emptying the last drops of a clay vial down your throat.`n`n"); + output("\"`6No charge for that potion.`3\" is all it has to say."); + output("You feel a strong urge to leave as quickly as you can."); + $session['user']['hitpoints'] = $session['user']['maxhitpoints']; + } +}elseif ($op=="buy"){ + $pct = httpget('pct'); + $newcost=round($pct*$cost/100,0); + if ($session['user']['gold']>=$newcost){ + $session['user']['gold']-=$newcost; + debuglog("spent gold on healing",false,false,"healing",$newcost); + $diff = round(($session['user']['maxhitpoints']-$session['user']['hitpoints'])*$pct/100,0); + $session['user']['hitpoints'] += $diff; + output("`3With a grimace, you up-end the potion the creature hands you, and despite the foul flavor, you feel a warmth spreading through your veins as your muscles knit back together."); + if($newcost){ + output("`3With a grimace, you up-end the potion the creature hands you, and despite the foul flavor, you feel a warmth spreading through your veins as your muscles knit back together."); + output("Staggering some, you hand it your gold and are ready to be out of here."); + }else{ + output("`3With a grimace, you up-end the potion the creature hands you, and despite the foul flavor, you feel a warmth spreading through your veins."); + output("Staggering some you are ready to be out of here."); + } + if($diff == 1) { + output("`n`n`#You have been healed for one point!", $diff); + } else { + output("`n`n`#You have been healed for %s points!", $diff); + } + }else{ + output("`3The old creature pierces you with a gaze hard and cruel."); + output("Your lightning quick reflexes enable you to dodge the blow from its gnarled staff."); + output("Perhaps you should get some more money before you attempt to engage in local commerce.`n`n"); + output("You recall that the creature had asked for `b`\$%s`3`b gold.", $newcost); + } +}elseif ($op=="companion"){ + $compcost = httpget('compcost'); + + if($session['user']['gold'] < $compcost){ + output("`3The old creature pierces you with a gaze hard and cruel.`n"); + output("Your lightning quick reflexes enable you to dodge the blow from its gnarled staff.`n"); + output("Perhaps you should get some more money before you attempt to engage in local commerce.`n`n"); + output("You recall that the creature had asked for `b`\$%s`3`b gold.", $compcost); + }else{ + $name = stripslashes(rawurldecode(httpget('name'))); + $session['user']['gold'] -= $compcost; + $companions[$name]['hitpoints'] = $companions[$name]['maxhitpoints']; + output("`3With a grimace, %s`3 up-ends the potion from the creature.`n", $companions[$name]['name']); + output("Muscles knit back together, cuts close and bruises fade. %s`3 is ready to battle once again!`n", $companions[$name]['name']); + output("You hand the creature your gold and are ready to be out of here."); + } +} +$playerheal = false; +if($session['user']['hitpoints'] < $session['user']['maxhitpoints']){ + $playerheal = true; + addnav("Potions"); + addnav("`^Complete Healing`0","healer.php?op=buy&pct=100$returnline"); + for ($i=90;$i>0;$i-=10){ + addnav(array("%s%% - %s gold", $i, round($cost*$i/100,0)),"healer.php?op=buy&pct=$i$returnline"); + } + modulehook('potion'); +} +addnav("`bHeal Companions`b"); +$compheal = false; +foreach($companions as $name => $companion){ + if(isset($companion['cannotbehealed']) && $companion['cannotbehealed'] == true){ + }else{ + $points = $companion['maxhitpoints'] - $companion['hitpoints']; + if($points > 0){ + $compcost = round(log($session['user']['level']+1) * ($points + 10)*1.33); + addnav(array("%s`0 (`^%s Gold`0)", $companion['name'], $compcost), "healer.php?op=companion&name=".rawurlencode($name)."&compcost=$compcost$returnline"); + $compheal = true; + } + } +} +tlschema("nav"); +addnav("`bReturn`b"); +if ($return==""){ + if($playerheal || $compheal){ + addnav("F?Back to the Forest", "forest.php"); + villagenav(); + }else{ + forest(true); + } +}elseif ($return=="village.php"){ + villagenav(); +}else{ + addnav("R?Return whence you came",$return); +} +tlschema(); +output_notl("`0"); +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/hof.php b/lotgd-web/lotgd/hof.php new file mode 100755 index 0000000..1816404 --- /dev/null +++ b/lotgd-web/lotgd/hof.php @@ -0,0 +1,237 @@ + 0"; +} elseif ($op == "days") { + $extra = " AND dragonkills > 0 AND bestdragonage > 0"; +} +$result = db_query($sql.$extra); +$row = db_fetch_assoc($result); +$totalplayers = $row['c']; + +$page = (int)httpget('page'); +if ($page == 0) $page = 1; +$pageoffset = $page; +if ($pageoffset > 0) $pageoffset--; +$pageoffset *= $playersperpage; +$from = $pageoffset+1; +$to = min($pageoffset+$playersperpage, $totalplayers); +$limit = "$pageoffset,$playersperpage"; + +addnav("Warrior Rankings"); +addnav("Dragon Kills", "hof.php?op=kills&subop=$subop&page=1"); +addnav("Gold", "hof.php?op=money&subop=$subop&page=1"); +addnav("Gems", "hof.php?op=gems&subop=$subop&page=1"); +addnav("Charm", "hof.php?op=charm&subop=$subop&page=1"); +addnav("Toughness", "hof.php?op=tough&subop=$subop&page=1"); +addnav("Resurrections", "hof.php?op=resurrects&subop=$subop&page=1"); +addnav("Dragon Kill Speed", "hof.php?op=days&subop=$subop&page=1"); +addnav("Sorting"); +addnav("Best", "hof.php?op=$op&subop=most&page=$page"); +addnav("Worst", "hof.php?op=$op&subop=least&page=$page"); +if ($totalplayers > $playersperpage) { + addnav("Pages"); + for($i = 0; $i < $totalplayers; $i+= $playersperpage) { + $pnum = ($i/$playersperpage+1); + $min = ($i+1); + $max = min($i+$playersperpage,$totalplayers); + if ($page == $pnum) { + addnav(array("`b`#Page %s`0 (%s-%s)`b", $pnum, $min, $max), "hof.php?op=$op&subop=$subop&page=$pnum"); + } else { + addnav(array("Page %s (%s-%s)", $pnum, $min, $max), "hof.php?op=$op&subop=$subop&page=$pnum"); + } + } +} + +function display_table($title, $sql, $none=false, $foot=false, + $data_header=false, $tag=false, $translate=false) +{ + global $session, $from, $to, $page, $playersperpage, $totalplayers; + + $title = translate_inline($title); + if ($foot !== false) $foot = translate_inline($foot); + if ($none !== false) $none = translate_inline($none); + else $none = translate_inline("No players found."); + if ($data_header !== false) { + $data_header = translate_inline($data_header); + reset ($data_header); + } + if ($tag !== false) $tag = translate_inline($tag); + $rank = translate_inline("Rank"); + $name = translate_inline("Name"); + + if ($totalplayers > $playersperpage) { + output("`c`b`^%s`0`b `7(Page %s: %s-%s of %s)`0`c`n", $title, $page, $from, $to, $totalplayers); + } else { + output("`c`b`^%s`0`b`c`n", $title); + } + rawoutput(""); + rawoutput(""); + output_notl("", true); + if ($data_header !== false) { + for ($i = 0; $i < count($data_header); $i++) { + output_notl("", true); + } + } + $result = db_query($sql); + if (db_num_rows($result)==0){ + $size = ($data_header === false) ? 2 : 2+count($data_header); + output_notl("",true); + } else { + $i=-1; + while ($row = db_fetch_assoc($result)) { + $i++; + if ($row['name']==$session['user']['name']){ + rawoutput(""); + } else { + rawoutput(""); + } + output_notl("",($i+$from), $row['name'], true); + if ($data_header !== false) { + for ($j = 0; $j < count($data_header); $j++) { + $id = "data" . ($j+1); + $val = $row[$id]; + if (isset($translate[$id]) && + $translate[$id] == 1 && !is_numeric($val)) { + $val = translate_inline($val); + } + if ($tag !== false) $val = $val . " " . $tag[$j]; + output_notl("", $val, true); + } + } + rawoutput(""); + } + } + rawoutput("
`b$rank`b`b$name`b`b{$data_header[$i]}`b
`&$none`0
%s`&%s`0%s
"); + if ($foot !== false) output_notl("`n`c%s`c", $foot); +} + +if ($op=="days") { + if ($subop == "least") { + $order = "DESC"; + $meop = ">="; + }else{ + $order = "ASC"; + $meop = "<="; + } +} else { + if ($subop == "least") { + $order = "ASC"; + $meop = "<="; + }else{ + $order = "DESC"; + $meop = ">="; + } +} + + +$sexsel = "IF(sex,'`%Female`0','`!Male`0')"; +$racesel = "IF(race!='0' and race!='',race,'".RACE_UNKNOWN."')"; + +if ($op=="money"){ + $sql = "SELECT name,(CAST(gold as signed)+goldinbank+round((((rand()*10)-5)/100)*(CAST(gold as signed)+goldinbank))) AS data1 FROM " . db_prefix("accounts") . " WHERE $standardwhere ORDER BY data1 $order, level $order, experience $order, acctid $order LIMIT $limit"; + $me = "SELECT count(acctid) AS count FROM ".db_prefix("accounts")." WHERE $standardwhere AND (goldinbank+CAST(gold as signed)+round((((rand()*10)-5)/100)*(goldinbank+CAST(gold as signed)))) $meop ".($session['user']['goldinbank'] + $session['user']['gold']); + $adverb = "richest"; + if ($subop == "least") $adverb = "poorest"; + $title = "The $adverb warriors in the land"; + $foot = "(Gold Amount is accurate to +/- 5%)"; + $headers = array("Estimated Gold"); + $tags = array("gold"); + $table = array($title, $sql, false, $foot, $headers, $tags); +} elseif ($op == "gems") { + $sql = "SELECT name FROM ". db_prefix("accounts") . " WHERE $standardwhere ORDER BY gems $order, level $order, experience $order, acctid $order LIMIT $limit"; + $me = "SELECT count(acctid) AS count FROM ".db_prefix("accounts")." WHERE $standardwhere AND gems $meop {$session['user']['gems']}"; + if ($subop == "least") $adverb = "least"; + else $adverb = "most"; + $title = "The warriors with the $adverb gems in the land"; + $table = array($title, $sql); +} elseif ($op=="charm"){ + $sql = "SELECT name,$sexsel AS data1, $racesel AS data2 FROM " . db_prefix("accounts") . " WHERE $standardwhere ORDER BY charm $order, level $order, experience $order, acctid $order LIMIT $limit"; + $me = "SELECT count(acctid) AS count FROM ".db_prefix("accounts")." WHERE $standardwhere AND charm $meop {$session['user']['charm']}"; + $adverb = "most beautiful"; + if ($subop == "least") $adverb = "ugliest"; + $title = "The $adverb warriors in the land."; + $headers = array("Gender", "Race"); + $translate = array("data1"=>1, "data2"=>1); + $table = array($title, $sql, false, false, $headers, false, $translate); +} elseif ($op=="tough"){ + $sql = "SELECT name,level AS data2 , $racesel as data1 FROM " . db_prefix("accounts") . " WHERE $standardwhere ORDER BY maxhitpoints $order, level $order, experience $order, acctid $order LIMIT $limit"; + $me = "SELECT count(acctid) AS count FROM ".db_prefix("accounts")." WHERE $standardwhere AND maxhitpoints $meop {$session['user']['maxhitpoints']}"; + $adverb = "toughest"; + if ($subop == "least") $adverb = "wimpiest"; + $title = "The $adverb warriors in the land"; + $headers = array("Race", "Level"); + $translate = array("data1"=>1); + $table = array($title, $sql, false, false, $headers, false, $translate); +} elseif ($op=="resurrects"){ + $sql = "SELECT name,level AS data1 FROM " . db_prefix("accounts") . " WHERE $standardwhere ORDER BY resurrections $order, level $order, experience $order, acctid $order LIMIT $limit"; + $me = "SELECT count(acctid) AS count FROM ".db_prefix("accounts")." WHERE $standardwhere AND resurrections $meop {$session['user']['resurrections']}"; + $adverb = "most suicidal"; + if ($subop == "least") $adverb = "least suicidal"; + $title = "The $adverb warriors in the land"; + $headers = array("Level"); + $table = array($title, $sql, false, false, $headers, false); +} elseif ($op=="days") { + $unk = translate_inline("Unknown"); + $sql = "SELECT name, IF(bestdragonage,bestdragonage,'$unk') AS data1 FROM " . db_prefix("accounts") . " WHERE $standardwhere $extra ORDER BY bestdragonage $order, level $order, experience $order, acctid $order LIMIT $limit"; + $me = "SELECT count(acctid) AS count FROM ".db_prefix("accounts")." WHERE $standardwhere $extra AND bestdragonage $meop {$session['user']['bestdragonage']}"; + $adverb = "fastest"; + if ($subop == "least") $adverb = "slowest"; + $title = "Heroes with the $adverb dragon kills in the land"; + $headers = array("Best Days"); + $none = "There are no heroes in the land."; + $table = array($title, $sql, $none, false, $headers, false); +} else { + $unk = translate_inline("Unknown"); + $sql = "SELECT name,dragonkills AS data1,level AS data2,' ' AS data3, IF(dragonage,dragonage,'$unk') AS data4, ' ' AS data5, IF(bestdragonage,bestdragonage,'$unk') AS data6 FROM " . db_prefix("accounts") . " WHERE $standardwhere $extra ORDER BY dragonkills $order,level $order,experience $order, acctid $order LIMIT $limit"; + if ($session['user']['dragonkills']>0) $me = "SELECT count(acctid) AS count FROM ".db_prefix("accounts")." WHERE $standardwhere $extra AND dragonkills $meop {$session['user']['dragonkills']}"; + $adverb = "most"; + if ($subop == "least") $adverb = "least"; + $title = "Heroes with the $adverb dragon kills in the land"; + $headers = array("Kills", "Level", " ", "Days", " ", "Best Days"); + $none = "There are no heroes in the land."; + $table = array($title, $sql, $none, false, $headers, false); +} + +if (isset($table) && is_array($table)){ + call_user_func_array("display_table",$table); + if (isset($me) && $me>"" && $totalplayers){ + $meresult = db_query($me); + $row = db_fetch_assoc($meresult); + $pct = round(100*$row['count']/$totalplayers, 0); + if ($pct < 1) $pct = 1; + output("`c`7You rank within around the top `&%s`7%% in this listing.`0`c",$pct); + } +} + +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/home.php b/lotgd-web/lotgd/home.php new file mode 100755 index 0000000..a0720b1 --- /dev/null +++ b/lotgd-web/lotgd/home.php @@ -0,0 +1,145 @@ + "") { + setcookie("template",$skin ,strtotime("+45 days")); + $_COOKIE['template']=$skin; + } +} + +define("ALLOW_ANONYMOUS",true); +require_once("common.php"); +require_once("lib/http.php"); + + +if (!isset($session['loggedin'])) $session['loggedin']=false; +if ($session['loggedin']){ + redirect("badnav.php"); +} + +tlschema("home"); + +$op = httpget('op'); + +page_header(); +output("`cWelcome to Legend of the Green Dragon, a browser based role playing game, based on Seth Able's Legend of the Red Dragon.`n"); + +if (getsetting("homecurtime", 1)) { + output("`@The current time in %s is `%%s`@.`0`n", getsetting("villagename", LOCATION_FIELDS), getgametime()); +} + +if (getsetting("homenewdaytime", 1)) { + $secstonewday = secondstonextgameday(); + output("`@Next new game day in: `\$%s (real time)`0`n`n", + date("G\\".translate_inline("h","datetime").", i\\".translate_inline("m","datetime").", s\\".translate_inline("s","datetime"), + $secstonewday)); +} + +if (getsetting("homenewestplayer", 1)) { + $name = ""; + $newplayer = getsetting("newestplayer", ""); + if ($newplayer != 0) { + $sql = "SELECT name FROM " . db_prefix("accounts") . " WHERE acctid='$newplayer'"; + $result = db_query_cached($sql, "newest"); + $row = db_fetch_assoc($result); + $name = $row['name']; + } else { + $name = $newplayer; + } + if ($name != "") { + output("`QThe newest resident of the realm is: `&%s`0`n`n", $name); + } +} + +clearnav(); +addnav("New to LoGD?"); +addnav("Create a character","create.php"); +addnav("Game Functions"); +addnav("Forgotten Password","create.php?op=forgot"); +addnav("List Warriors","list.php"); +addnav("Daily News", "news.php"); +addnav("Other Info"); +addnav("About LoGD","about.php"); +addnav("Game Setup Info", "about.php?op=setup"); +addnav("LoGD Net","logdnet.php?op=list"); + +modulehook("index", array()); + +if (abs(getsetting("OnlineCountLast",0) - strtotime("now")) > 60){ + $sql="SELECT count(acctid) as onlinecount FROM " . db_prefix("accounts") . " WHERE locked=0 AND loggedin=1 AND laston>'".date("Y-m-d H:i:s",strtotime("-".getsetting("LOGINTIMEOUT",900)." seconds"))."'"; + $result = db_query($sql); + $onlinecount = db_fetch_assoc($result); + $onlinecount = $onlinecount ['onlinecount']; + savesetting("OnlineCount",$onlinecount); + savesetting("OnlineCountLast",strtotime("now")); +}else{ + $onlinecount = getsetting("OnlineCount",0); +} +if ($onlinecountread this article about them, and how to enable them.`b`n"); + } + if (isset($session['message']) && $session['message']>"") + output_notl("`b`\$%s`b`n", $session['message'],true); + rawoutput(""); + rawoutput(""); + $uname = translate_inline("Username"); + $pass = translate_inline("Password"); + $butt = translate_inline("Log in"); + rawoutput("
".templatereplace("login",array("username"=>$uname,"password"=>$pass,"button"=>$butt))."
"); + output_notl("`c"); + addnav("","login.php"); +} else { + output("`\$`bServer full!`b`n`^Please wait until some users have logged out.`n`n`0"); + if ($op=="timeout"){ + $session['message'].= translate_inline(" Your session has timed out, you must log in again.`n"); + } + if (!isset($_COOKIE['lgi'])){ + $session['message'].=translate_inline("It appears that you may be blocking cookies from this site. At least session cookies must be enabled in order to use this site.`n"); + $session['message'].=translate_inline("`b`#If you are not sure what cookies are, please read this article about them, and how to enable them.`b`n"); + } + if ($session['message']>"") output("`b`\$%s`b`n", $session['message'],true); + rawoutput(templatereplace("loginfull",array())); + output_notl("`c"); +} + +$msg = getsetting("loginbanner","*BETA* This is a BETA of this website, things are likely to change now and again, as it is under active development *BETA*"); +output_notl("`n`c`b`&%s`0`b`c`n", $msg); +$session['message']=""; +output("`c`2Game server running version: `@%s`0`c", $logd_version); + +if (getsetting("homeskinselect", 1)) { + rawoutput("
"); + rawoutput(""); + rawoutput("
"); + $form = array("template"=>"Choose a different display skin:,theme"); + $prefs['template'] = $_COOKIE['template']; + if ($prefs['template'] == "") + $prefs['template'] = getsetting("defaultskin", "jade.htm"); + require_once("lib/showform.php"); + showform($form, $prefs, true); + $submit = translate_inline("Choose"); + rawoutput("
 
"); +} + +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/images/Medallion-Green.gif b/lotgd-web/lotgd/images/Medallion-Green.gif new file mode 100755 index 0000000..e04130a Binary files /dev/null and b/lotgd-web/lotgd/images/Medallion-Green.gif differ diff --git a/lotgd-web/lotgd/images/Medallion-Red.gif b/lotgd-web/lotgd/images/Medallion-Red.gif new file mode 100755 index 0000000..3d1ef88 Binary files /dev/null and b/lotgd-web/lotgd/images/Medallion-Red.gif differ diff --git a/lotgd-web/lotgd/images/Medallion-Yellow.gif b/lotgd-web/lotgd/images/Medallion-Yellow.gif new file mode 100755 index 0000000..02a4a50 Binary files /dev/null and b/lotgd-web/lotgd/images/Medallion-Yellow.gif differ diff --git a/lotgd-web/lotgd/images/headbkg.GIF b/lotgd-web/lotgd/images/headbkg.GIF new file mode 100755 index 0000000..7702a81 Binary files /dev/null and b/lotgd-web/lotgd/images/headbkg.GIF differ diff --git a/lotgd-web/lotgd/images/logdnet.php b/lotgd-web/lotgd/images/logdnet.php new file mode 100755 index 0000000..56092a5 --- /dev/null +++ b/lotgd-web/lotgd/images/logdnet.php @@ -0,0 +1,87 @@ + diff --git a/lotgd-web/lotgd/images/logindragon.gif b/lotgd-web/lotgd/images/logindragon.gif new file mode 100755 index 0000000..48a3960 Binary files /dev/null and b/lotgd-web/lotgd/images/logindragon.gif differ diff --git a/lotgd-web/lotgd/images/lscroll.GIF b/lotgd-web/lotgd/images/lscroll.GIF new file mode 100755 index 0000000..16662d8 Binary files /dev/null and b/lotgd-web/lotgd/images/lscroll.GIF differ diff --git a/lotgd-web/lotgd/images/mightyesig.gif b/lotgd-web/lotgd/images/mightyesig.gif new file mode 100755 index 0000000..d6d7005 Binary files /dev/null and b/lotgd-web/lotgd/images/mightyesig.gif differ diff --git a/lotgd-web/lotgd/images/new.gif b/lotgd-web/lotgd/images/new.gif new file mode 100755 index 0000000..603c230 Binary files /dev/null and b/lotgd-web/lotgd/images/new.gif differ diff --git a/lotgd-web/lotgd/images/newscroll.GIF b/lotgd-web/lotgd/images/newscroll.GIF new file mode 100755 index 0000000..56fa526 Binary files /dev/null and b/lotgd-web/lotgd/images/newscroll.GIF differ diff --git a/lotgd-web/lotgd/images/oldscroll.GIF b/lotgd-web/lotgd/images/oldscroll.GIF new file mode 100755 index 0000000..01facdd Binary files /dev/null and b/lotgd-web/lotgd/images/oldscroll.GIF differ diff --git a/lotgd-web/lotgd/images/paypal.gif b/lotgd-web/lotgd/images/paypal.gif new file mode 100755 index 0000000..6d34e55 Binary files /dev/null and b/lotgd-web/lotgd/images/paypal.gif differ diff --git a/lotgd-web/lotgd/images/paypal1.gif b/lotgd-web/lotgd/images/paypal1.gif new file mode 100755 index 0000000..b8e0813 Binary files /dev/null and b/lotgd-web/lotgd/images/paypal1.gif differ diff --git a/lotgd-web/lotgd/images/paypal2.gif b/lotgd-web/lotgd/images/paypal2.gif new file mode 100755 index 0000000..a1339dd Binary files /dev/null and b/lotgd-web/lotgd/images/paypal2.gif differ diff --git a/lotgd-web/lotgd/images/paypal3.gif b/lotgd-web/lotgd/images/paypal3.gif new file mode 100755 index 0000000..1065efc Binary files /dev/null and b/lotgd-web/lotgd/images/paypal3.gif differ diff --git a/lotgd-web/lotgd/images/rule.gif b/lotgd-web/lotgd/images/rule.gif new file mode 100755 index 0000000..f997f46 Binary files /dev/null and b/lotgd-web/lotgd/images/rule.gif differ diff --git a/lotgd-web/lotgd/images/somerights20.gif b/lotgd-web/lotgd/images/somerights20.gif new file mode 100755 index 0000000..0860fa9 Binary files /dev/null and b/lotgd-web/lotgd/images/somerights20.gif differ diff --git a/lotgd-web/lotgd/images/title.gif b/lotgd-web/lotgd/images/title.gif new file mode 100755 index 0000000..445e3a3 Binary files /dev/null and b/lotgd-web/lotgd/images/title.gif differ diff --git a/lotgd-web/lotgd/images/trans.gif b/lotgd-web/lotgd/images/trans.gif new file mode 100755 index 0000000..35d42e8 Binary files /dev/null and b/lotgd-web/lotgd/images/trans.gif differ diff --git a/lotgd-web/lotgd/images/uscroll.GIF b/lotgd-web/lotgd/images/uscroll.GIF new file mode 100755 index 0000000..cce9357 Binary files /dev/null and b/lotgd-web/lotgd/images/uscroll.GIF differ diff --git a/lotgd-web/lotgd/index.php b/lotgd-web/lotgd/index.php new file mode 100755 index 0000000..f2b5340 --- /dev/null +++ b/lotgd-web/lotgd/index.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/inn.php b/lotgd-web/lotgd/inn.php new file mode 100755 index 0000000..7b4322b --- /dev/null +++ b/lotgd-web/lotgd/inn.php @@ -0,0 +1,70 @@ +"); + output_notl("`c`b"); + output($iname); + output_notl("`b`c"); +} + +$subop = httpget('subop'); + +$com = httpget('comscroll'); +$comment = httppost('insertcommentary'); + +require_once("lib/partner.php"); +$partner = get_partner(); +addnav("Other"); +villagenav(); +addnav("I?Return to the Inn","inn.php"); + +switch ($op) { + case "": case "strolldown": case "fleedragon": + require("lib/inn/inn_default.php"); + blocknav("inn.php"); + break; + case "converse": + commentdisplay("You stroll over to a table, place your foot up on the bench and listen in on the conversation:`n", "inn","Add to the conversation?",20); + break; + case "bartender": + require("lib/inn/inn_bartender.php"); + break; + case "room": + require("lib/inn/inn_room.php"); + break; +} + +if (!$skipinndesc) rawoutput(""); + +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/installer.php b/lotgd-web/lotgd/installer.php new file mode 100755 index 0000000..1b54b52 --- /dev/null +++ b/lotgd-web/lotgd/installer.php @@ -0,0 +1,142 @@ +0) + $stage = (int)httpget("stage"); +else + $stage = 0; +if (!isset($session['stagecompleted'])) $session['stagecompleted']=-1; +if ($stage > $session['stagecompleted']+1) $stage = $session['stagecompleted']; +if (!isset($session['dbinfo'])) $session['dbinfo']=array("DB_HOST"=>"","DB_USER"=>"","DB_PASS"=>"","DB_NAME"=>""); +if (file_exists("dbconnect.php") && ( + $stage==3 || + $stage==4 || + $stage==5 + )){ + output("`%This stage was completed during a previous installation."); + output("`2If you wish to perform stages 4 through 6 again, please delete the file named \"dbconnect.php\" from your site.`n`n"); + $stage=6; + } +if ($stage > $session['stagecompleted']) $session['stagecompleted'] = $stage; + +page_header("LoGD Installer — %s",$stages[$stage]); +switch($stage) { + case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9: case 10: + require_once("lib/installer/installer_stage_$stage.php"); + break; + default: + require_once("lib/installer/installer_stage_default.php"); + break; +} + + +if (!$noinstallnavs){ + if ($session['user']['loggedin']) addnav("Back to the game",$session['user']['restorepage']); + addnav("Install Stages"); + + for ($x=0; $x<=min(count($stages)-1,$session['stagecompleted']+1); $x++){ + if ($x == $stage) $stages[$x]="`^{$stages[$x]} <----"; + addnav($stages[$x],"installer.php?stage=$x"); + } +} +page_footer(false); + +?> diff --git a/lotgd-web/lotgd/lib/.htaccess b/lotgd-web/lotgd/lib/.htaccess new file mode 100755 index 0000000..dda4313 --- /dev/null +++ b/lotgd-web/lotgd/lib/.htaccess @@ -0,0 +1,3 @@ + +deny from all + diff --git a/lotgd-web/lotgd/lib/about/about_default.php b/lotgd-web/lotgd/lib/about/about_default.php new file mode 100755 index 0000000..a9b067e --- /dev/null +++ b/lotgd-web/lotgd/lib/about/about_default.php @@ -0,0 +1,100 @@ +"); + $impressum = getsetting("impressum", ""); + if ($impressum > "") { + require_once("lib/nltoappon.php"); + output_notl("%s", nltoappon($impressum)); + } + break; + case "1": + /* NOTICE + * NOTICE This section may not be modified, please modify the + * NOTICE Server Specific section above. + * NOTICE + */ + output("`@Legend of the Green Dragon`nBy Eric Stevens & JT Traub`n`n"); + output("`cLoGD version "); + output_notl("$logd_version`c"); + /* + * This section may not be modified, please modify the Server + * Specific section above. + */ + output("MightyE tells you, \"`2Legend of the Green Dragon is a remake of and homage to the classic BBS Door game, Legend of the Red Dragon (aka LoRD) by Seth Able Robinson.`@\"", true); + output("`n`n`@\"`2LoRD is now owned by Gameport (http://www.gameport.com/bbs/lord.html), and they retain exclusive rights to the LoRD name and game. ", true); + output("That's why all content in Legend of the Green Dragon is new, with only a very few nods to the original game, such as the buxom barmaid, Violet, and the handsome bard, Seth.`@\"`n`n"); + /* + * This section may not be modified, please modify the Server + * Specific section above. + */ + output("`@\"`2Although serious effort was made to preserve the original feel of the game, numerous departures were taken from the original game to enhance playability, and to adapt it to the web.`@\"`n`n"); + /* + * This section may not be modified, please modify the Server + * Specific section above. + */ + output("`@\"`2LoGD (after version 0.9.7) is released under a Creative Commons License, which essentially means that the source code to the game, and all derivatives of the game must remain open and available upon request.", true); + output("Version 0.9.7 and before are still available under the GNU General Public License though 0.9.7 will be the last release under that license.", true); + output("To use any of the new features requires using the 1.0.0 code. You may explicitly not place code from versions after 0.9.7 into 0.9.7 and release the combined derivative work under the GPL.`@\"`n`n", true); + /* + * This section may not be modified, please modify the Server + * Specific section above. + */ + output("`@\"`2You may download the latest official version of LoGD at DragonPrime and you can play the Classic version at http://lotgd.net.`@\"`n`n",true); + //output("`@\"`2The most recent *UNSTABLE* pre-release snapshot is available from http://dragonprime.net/users/Kendaer/.", true); + output("You should attempt to use this code only if you are comfortable with PHP and MySQL and willing to manually keep your code up to date.`@\"`n`n"); + /* + * This section may not be modified, please modify the Server + * Specific section above. + */ + output("`@\"`2Additionally, there is an active modder community located at DragonPrime which may help you find additional features which you may wish to add to your game.", true); + output("For these additional features you will find active support within the DragonPrime community.`@\"`n`n"); + /* + * This section may not be modified, please modify the Server + * Specific section above. + */ + output("`@\"`2LoGD is programmed in PHP with a MySQL backend."); + output("It is known to run on Windows and Linux with appropriate setups."); + output("The core code has been actively written by Eric Stevens and JT Traub, with some pieces by other authors (denoted in the source at these locations), and the code has been released under a Creative Commons License.", true); + output("Users of the source are bound to the terms therein.`n",true); + output("The DragonPrime Development Team took over responsibility for code development on January 1st, 2006 and continues to maintain and add to features of the core code.`@\"`n`n",true); + /* + * This section may not be modified, please modify the Server + * Specific section above. + */ + output("`@\"`2Users of the source are free to view and modify the source, but original copyright information, and original text from the about page must be preserved, though they may be added to.`@\"`n`n"); + output("`@\"`2We hope you enjoy the game!`@\""); + /* + * This section may not be modified, please modify the Server + * Specific section above. + */ + break; + } +} +addnav("About LoGD"); +addnav("Game Setup Info","about.php?op=setup"); +addnav("Module Info","about.php?op=listmodules"); +addnav("License Info", "about.php?op=license"); +modulehook("about"); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/about/about_license.php b/lotgd-web/lotgd/lib/about/about_license.php new file mode 100755 index 0000000..0e3b700 --- /dev/null +++ b/lotgd-web/lotgd/lib/about/about_license.php @@ -0,0 +1,37 @@ +http://creativecommons.org/licenses/by-nc-sa/2.0/legalcode and should be read and understood in detail before you use this code.`@\"`n`n", true); +output("`@\"`2This new license was chosen because of a failing with the GPL."); +output("It only covered distribution of source if and only if binaries were distributed.`@\"`n`n"); +output("`@\"`2In a web environment, specifically an interpreted web environment such as PHP, merely installing a game does not constitute distribution, and therefore people were taking our work, making modifications to it and not releasing the source code to their modifications so that the entire community could benefit."); +output("They worked with the letter but not the spirit of the law.`@\"`n`n"); +output("`@\"`2Investigation on the part of the authors however, led to the fact that the right of public performance was one of the rights normally restricted to copyright holders, AND that computer programs, specifically video games and interactive ones such as Legend of the Green Dragon were considered to be publically performed if run from a public server.`@\"`n`n"); +output("`@\"`2The new license restricts public performance of the work unless the source code of the modified work is made available on demand.`@\"`n`n"); +output("`@\"`2In plain English, this means that if you put this game on a web server and allow people 'outside of a normal circle of family and its social acquaintances' to play there, then you are publically performing this work and MUST either a) make any and ALL changes which you make to the game available on request (note this doesn't have to be available via the online source display link, but they must be able to ask you for the code AND receive a complete copy), b) make arrangements privately with the authors wherein they grant you a special license, or c) remove the code entirely from the machine.`@\"`n`n"); +output("`@\"`2We do recognize that people want to have areas of their game which are theirs and theirs alone."); +output("To that end we will make the following exception to the normal requirements for source code distribution -- any module file which is not modified or derived from a module file included in the base distribution AND which does not require any other modules AND which does not require any modifications to the core code (code distributed with the base release) may be withheld at the authors discretion.`@\"`n`n"); +output("`@\"`2We also want to make very clear that version 0.9.7 (also known as version 0.9.7+jt) was the final version released under the GPL."); +output("All versions, starting with the 0.9.8-prerelease code are only licensed under the Creative Commons license."); +output("We EXPLICITLY deny the right to import any code from a 0.9.8-prerelease or later release into a 0.9.7 and earlier release."); +output("Allowing this would cause that imported code to be released under the GPL and that is not something we wish to allow."); +output("Authors of modifications to 0.9.7 will need to re-release their modifications as derivatives/modifications to 0.9.8 code and place them under the same Creative Commons license."); +output("It must be done by the original author since only the original author has the right to change the copyright or license upon their work."); +output("[Additionally, reworking the modifications will be a good idea anyway as the mechanism for making modifications is substantially cleaner/clearer starting with the 0.9.8-prerelease code.]`@\""); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/about/about_listmodules.php b/lotgd-web/lotgd/lib/about/about_listmodules.php new file mode 100755 index 0000000..3a8bfab --- /dev/null +++ b/lotgd-web/lotgd/lib/about/about_listmodules.php @@ -0,0 +1,77 @@ +",true); +rawoutput("$mname$mver$mauth$mdown",true); +if (db_num_rows($result) == 0) { + rawoutput(""); + output("`i-- No modules installed --`i"); + rawoutput(""); +} +$cat = ""; +$i=0; +while ($row = db_fetch_assoc($result)) { + $i++; + if ($cat != $row['category']) { + rawoutput(""); + output($row['category']); + rawoutput(":"); + $cat = $row['category']; + } + + rawoutput(""); + rawoutput(""); + output_notl("`&%s`0", $row['formalname']); + rawoutput("",true); + output_notl("`^%s`0", $row['version']); + rawoutput(""); + output_notl("`^%s`0", $row['moduleauthor'], true); + rawoutput(""); + if ($row['download'] == "core_module") { + rawoutput(""); + output("Core Distribution"); + rawoutput(""); + } elseif ($row['download']) { + // We should check all legeal protocols + $protocols = array("http","https","ftp","ftps"); + $protocol = explode(":",$row['download'],2); + $protocol = $protocol[0]; + // This will take care of download strings such as: not publically released or contact admin + if (!in_array($protocol,$protocols)){ + output("`\$Contact Admin for Release"); + }else{ + rawoutput(""); + output("Download"); + rawoutput(""); + } + } else { + output("`\$Not publically released.`0"); + } + rawoutput(""); + rawoutput(""); +} +rawoutput(""); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/about/about_setup.php b/lotgd-web/lotgd/lib/about/about_setup.php new file mode 100755 index 0000000..a5bd45d --- /dev/null +++ b/lotgd-web/lotgd/lib/about/about_setup.php @@ -0,0 +1,88 @@ +"Enable Slay Other Players,viewonly", + "pvpday"=>"Player Fights per day,viewonly", + "pvpimmunity"=>"Days that new players are safe from PvP,viewonly", + "pvpminexp"=>"Amount of experience when players become killable in PvP,viewonly", + "soap"=>"Clean user posts (filters bad language and splits words over 45 chars long),viewonly", + "newplayerstartgold"=>"Amount of gold to start a new character with,viewonly", + "New Days,title", + "fightsforinterest"=>"Player must have fewer than how many forest fights to earn interest?,viewonly", + "maxinterest"=>"Max Interest Rate (%),viewonly", + "mininterest"=>"Min Interest Rate (%),viewonly", + "daysperday"=>"Game days per calendar day,viewonly", + "specialtybonus"=>"Extra daily uses in specialty area,viewonly", + + "Bank settings,title", + "borrowperlevel"=>"Max amount player can borrow per level,viewonly", + "allowgoldtransfer"=>"Are players allowed to transfer gold,viewonly", + "transferperlevel"=>"Max amount player can transfer per level of recipient (if transfers are enabled),viewonly", + "mintransferlev"=>"Minimum level a player has to be before they can transfer gold (if transfers are enabled),viewonly", + "transferreceive"=>"Total transfers a player can receive in one play day (if transfers are enabled),viewonly", + "maxtransferout"=>"Max amount total a player can transfer to others per level (if transfers are enabled),viewonly", + + "Forest,title", + "turns"=>"Forest Fights per day,viewonly", + "dropmingold"=>"Forest Creatures always drop at least 1/4 of possible gold,viewonly", + + "Mail Settings,title", + "mailsizelimit"=>"Message size limit per message,viewonly", + "inboxlimit"=>"Limit # of messages in inbox,viewonly", + "oldmail"=>"Automatically delete old messages after (days),viewonly", + + "Content Expiration,title", + "expirecontent"=>"Days to keep comments and news? (0 for infinite),viewonly", + "expiretrashacct"=>"Days to keep accounts that were never logged in to? (0 for infinite),viewonly", + "expirenewacct"=>"Days to keep level 1 accounts with no dragon kills? (0 for infinite),viewonly", + "expireoldacct"=>"Days to keep all other accounts? (0 for infinite),viewonly", + "LOGINTIMEOUT"=>"Seconds of inactivity before auto-logoff,viewonly" +); + +$useful = array( + "Useful Information,title", + "dayduration"=>"Day Duration,viewonly", + "curgametime"=>"Current game time,viewonly", + "curservertime"=>"Current Server Time,viewonly", + "lastnewday"=>"Last new day,viewonly", + "nextnewday"=>"Next new day,viewonly" +); + +$secstonextday = secondstonextgameday($details); +$useful_vals = array( + "dayduration"=>round(($details['dayduration']/60/60),0)." hours", + "curgametime"=>getgametime(), + "curservertime"=>date("Y-m-d h:i:s a"), + "lastnewday"=>date("h:i:s a",strtotime("-{$details['realsecssofartoday']} seconds")), + "nextnewday"=>date("h:i:s a",strtotime("+{$details['realsecstotomorrow']} seconds"))." (".date("H\\h i\\m s\\s",$secstonextday).")" +); + +output("`@

Settings for this game

`n`n",true); + +$args = array('settings'=>array(),'values'=>array()); +$args = modulehook("showsettings", $args); + +$form = array_merge($setup, $args['settings']); +$form = array_merge($form, $useful); +$vals = array_merge($settings, $args['values']); +$vals = array_merge($vals, $useful_vals); +showform($form,$vals,true); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/addnews.php b/lotgd-web/lotgd/lib/addnews.php new file mode 100755 index 0000000..688ed0e --- /dev/null +++ b/lotgd-web/lotgd/lib/addnews.php @@ -0,0 +1,87 @@ +0){ + $arguments=array(); + foreach($args as $key=>$val){ + if ($key==count($args)-1 && $val===true){ + //if the last argument is true, we're hiding from bio; + //don't put this in the array. + $hidefrombio=true; + }else{ + array_push($arguments,$val); + } + } + $arguments = serialize($arguments); + }else{ + $arguments=""; + } + if ($hidefrombio === true) $user = 0; + $sql = "INSERT INTO " . db_prefix("news") . + " (newstext,newsdate,accountid,arguments,tlschema) VALUES ('" . + addslashes($news) . "','" . date("Y-m-d H:i:s") . "'," . + $user .",'".addslashes($arguments)."','".$translation_namespace."')"; + return db_query($sql); +} + +?> diff --git a/lotgd-web/lotgd/lib/all_tables.php b/lotgd-web/lotgd/lib/all_tables.php new file mode 100755 index 0000000..d145cda --- /dev/null +++ b/lotgd-web/lotgd/lib/all_tables.php @@ -0,0 +1,1492 @@ +array( + 'acctid'=>array( + 'name'=>'acctid', 'type'=>'int(11) unsigned', 'extra'=>'auto_increment' + ), + 'name'=>array( + 'name'=>'name', 'type'=>'varchar(60)' + ), + 'sex'=>array( + 'name'=>'sex', 'type'=>'tinyint(4) unsigned', 'default'=>'0' + ), + 'specialty'=>array( + 'name'=>'specialty', 'type'=>'varchar(20)', + ), + 'experience'=>array( + 'name'=>'experience', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'gold'=>array( + 'name'=>'gold', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'weapon'=>array( + 'name'=>'weapon', 'type'=>'varchar(50)', 'default'=>'Fists' + ), + 'armor'=>array( + 'name'=>'armor', 'type'=>'varchar(50)', 'default'=>'T-Shirt' + ), + 'seenmaster'=>array( + 'name'=>'seenmaster', 'type'=>'int(4) unsigned', 'default'=>'0' + ), + 'level'=>array( + 'name'=>'level', 'type'=>'int(11) unsigned', 'default'=>'1' + ), + 'defense'=>array( + 'name'=>'defense', 'type'=>'int(11) unsigned', 'default'=>'1' + ), + 'attack'=>array( + 'name'=>'attack', 'type'=>'int(11) unsigned', 'default'=>'1' + ), + 'alive'=>array( + 'name'=>'alive', 'type'=>'int(11) unsigned', 'default'=>'1' + ), + 'goldinbank'=>array( + 'name'=>'goldinbank', 'type'=>'int(11)', 'default'=>'0' + ), + 'marriedto'=>array( + 'name'=>'marriedto', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'spirits'=>array( + 'name'=>'spirits', 'type'=>'int(4)', 'default'=>'0' + ), + 'laston'=>array( + 'name'=>'laston', 'type'=>'datetime', 'default'=>'0000-00-00 00:00:00' + ), + 'hitpoints'=>array( + 'name'=>'hitpoints', 'type'=>'int(11)', 'default'=>'10' + ), + 'maxhitpoints'=>array( + 'name'=>'maxhitpoints', 'type'=>'int(11) unsigned', 'default'=>'10' + ), + 'gems'=>array( + 'name'=>'gems', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'weaponvalue'=>array( + 'name'=>'weaponvalue', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'armorvalue'=>array( + 'name'=>'armorvalue', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'location'=>array( + 'name'=>'location', 'type'=>'varchar(25)', 'default'=>'Degolburg' + ), + 'turns'=>array( + 'name'=>'turns', 'type'=>'int(11) unsigned', 'default'=>'10' + ), + 'title'=>array( + 'name'=>'title', 'type'=>'varchar(25)' + ), + 'password'=>array( + 'name'=>'password', 'type'=>'varchar(32)' + ), + 'badguy'=>array( + 'name'=>'badguy', 'type'=>'text' + ), + 'companions'=>array( + 'name'=>'companions', 'type'=>'text' + ), + 'allowednavs'=>array( + 'name'=>'allowednavs', 'type'=>'mediumtext' + ), + 'loggedin'=>array( + 'name'=>'loggedin', 'type'=>'tinyint(4) unsigned', 'default'=>'0' + ), + 'resurrections'=>array( + 'name'=>'resurrections', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'superuser'=>array( + 'name'=>'superuser', 'type'=>'int(11) unsigned', 'default'=>'1' + ), + 'weapondmg'=>array( + 'name'=>'weapondmg', 'type'=>'int(11)', 'default'=>'0' + ), + 'armordef'=>array( + 'name'=>'armordef', 'type'=>'int(11)', 'default'=>'0' + ), + 'age'=>array( + 'name'=>'age', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'charm'=>array( + 'name'=>'charm', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'specialinc'=>array( + 'name'=>'specialinc', 'type'=>'varchar(50)' + ), + 'specialmisc'=>array( + 'name'=>'specialmisc', 'type'=>'text' + ), + 'login'=>array( + 'name'=>'login', 'type'=>'varchar(50)' + ), + 'lastmotd'=>array( + 'name'=>'lastmotd', + 'type'=>'datetime', + 'default'=>'0000-00-00 00:00:00' + ), + 'playerfights'=>array( + 'name'=>'playerfights', 'type'=>'int(11) unsigned', 'default'=>'3' + ), + 'lasthit'=>array( + 'name'=>'lasthit', 'type'=>'datetime', 'default'=>'0000-00-00 00:00:00' + ), + 'seendragon'=>array( + 'name'=>'seendragon', 'type'=>'tinyint(4) unsigned', 'default'=>'0' + ), + 'dragonkills'=>array( + 'name'=>'dragonkills', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'locked'=>array( + 'name'=>'locked', 'type'=>'tinyint(4) unsigned', 'default'=>'0' + ), + 'restorepage'=>array( + 'name'=>'restorepage', 'type'=>'varchar(128)', 'null'=>'1' + ), + 'hashorse'=>array( + 'name'=>'hashorse', 'type'=>'tinyint(4) unsigned', 'default'=>'0' + ), + 'bufflist'=>array( + 'name'=>'bufflist', 'type'=>'text' + ), + 'gentime'=>array( + 'name'=>'gentime', 'type'=>'double unsigned', 'default'=>'0' + ), + 'gentimecount'=>array( + 'name'=>'gentimecount', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'lastip'=>array( + 'name'=>'lastip', 'type'=>'varchar(40)' + ), + 'uniqueid'=>array( + 'name'=>'uniqueid', 'type'=>'varchar(32)', 'null'=>'1' + ), + 'dragonpoints'=>array( + 'name'=>'dragonpoints', 'type'=>'text' + ), + 'boughtroomtoday'=>array( + 'name'=>'boughtroomtoday', 'type'=>'tinyint(4)', 'default'=>'0' + ), + 'emailaddress'=>array( + 'name'=>'emailaddress', 'type'=>'varchar(128)' + ), + 'emailvalidation'=>array( + 'name'=>'emailvalidation', 'type'=>'varchar(32)' + ), + 'sentnotice'=>array( + 'name'=>'sentnotice', 'type'=>'int(11)', 'default'=>'0' + ), + 'prefs'=>array( + 'name'=>'prefs', 'type'=>'text' + ), + 'pvpflag'=>array( + 'name'=>'pvpflag', 'type'=>'datetime', 'default'=>'0000-00-00 00:00:00' + ), + 'transferredtoday'=>array( + 'name'=>'transferredtoday', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'soulpoints'=>array( + 'name'=>'soulpoints', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'gravefights'=>array( + 'name'=>'gravefights', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'hauntedby'=>array( + 'name'=>'hauntedby', 'type'=>'varchar(50)' + ), + 'deathpower'=>array( + 'name'=>'deathpower', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'gensize'=>array( + 'name'=>'gensize', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'recentcomments'=>array( + 'name'=>'recentcomments', + 'type'=>'datetime', + 'default'=>'0000-00-00 00:00:00' + ), + 'donation'=>array( + 'name'=>'donation', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'donationspent'=>array( + 'name'=>'donationspent', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'donationconfig'=>array( + 'name'=>'donationconfig', 'type'=>'text' + ), + 'referer'=>array( + 'name'=>'referer', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'refererawarded'=>array( + 'name'=>'refererawarded', 'type'=>'tinyint(1)', 'default'=>'0' + ), + 'bio'=>array( + 'name'=>'bio', 'type'=>'varchar(255)' + ), + 'race'=>array( + 'name'=>'race', 'type'=>'varchar(25)', 'default'=>'0' + ), + 'biotime'=>array( + 'name'=>'biotime', 'type'=>'datetime', 'default'=>'0000-00-00 00:00:00' + ), + 'banoverride'=>array( + 'name'=>'banoverride', + 'type'=>'tinyint(4)', + 'null'=>'1', + 'default'=>'0' + ), + 'buffbackup'=>array( + 'name'=>'buffbackup', 'type'=>'text', 'null'=>'1' + ), + 'amountouttoday'=>array( + 'name'=>'amountouttoday', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'pk'=>array( + 'name'=>'pk', 'type'=>'tinyint(3) unsigned', 'default'=>'0' + ), + 'dragonage'=>array( + 'name'=>'dragonage', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'bestdragonage'=>array( + 'name'=>'bestdragonage', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'ctitle'=>array( + 'name'=>'ctitle', 'type'=>'varchar(25)' + ), + 'beta'=>array( + 'name'=>'beta', 'type'=>'tinyint(3) unsigned', 'default'=>'0' + ), + 'slaydragon'=>array( + 'name'=>'slaydragon', 'type'=>'tinyint(4) unsigned', 'default'=>'0' + ), + 'fedmount'=>array( + 'name'=>'fedmount', 'type'=>'tinyint(4) unsigned', 'default'=>'0' + ), + 'regdate'=>array( + 'name'=>'regdate', + 'type'=>'datetime', + 'default'=>'0000-00-00 00:00:00' + ), + 'clanid'=>array( + 'name'=>'clanid', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'clanrank'=>array( + 'name'=>'clanrank', 'type'=>'tinyint(4) unsigned', 'default'=>'0' + ), + 'clanjoindate'=>array( + 'name'=>'clanjoindate', + 'type'=>'datetime', + 'default'=>'0000-00-00 00:00:00' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'acctid' + ), + 'key-name'=>array( + 'name'=>'name', 'type'=>'key', 'columns'=>'name' + ), + 'key-level'=>array( + 'name'=>'level', 'type'=>'key', 'columns'=>'level' + ), + 'key-login'=>array( + 'name'=>'login', 'type'=>'key', 'columns'=>'login' + ), + 'key-alive'=>array( + 'name'=>'alive', 'type'=>'key', 'columns'=>'alive' + ), + 'key-laston'=>array( + 'name'=>'laston', 'type'=>'key', 'columns'=>'laston' + ), + 'key-lasthit'=>array( + 'name'=>'lasthit', 'type'=>'key', 'columns'=>'lasthit' + ), + 'key-emailaddress'=>array( + 'name'=>'emailaddress', 'type'=>'key', 'columns'=>'emailaddress' + ), + 'key-clanid'=>array( + 'name'=>'clanid', 'type'=>'key', 'columns'=>'clanid' + ), + 'key-locked'=>array( + 'name'=>'locked', 'type'=>'key', 'columns'=>'locked,loggedin,laston' + ), + 'key-referer'=>array( + 'name'=>'referer', 'type'=>'key', 'columns'=>'referer' + ), + 'key-uniqueid'=>array( + 'name'=>'uniqueid', 'type'=>'key', 'columns'=>'uniqueid' + ), + 'key-emailvalidation'=>array( + 'name'=>'emailvalidation', 'type'=>'key', 'columns'=>'emailvalidation' + ), + ), + 'accounts_output'=>array( + 'acctid'=>array( + 'name'=>'acctid', 'type'=>'int(11) unsigned' + ), + 'output'=>array( + 'name'=>'output', 'type'=>'mediumtext' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'acctid' + ), + ), + 'companions'=>array( + 'companionid'=>array( + 'name'=>'companionid', 'type'=>'int(11) unsigned', 'extra'=>'auto_increment', + ), + 'name'=>array( + 'name'=>'name', 'type'=>'varchar(255)', 'null'=>'0' + ), + 'category'=>array( + 'name'=>'category', 'type'=>'varchar(255)', 'null'=>'0' + ), + 'description'=>array( + 'name'=>'description', 'type'=>'text', 'null'=>'0' + ), + 'attack'=>array( + 'name'=>'attack', 'type'=>'int(6) unsigned', 'null'=>'0', 'default'=>'1' + ), + 'attackperlevel'=>array( + 'name'=>'attackperlevel', 'type'=>'int(6) unsigned', 'null'=>'0', 'default'=>'0' + ), + 'defense'=>array( + 'name'=>'defense', 'type'=>'int(6) unsigned', 'null'=>'0', 'default'=>'1' + ), + 'defenseperlevel'=>array( + 'name'=>'defenseperlevel', 'type'=>'int(6) unsigned', 'null'=>'0', 'default'=>'0' + ), + 'maxhitpoints'=>array( + 'name'=>'maxhitpoints', 'type'=>'int(6) unsigned', 'null'=>'0', 'default'=>'10' + ), + 'maxhitpointsperlevel'=>array( + 'name'=>'maxhitpointsperlevel', 'type'=>'int(6) unsigned', 'null'=>'0', 'default'=>'10' + ), + 'abilities'=>array( + 'name'=>'abilities', 'type'=>'text', 'null'=>'0', 'default'=>'' + ), + 'cannotdie'=>array( + 'name'=>'cannotdie', 'type'=>'tinyint(4)', 'null'=>'0', 'default'=>'0' + ), + 'cannotbehealed'=>array( + 'name'=>'cannotbehealed', 'type'=>'tinyint(4)', 'null'=>'0', 'default'=>'1' + ), + 'companionlocation'=>array( + 'name'=>'companionlocation', 'type'=>'varchar(25)', 'default'=>'all' + ), + 'companionactive'=>array( + 'name'=>'companionactive', 'type'=>'tinyint(25)', 'default'=>'1' + ), + 'companioncostdks'=>array( + 'name'=>'companioncostdks', 'type'=>'tinyint(4)', 'default'=>'0' + ), + 'companioncostgems'=>array( + 'name'=>'companioncostgems', 'type'=>'int(6)', 'default'=>'0' + ), + 'companioncostgold'=>array( + 'name'=>'companioncostgold', 'type'=>'int(10)', 'default'=>'0' + ), + 'jointext'=>array( + 'name'=>'jointext', 'type'=>'text', 'default'=>'' + ), + 'dyingtext'=>array( + 'name'=>'dyingtext', 'type'=>'varchar(255)', 'default'=>'' + ), + 'allowinshades'=>array( + 'name'=>'allowinshades', 'type'=>'tinyint(4)', 'default'=>'0' + ), + 'allowinpvp'=>array( + 'name'=>'allowinpvp', 'type'=>'tinyint(4)', 'default'=>'0' + ), + 'allowintrain'=>array( + 'name'=>'allowintrain', 'type'=>'tinyint(4)', 'default'=>'0' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'companionid' + ), + ), + 'paylog'=>array( + 'payid'=>array( + 'name'=>'payid', 'type'=>'int(11)', 'null'=>'0', 'extra'=>'auto_increment' + ), + 'info'=>array( + 'name'=>'info', 'type'=>'text' + ), + 'response'=>array( + 'name'=>'response', 'type'=>'text', 'null'=>'0' + ), + 'txnid'=>array( + 'name'=>'txnid', 'type'=>'varchar(32)', 'null'=>'0' + ), + 'amount'=>array( + 'name'=>'amount', 'type'=>'float(9,2)', 'null'=>'0', 'default'=>'0.00' + ), + 'name'=>array( + 'name'=>'name', 'type'=>'varchar(50)', 'null'=>'0' + ), + 'acctid'=>array( + 'name'=>'acctid', 'type'=>'int(11) unsigned', 'null'=>'0', 'default'=>'0', + ), + 'processed'=>array( + 'name'=>'processed', 'type'=>'tinyint(4) unsigned', 'null'=>'0', + 'default'=>'0' + ), + 'filed'=>array( + 'name'=>'filed', 'type'=>'tinyint(4) unsigned', 'null'=>'0', + 'default'=>'0' + ), + 'txfee'=>array( + 'name'=>'txfee', 'type'=>'float(9,2)', 'null'=>'0', + 'default'=>'0.00' + ), + 'processdate'=>array( + 'name'=>'processdate', 'type'=>'datetime', 'default'=>'0000-00-00 00:00:00' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'payid' + ), + 'key-txnid'=>array( + 'name'=>'txnid', 'type'=>'key', 'columns'=>'txnid' + ), + ), + 'armor'=>array( + 'armorid'=>array( + 'name'=>'armorid', + 'type'=>'int(11) unsigned', + 'extra'=>'auto_increment' + ), + 'armorname'=>array( + 'name'=>'armorname', 'type'=>'varchar(128)', 'null'=>'1' + ), + 'value'=>array( + 'name'=>'value', 'type'=>'int(11)', 'default'=>'0' + ), + 'defense'=>array( + 'name'=>'defense', 'type'=>'int(11)', 'default'=>'1' + ), + 'level'=>array( + 'name'=>'level', 'type'=>'int(11)', 'default'=>'0' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'armorid' + ), + ), + 'bans'=>array( + 'ipfilter'=>array( + 'name'=>'ipfilter', 'type'=>'varchar(15)' + ), + 'uniqueid'=>array( + 'name'=>'uniqueid', 'type'=>'varchar(32)' + ), + 'banexpire'=>array( + 'name'=>'banexpire', 'type'=>'datetime', 'null'=>'1' + ), + 'banreason'=>array( + 'name'=>'banreason', 'type'=>'text' + ), + 'banner'=>array( + 'name'=>'banner', 'type'=>'varchar(50)' + ), + 'lasthit'=>array( + 'name'=>'lasthit', 'type'=>'datetime', 'default'=>'0000-00-00 00:00:00' + ), + 'key-banexpire'=>array( + 'name'=>'banexpire', 'type'=>'key', 'columns'=>'banexpire' + ), + 'key-uniqueid'=>array( + 'name'=>'uniqueid', 'type'=>'key', 'columns'=>'uniqueid' + ), + 'key-ipfilter'=>array( + 'name'=>'ipfilter', 'type'=>'key', 'columns'=>'ipfilter' + ), + ), + 'clans'=>array( + 'clanid'=>array( + 'name'=>'clanid', 'type'=>'int(11) unsigned', 'extra'=>'auto_increment' + ), + 'clanname'=>array( + 'name'=>'clanname', 'type'=>'varchar(255)' + ), + 'clanshort'=>array( + 'name'=>'clanshort', 'type'=>'varchar(5)' + ), + 'clanmotd'=>array( + 'name'=>'clanmotd', 'type'=>'text', 'null'=>'1' + ), + 'clandesc'=>array( + 'name'=>'clandesc', 'type'=>'text', 'null'=>'1' + ), + 'motdauthor'=>array( + 'name'=>'motdauthor', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'descauthor'=>array( + 'name'=>'descauthor', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'customsay'=>array( + 'name'=>'customsay', 'type'=>'varchar(15)' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'clanid' + ), + 'key-clanname'=>array( + 'name'=>'clanname', 'type'=>'key', 'columns'=>'clanname' + ), + 'key-clanshort'=>array( + 'name'=>'clanshort', 'type'=>'key', 'columns'=>'clanshort' + ) + ), + 'commentary'=>array( + 'commentid'=>array( + 'name'=>'commentid', + 'type'=>'int(11) unsigned', + 'extra'=>'auto_increment' + ), + 'section'=>array( + 'name'=>'section', 'type'=>'varchar(20)', 'null'=>'1' + ), + 'author'=>array( + 'name'=>'author', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'comment'=>array( + 'name'=>'comment', 'type'=>'varchar(200)' + ), + 'postdate'=>array( + 'name'=>'postdate', + 'type'=>'datetime', + 'default'=>'0000-00-00 00:00:00' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'commentid' + ), + 'key-section'=>array( + 'name'=>'section', 'type'=>'key', 'columns'=>'section' + ), + 'key-postdate'=>array( + 'name'=>'postdate', 'type'=>'key', 'columns'=>'postdate' + ) + ), + 'creatures'=>array( + 'creatureid'=>array( + 'name'=>'creatureid', 'type'=>'int(11)', 'extra'=>'auto_increment' + ), + 'creaturename'=>array( + 'name'=>'creaturename', 'type'=>'varchar(50)', 'null'=>'1' + ), + 'creaturelevel'=>array( + 'name'=>'creaturelevel', 'type'=>'int(11)', 'null'=>'1' + ), + 'creatureweapon'=>array( + 'name'=>'creatureweapon', 'type'=>'varchar(50)', 'null'=>'1' + ), + 'creaturelose'=>array( + 'name'=>'creaturelose', 'type'=>'varchar(120)', 'null'=>'1' + ), + 'creaturewin'=>array( + 'name'=>'creaturewin', 'type'=>'varchar(120)', 'null'=>'1' + ), + 'creaturegold'=>array( + 'name'=>'creaturegold', 'type'=>'int(11)', 'null'=>'1' + ), + 'creatureexp'=>array( + 'name'=>'creatureexp', 'type'=>'int(11)', 'null'=>'1' + ), + 'oldcreatureexp'=>array( + 'name'=>'oldcreatureexp', 'type'=>'int(11)', 'null'=>'1' + ), //this field is obsolete and will be dropped by the installer + 'creaturehealth'=>array( + 'name'=>'creaturehealth', 'type'=>'int(11)', 'null'=>'1' + ), + 'creatureattack'=>array( + 'name'=>'creatureattack', 'type'=>'int(11)', 'null'=>'1' + ), + 'creaturedefense'=>array( + 'name'=>'creaturedefense', 'type'=>'int(11)', 'null'=>'1' + ), + 'creatureaiscript'=>array( + 'name'=>'creatureaiscript', 'type'=>'text', 'null'=>'1' + ), + 'oldcreatureexp'=>array( + 'name'=>'oldcreatureexp', 'type'=>'int(11)', 'null'=>'1' + ), + 'createdby'=>array( + 'name'=>'createdby', 'type'=>'varchar(50)', 'null'=>'1' + ), + 'forest'=>array( + 'name'=>'forest', 'type'=>'tinyint(4)', 'default'=>'0' + ), + 'graveyard'=>array( + 'name'=>'graveyard', 'type'=>'tinyint(4)', 'default'=>'0' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'creatureid' + ), + 'key-creaturelevel'=>array( + 'name'=>'creaturelevel', 'type'=>'key', 'columns'=>'creaturelevel' + ) + ), + 'debuglog'=>array( + 'id'=>array( + 'name'=>'id', 'type'=>'int(11) unsigned', 'extra'=>'auto_increment' + ), + 'date'=>array( + 'name'=>'date', 'type'=>'datetime', 'default'=>'0000-00-00 00:00:00' + ), + 'actor'=>array( + 'name'=>'actor', 'type'=>'int(11) unsigned', 'null'=>'1' + ), + 'target'=>array( + 'name'=>'target', 'type'=>'int(11) unsigned', 'null'=>'1' + ), + 'message'=>array( + 'name'=>'message', 'type'=>'text' + ), + 'field'=>array( + 'name'=>'field', 'type'=>'varchar(20)', 'null'=>'0', 'default'=>'' + ), + 'value'=>array( + 'name'=>'value', 'type'=>'float(9,2)', 'null'=>'0', 'default'=>'0.00' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'id' + ), + 'key-date'=>array( + 'name'=>'date', 'type'=>'key', 'columns'=>'date' + ), + 'key-field'=>array( + 'name'=>'field', 'type'=>'key', 'columns'=>'actor,field' + ), + ), + 'faillog'=>array( + 'eventid'=>array( + 'name'=>'eventid', + 'type'=>'int(11) unsigned', + 'extra'=>'auto_increment' + ), + 'date'=>array( + 'name'=>'date', 'type'=>'datetime', 'default'=>'0000-00-00 00:00:00' + ), + 'post'=>array( + 'name'=>'post', 'type'=>'tinytext' + ), + 'ip'=>array( + 'name'=>'ip', 'type'=>'varchar(40)' + ), + 'acctid'=>array( + 'name'=>'acctid', 'type'=>'int(11) unsigned', 'null'=>'1' + ), + 'id'=>array( + 'name'=>'id', 'type'=>'varchar(32)' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'eventid' + ), + 'key-date'=>array( + 'name'=>'date', 'type'=>'key', 'columns'=>'date' + ), + 'key-acctid'=>array( + 'name'=>'acctid', 'type'=>'key', 'columns'=>'acctid' + ), + 'key-ip'=>array( + 'name'=>'ip', 'type'=>'key', 'columns'=>'ip' + ) + ), + 'gamelog'=>array( + 'logid'=>array( + 'name'=>'logid', + 'type'=>'int(11) unsigned', + 'extra'=>'auto_increment', + ), + 'message'=>array( + 'name'=>'message', + 'type'=>'text', + ), + 'category'=>array( + 'name'=>'category', + 'type'=>'varchar(50)', + ), + 'filed'=>array( + 'name'=>'filed', + 'type'=>'tinyint(4)', + 'default'=>'0', + ), + 'date'=>array( + 'name'=>'date', + 'type'=>'datetime', + 'default'=>'0000-00-00 00:00:00', + ), + 'who'=>array( + 'name'=>'who', + 'type'=>'int(11) unsigned', + 'default'=>'0', + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'logid', + ), + 'key-date'=>array( + 'name'=>'date', + 'type'=>'key', + 'columns'=>'category,date', + ), + ), + 'logdnetbans'=>array( + 'banid'=>array('name'=>'banid','type'=>'int(11) unsigned','extra'=>'auto_increment'), + 'bantype'=>array('name'=>'bantype','type'=>'varchar(20)'), + 'banvalue'=>array('name'=>'banvalue','type'=>'varchar(255)'), + 'key-PRIMARY'=>array('name'=>'PRIMARY','type'=>'PRIMARY KEY','unique'=>'1','columns'=>'banid'), + ), + 'logdnet'=>array( + 'serverid'=>array( + 'name'=>'serverid', + 'type'=>'int(11) unsigned', + 'extra'=>'auto_increment' + ), + 'address'=>array( + 'name'=>'address', 'type'=>'varchar(255)' + ), + 'description'=>array( + 'name'=>'description', 'type'=>'varchar(255)' + ), + 'priority'=>array( + 'name'=>'priority', 'type'=>'double', 'default'=>'100' + ), + 'lastupdate'=>array( + 'name'=>'lastupdate', + 'type'=>'datetime', + 'default'=>'0000-00-00 00:00:00' + ), + 'version'=>array( + 'name'=>'version', 'type'=>'varchar(255)', 'default'=>'Unknown' + ), + 'admin'=>array( + 'name'=>'admin', 'type'=>'varchar(255)', 'default'=>'unknown' + ), + 'lastping'=>array( + 'name'=>'lastping', + 'type'=>'datetime', + 'default'=>'0000-00-00 00:00:00' + ), + 'recentips'=>array( + 'name'=>'recentips', + 'type'=>'varchar(255)', + 'default'=>'', + ), + 'count'=>array( + 'name'=>'count', + 'type'=>'int(11) unsigned', + 'default'=>'0', + ), + 'lang'=>array( + 'name'=>'lang', + 'type'=>'varchar(20)', + 'default'=>'', + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'serverid' + ) + ), + 'mail'=>array( + 'messageid'=>array( + 'name'=>'messageid', + 'type'=>'int(11) unsigned', + 'extra'=>'auto_increment' + ), + 'msgfrom'=>array( + 'name'=>'msgfrom', 'type'=>'varchar(255)', 'default'=>'0' + ), + 'msgto'=>array( + 'name'=>'msgto', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'subject'=>array( + 'name'=>'subject', 'type'=>'varchar(255)' + ), + 'body'=>array( + 'name'=>'body', 'type'=>'text' + ), + 'sent'=>array( + 'name'=>'sent', 'type'=>'datetime', 'default'=>'0000-00-00 00:00:00' + ), + 'seen'=>array( + 'name'=>'seen', 'type'=>'tinyint(1)', 'default'=>'0' + ), + 'originator'=>array( + 'name'=>'originator', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'messageid' + ), + 'key-msgto'=>array( + 'name'=>'msgto', 'type'=>'key', 'columns'=>'msgto' + ), + 'key-seen'=>array( + 'name'=>'seen', 'type'=>'key', 'columns'=>'seen' + ) + ), + 'masters'=>array( + 'creatureid'=>array( + 'name'=>'creatureid', + 'type'=>'int(11) unsigned', + 'extra'=>'auto_increment' + ), + 'creaturename'=>array( + 'name'=>'creaturename', 'type'=>'varchar(50)', 'null'=>'1' + ), + 'creaturelevel'=>array( + 'name'=>'creaturelevel', 'type'=>'int(11)', 'null'=>'1' + ), + 'creatureweapon'=>array( + 'name'=>'creatureweapon', 'type'=>'varchar(50)', 'null'=>'1' + ), + 'creaturelose'=>array( + 'name'=>'creaturelose', 'type'=>'varchar(120)', 'null'=>'1' + ), + 'creaturewin'=>array( + 'name'=>'creaturewin', 'type'=>'varchar(120)', 'null'=>'1' + ), + 'creaturegold'=>array( + 'name'=>'creaturegold', 'type'=>'int(11)', 'null'=>'1' + ), + 'creatureexp'=>array( + 'name'=>'creatureexp', 'type'=>'int(11)', 'null'=>'1' + ), + 'creaturehealth'=>array( + 'name'=>'creaturehealth', 'type'=>'int(11)', 'null'=>'1' + ), + 'creatureattack'=>array( + 'name'=>'creatureattack', 'type'=>'int(11)', 'null'=>'1' + ), + 'creaturedefense'=>array( + 'name'=>'creaturedefense', 'type'=>'int(11)', 'null'=>'1' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'creatureid' + ) + ), + 'moderatedcomments'=>array( + 'modid'=>array( + 'name'=>'modid', 'type'=>'int(11) unsigned', 'extra'=>'auto_increment' + ), + 'comment'=>array( + 'name'=>'comment', 'type'=>'text', 'null'=>'1' + ), + 'moderator'=>array( + 'name'=>'moderator', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'moddate'=>array( + 'name'=>'moddate', 'type'=>'datetime', 'default'=>'0000-00-00 00:00:00' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'modid' + ) + ), + 'module_event_hooks'=>array( + 'event_type'=>array( + 'name'=>'event_type', 'type'=>'varchar(20)' + ), + 'modulename'=>array( + 'name'=>'modulename', 'type'=>'varchar(50)' + ), + 'event_chance'=>array( + 'name'=>'event_chance', 'type'=>'text' + ), + 'key-modulename'=>array( + 'name'=>'modulename', 'type'=>'key', 'columns'=>'modulename' + ), + 'key-event_type'=>array( + 'name'=>'event_type', 'type'=>'key', 'columns'=>'event_type' + ) + ), + 'module_hooks'=>array( + 'modulename'=>array( + 'name'=>'modulename', 'type'=>'varchar(50)' + ), + 'location'=>array( + 'name'=>'location', 'type'=>'varchar(50)' + ), + 'function'=>array( + 'name'=>'function', 'type'=>'varchar(50)' + ), + 'whenactive'=>array( + 'name'=>'whenactive', 'type'=>'text' + ), + 'priority'=>array( + 'name'=>'priority','type'=>'int(11)','default'=>'50' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'modulename,location,function' + ), + 'key-location'=>array( + 'name'=>'location', 'type'=>'key', 'columns'=>'location' + ), + ), + 'module_objprefs'=>array( + 'modulename'=>array( + 'name'=>'modulename', 'type'=>'varchar(50)' + ), + 'objtype'=>array( + 'name'=>'objtype', 'type'=>'varchar(50)' + ), + 'setting'=>array( + 'name'=>'setting', 'type'=>'varchar(50)' + ), + 'objid'=>array( + 'name'=>'objid', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'value'=>array( + 'name'=>'value', 'type'=>'text', 'null'=>'1' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'modulename,objtype,setting,objid' + ) + ), + + 'module_settings'=>array( + 'modulename'=>array( + 'name'=>'modulename', 'type'=>'varchar(50)' + ), + 'setting'=>array( + 'name'=>'setting', 'type'=>'varchar(50)' + ), + 'value'=>array( + 'name'=>'value', 'type'=>'text', 'null'=>'1' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'modulename,setting' + ) + ), + 'module_userprefs'=>array( + 'modulename'=>array( + 'name'=>'modulename', 'type'=>'varchar(50)' + ), + 'setting'=>array( + 'name'=>'setting', 'type'=>'varchar(50)' + ), + 'userid'=>array( + 'name'=>'userid', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'value'=>array( + 'name'=>'value', 'type'=>'text', 'null'=>'1' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'modulename,setting,userid' + ), + 'key-modulename'=>array( + 'name'=>'modulename', 'type'=>'key', 'columns'=>'modulename,userid' + ), + 'key-userid'=>array( // Speed up char deletion, takes a lot of space, though + 'name'=>'userid', 'type'=>'key', 'columns'=>'userid' + ), + ), + 'modules'=>array( + 'modulename'=>array( + 'name'=>'modulename', 'type'=>'varchar(50)' + ), + 'formalname'=>array( + 'name'=>'formalname', 'type'=>'varchar(255)' + ), + 'description'=>array( + 'name'=>'description', 'type'=>'text' + ), + 'moduleauthor'=>array( + 'name'=>'moduleauthor', 'type'=>'varchar(255)' + ), + 'active'=>array( + 'name'=>'active', 'type'=>'tinyint(4)', 'default'=>'0' + ), + 'filename'=>array( + 'name'=>'filename', 'type'=>'varchar(255)' + ), + 'installdate'=>array( + 'name'=>'installdate', + 'type'=>'datetime', + 'default'=>'0000-00-00 00:00:00' + ), + 'installedby'=>array( + 'name'=>'installedby', 'type'=>'varchar(50)' + ), + 'filemoddate'=>array( + 'name'=>'filemoddate', + 'type'=>'datetime', + 'default'=>'0000-00-00 00:00:00' + ), + 'type'=>array( + 'name'=>'type', 'type'=>'tinyint(4)', 'default'=>'0' + ), + 'extras'=>array( + 'name'=>'extras', 'type'=>'text', 'null'=>'1' + ), + 'category'=>array( + 'name'=>'category', 'type'=>'varchar(50)' + ), + 'infokeys'=>array( + 'name'=>'infokeys', 'type'=>'text' + ), + 'version'=>array( + 'name'=>'version', 'type'=>'varchar(10)', 'null'=>'1' + ), + 'download'=>array( + 'name'=>'download', 'type'=>'varchar(200)', 'null'=>'1' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'modulename' + ) + ), + 'motd'=>array( + 'motditem'=>array( + 'name'=>'motditem', + 'type'=>'int(11) unsigned', + 'extra'=>'auto_increment' + ), + 'motdtitle'=>array( + 'name'=>'motdtitle', 'type'=>'varchar(200)', 'null'=>'1' + ), + 'motdbody'=>array( + 'name'=>'motdbody', 'type'=>'text', 'null'=>'1' + ), + 'motddate'=>array( + 'name'=>'motddate', 'type'=>'datetime', 'null'=>'1' + ), + 'motdtype'=>array( + 'name'=>'motdtype', 'type'=>'tinyint(4) unsigned', 'default'=>'0' + ), + 'motdauthor'=>array( + 'name'=>'motdauthor', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'motditem' + ) + ), + 'mounts'=>array( + 'mountid'=>array( + 'name'=>'mountid', + 'type'=>'int(11) unsigned', + 'extra'=>'auto_increment' + ), + 'mountname'=>array( + 'name'=>'mountname', 'type'=>'varchar(50)' + ), + 'mountdesc'=>array( + 'name'=>'mountdesc', 'type'=>'text', 'null'=>'1' + ), + 'mountcategory'=>array( + 'name'=>'mountcategory', 'type'=>'varchar(50)' + ), + 'mountbuff'=>array( + 'name'=>'mountbuff', 'type'=>'text', 'null'=>'1' + ), + 'mountcostgems'=>array( + 'name'=>'mountcostgems', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'mountcostgold'=>array( + 'name'=>'mountcostgold', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'mountactive'=>array( + 'name'=>'mountactive', 'type'=>'int(11) unsigned', 'default'=>'1' + ), + 'mountforestfights'=>array( + 'name'=>'mountforestfights', 'type'=>'int(11)', 'default'=>'0' + ), + 'newday'=>array( + 'name'=>'newday', 'type'=>'text' + ), + 'recharge'=>array( + 'name'=>'recharge', 'type'=>'text' + ), + 'partrecharge'=>array( + 'name'=>'partrecharge', 'type'=>'text' + ), + 'mountfeedcost'=>array( + 'name'=>'mountfeedcost', 'type'=>'int(11) unsigned', 'default'=>'20' + ), + 'mountlocation'=>array( + 'name'=>'mountlocation', 'type'=>'varchar(25)', 'default'=>'all' + ), + 'mountdkcost'=>array( + 'name'=>'mountdkcost', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'mountid' + ), + 'key-mountid'=>array( + 'name'=>'mountid', 'type'=>'key', 'columns'=>'mountid' + ) + ), + 'nastywords'=>array( + 'words'=>array( + 'name'=>'words', 'type'=>'text', 'null'=>'1' + ), + 'type'=>array( + 'name'=>'type', 'type'=>'varchar(10)', 'null'=>'1' + ) + ), + 'news'=>array( + 'newsid'=>array( + 'name'=>'newsid', 'type'=>'int(11) unsigned', 'extra'=>'auto_increment' + ), + 'newstext'=>array( + 'name'=>'newstext', 'type'=>'text' + ), + 'newsdate'=>array( + 'name'=>'newsdate', 'type'=>'date', 'default'=>'0000-00-00' + ), + 'accountid'=>array( + 'name'=>'accountid', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'arguments'=>array( + 'name'=>'arguments', 'type'=>'text' + ), + 'tlschema'=>array( + 'name'=>'tlschema', 'type'=>'varchar(255)', 'default'=>'news' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'newsid,newsdate' + ), + 'key-accountid'=>array( + 'name'=>'accountid', 'type'=>'key', 'columns'=>'accountid' + ), + 'key-newsdate'=>array( + 'name'=>'newsdate', 'type'=>'key', 'columns'=>'newsdate' + ), + ), + 'petitions'=>array( + 'petitionid'=>array( + 'name'=>'petitionid', + 'type'=>'int(11) unsigned', + 'extra'=>'auto_increment' + ), + 'author'=>array( + 'name'=>'author', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'date'=>array( + 'name'=>'date', 'type'=>'datetime', 'default'=>'0000-00-00 00:00:00' + ), + 'status'=>array( + 'name'=>'status', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'body'=>array( + 'name'=>'body', 'type'=>'text', 'null'=>'1' + ), + 'pageinfo'=>array( + 'name'=>'pageinfo', 'type'=>'text', 'null'=>'1' + ), + 'closedate'=>array( + 'name'=>'closedate', + 'type'=>'datetime', + 'default'=>'0000-00-00 00:00:00' + ), + 'closeuserid'=>array( + 'name'=>'closeuserid', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'ip'=>array( + 'name'=>'ip', 'type'=>'varchar(40)', 'default'=>'' + ), + 'id'=>array( + 'name'=>'id', 'type'=>'varchar(32)', 'default'=>'' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'petitionid' + ) + ), + 'pollresults'=>array( + 'resultid'=>array( + 'name'=>'resultid', + 'type'=>'int(11) unsigned', + 'extra'=>'auto_increment' + ), + 'choice'=>array( + 'name'=>'choice', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'account'=>array( + 'name'=>'account', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'motditem'=>array( + 'name'=>'motditem', 'type'=>'int(11) unsigned', 'default'=>'0' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'resultid' + ) + ), + 'referers'=>array( + // This table needs to be myISAM since pre-4.0.14 mysql cannot index + // on blob tables under innoDB and we have no way to determine + // with 100% accuracy (mysql_get_server_info merely returns an + // arbitrary string) what the version of the database is. :/ + 'RequireMyISAM'=>1, + 'refererid'=>array( + 'name'=>'refererid', + 'type'=>'int(11) unsigned', + 'extra'=>'auto_increment' + ), + 'uri'=>array( + 'name'=>'uri', 'type'=>'text', 'null'=>'1' + ), + 'count'=>array( + 'name'=>'count', 'type'=>'int(11)', 'null'=>'1' + ), + 'last'=>array( + 'name'=>'last', 'type'=>'datetime', 'null'=>'1' + ), + 'site'=>array( + 'name'=>'site', 'type'=>'varchar(50)' + ), + 'dest'=>array( + 'name'=>'dest', 'type'=>'varchar(255)', 'null'=>'1' + ), + 'ip'=>array( + 'name'=>'ip', 'type'=>'varchar(40)', 'null'=>'1' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'refererid' + ), + 'key-uri'=>array( + 'name'=>'uri', 'type'=>'key', 'columns'=>'uri(100)' + ), + 'key-site'=>array( + 'name'=>'site', 'type'=>'key', 'columns'=>'site' + ) + ), + 'settings'=>array( + 'setting'=>array( + 'name'=>'setting', 'type'=>'varchar(20)' + ), + 'value'=>array( + 'name'=>'value', 'type'=>'varchar(255)' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'setting' + ) + ), + 'taunts'=>array( + 'tauntid'=>array( + 'name'=>'tauntid', + 'type'=>'int(11) unsigned', + 'extra'=>'auto_increment' + ), + 'taunt'=>array( + 'name'=>'taunt', 'type'=>'text', 'null'=>'1' + ), + 'editor'=>array( + 'name'=>'editor', 'type'=>'varchar(50)', 'null'=>'1' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'tauntid' + ) + ), + 'untranslated'=>array( + // This table needs to be myISAM since pre-4.0.14 mysql cannot index + // on blob tables under innoDB and we have no way to determine + // with 100% accuracy (mysql_get_server_info merely returns an + // arbitrary string) what the version of the database is. :/ + 'RequireMyISAM'=>1, + 'intext'=>array( + 'name'=>'intext', 'type'=>'blob', 'null'=>'0' + ), + 'language'=>array( + 'name'=>'language', 'type'=>'varchar(10)' + ), + 'namespace'=>array( + 'name'=>'namespace', 'type'=>'varchar(255)' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'intext(200),language,namespace' + ), + 'key-language'=>array( + 'name'=>'language', 'type'=>'key', 'columns'=>'language' + ), + 'key-intext1'=>array( + 'name'=>'intext1', 'type'=>'key', 'columns'=>'intext(200),language' + ), + ), + 'translations'=>array( + 'tid'=>array( + 'name'=>'tid', 'type'=>'int(11)', 'extra'=>'auto_increment' + ), + 'language'=>array( + 'name'=>'language', 'type'=>'varchar(10)' + ), + 'uri'=>array( + 'name'=>'uri', 'type'=>'varchar(255)' + ), + 'intext'=>array( + 'name'=>'intext', 'type'=>'blob' + ), + 'outtext'=>array( + 'name'=>'outtext', 'type'=>'blob' + ), + 'author'=>array( + 'name'=>'author', 'type'=>'varchar(50)', 'null'=>'1' + ), + 'version'=>array( + 'name'=>'version', 'type'=>'varchar(50)', 'null'=>'1' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'tid' + ), + 'key-language'=>array( + 'name'=>'language', 'type'=>'key', 'columns'=>'language,uri' + ), + 'key-uri'=>array( + 'name'=>'uri', 'type'=>'key', 'columns'=>'uri' + ), + ), + 'weapons'=>array( + 'weaponid'=>array( + 'name'=>'weaponid', + 'type'=>'int(11) unsigned', + 'extra'=>'auto_increment' + ), + 'weaponname'=>array( + 'name'=>'weaponname', 'type'=>'varchar(128)', 'null'=>'1' + ), + 'value'=>array( + 'name'=>'value', 'type'=>'int(11)', 'default'=>'0' + ), + 'damage'=>array( + 'name'=>'damage', 'type'=>'int(11)', 'default'=>'1' + ), + 'level'=>array( + 'name'=>'level', 'type'=>'int(11)', 'default'=>'0' + ), + 'key-PRIMARY'=>array( + 'name'=>'PRIMARY', + 'type'=>'primary key', + 'unique'=>'1', + 'columns'=>'weaponid' + ) + ), + 'titles'=>array( + 'titleid'=>array( + 'name'=>'titleid', 'type'=>'int(11) unsigned', + 'extra'=>'auto_increment' + ), + 'dk'=>array( + 'name'=>'dk', 'type'=>'int(11)', 'default'=>'0' + ), + 'ref'=>array( + 'name'=>'ref', 'type'=>'varchar(100)', 'null'=>'0', 'default'=>"" + ), + 'male'=>array( + 'name'=>'male', 'type'=>'varchar(25)', 'null'=>'0', 'default'=>"" + ), + 'female'=>array( + 'name'=>'female', 'type'=>'varchar(25)', 'null'=>'0', 'default'=>"" + ), + 'key-PRIMARY' => array( + 'name' => 'PRIMARY', + 'type' => 'primary key', + 'unique' => '1', + 'columns' => 'titleid', + ), + 'key-dk' => array( + 'name' => 'dk', + 'type' => 'key', + 'columns' => 'dk', + ), + ), +); +} +?> + diff --git a/lotgd-web/lotgd/lib/arraytourl.php b/lotgd-web/lotgd/lib/arraytourl.php new file mode 100755 index 0000000..01e6f22 --- /dev/null +++ b/lotgd-web/lotgd/lib/arraytourl.php @@ -0,0 +1,54 @@ + array functions + * + * @copyright Copyright © 2002-2005, Eric Stevens & JT Traub, © 2006-2009, Dragonprime Development Team + * @version Lotgd 1.1.2 DragonPrime Edition + * @package Core + * @subpackage Library + * @license http://creativecommons.org/licenses/by-nc-sa/2.0/legalcode + */ +/** + * Turns an array into an URL argument string + * + * Takes an array and encodes it in key=val&key=val form. + * Does not add starting ? + * + * @param array $array The array to turn into an URL + * @return string The URL + */ +function arraytourl($array){ + //takes an array and encodes it in key=val&key=val form. + $url=""; + $i=0; + foreach($array as $key=>$val){ + if ($i>0) $url.="&"; + $i++; + $url.=rawurlencode($key)."=".rawurlencode($val); + } + return $url; +} +/** + * Takes an array and returns its arguments in an array + * + * @param string $url The URL + * @return array The arguments from the URL + */ +function urltoarray($url){ + //takes a URL and returns its arguments in array form. + if (strpos($url,"?")!==false){ + $url = substr($array,strpos($url,"?")+1); + } + $a = explode("&",$url); + $array = array(); + foreach($a as $val){ + $b = explode("=",$val); + $array[urldecode($b[0])] = urldecode($b[1]); + } + return $array; +} + +?> diff --git a/lotgd-web/lotgd/lib/arrayutil.php b/lotgd-web/lotgd/lib/arrayutil.php new file mode 100755 index 0000000..acd1a9d --- /dev/null +++ b/lotgd-web/lotgd/lib/arrayutil.php @@ -0,0 +1,39 @@ + diff --git a/lotgd-web/lotgd/lib/battle-buffs.php b/lotgd-web/lotgd/lib/battle-buffs.php new file mode 100755 index 0000000..a3bf476 --- /dev/null +++ b/lotgd-web/lotgd/lib/battle-buffs.php @@ -0,0 +1,348 @@ +$buff) { + if (array_key_exists('suspended',$buff) && $buff['suspended']) continue; + if ($buff['schema']) tlschema($buff['schema']); + if (isset($buff['startmsg'])) { + if (is_array($buff['startmsg'])) { + $buff['startmsg'] = str_replace("`%", "`%%", $buff['startmsg']); + $msg = sprintf_translate($buff['startmsg']); + $msg = substitute("`5".$msg."`0`n"); + output_notl($msg); //Here it's already translated + }else{ + $msg = substitute_array("`5".$buff['startmsg']."`0`n"); + output($msg); + } + unset($session['bufflist'][$key]['startmsg']); + } + + // Figure out activate based on buff features + $activate = false; + if ($tag == "roundstart") { + if (isset($buff['regen'])) $activate = true; + if (isset($buff['minioncount'])) $activate = true; + } else if ($tag == "offense") { + if (isset($buff['invulnerable']) && $buff['invulnerable']) + $activate = true; + if (isset($buff['atkmod'])) $activate = true; + if (isset($buff['dmgmod'])) $activate = true; + if (isset($buff['badguydefmod'])) $activate = true; + if (isset($buff['lifetap'])) $activate = true; + if (isset($buff['damageshield'])) $activate = true; + } else if ($tag == "defense") { + if (isset($buff['invulnerable']) && $buff['invulnerable']) + $activate = true; + if (isset($buff['defmod'])) $activate = true; + if (isset($buff['badguyatkmod'])) $activate = true; + if (isset($buff['badguydmgmod'])) $activate = true; + if (isset($buff['lifetap'])) $activate = true; + if (isset($buff['damageshield'])) $activate = true; + } + + // If this should activate now and it hasn't already activated, + // do the round message and mark it. + if ($activate && (!array_key_exists('used',$buff) || !$buff['used'])) { + // mark it used. + $session['bufflist'][$key]['used'] = 1; + // if it has a 'round message', run it. + if (isset($buff['roundmsg'])) { + if (is_array($buff['roundmsg'])) { + $buff['roundmsg'] = str_replace("`%", "`%%", $buff['roundmsg']); + $msg = sprintf_translate($buff['roundmsg']); + $msg = substitute("`5".$msg."`0`n"); + output_notl($msg); //Here it's already translated + }else{ + $msg = substitute_array("`5".$buff['roundmsg']."`0`n"); + output($msg); + } + } + } + + // Now, calculate any effects and run them if needed. + if (isset($buff['invulnerable']) && $buff['invulnerable']) { + $result['invulnerable'] = 1; + } + if (isset($buff['atkmod'])) { + $result['atkmod'] *= $buff['atkmod']; + if (isset($buff['aura']) && $buff['aura']) { + $result['compatkmod'] *= $buff['atkmod']; + } + } + if (isset($buff['badguyatkmod'])) { + $result['badguyatkmod'] *= $buff['badguyatkmod']; + } + if (isset($buff['defmod'])) { + $result['defmod'] *= $buff['defmod']; + if (isset($buff['aura']) && $buff['aura']) { + $result['compdefmod'] *= $buff['defmod']; + } + } + if (isset($buff['badguydefmod'])) { + $result['badguydefmod'] *= $buff['badguydefmod']; + } + if (isset($buff['dmgmod'])) { + $result['dmgmod'] *= $buff['dmgmod']; + if (isset($buff['aura']) && $buff['aura']) { + $result['compdmgmod'] *= $buff['dmgmod']; + } + } + if (isset($buff['badguydmgmod'])) { + $result['badguydmgmod'] *= $buff['badguydmgmod']; + } + if (isset($buff['lifetap'])) { + array_push($result['lifetap'], $buff); + } + if (isset($buff['damageshield'])) { + array_push($result['dmgshield'], $buff); + } + if (isset($buff['regen']) && $tag == "roundstart" && $badguy['istarget'] == true) { + $hptoregen = (int)$buff['regen']; + $hpdiff = $session['user']['maxhitpoints'] - $session['user']['hitpoints']; + // Don't regen if we are above max hp + if ($hpdiff < 0) $hpdiff = 0; + if ($hpdiff < $hptoregen) $hptoregen = $hpdiff; + $session['user']['hitpoints'] += $hptoregen; + // Now, take abs value just incase this was a damaging buff + $hptoregen = abs($hptoregen); + if ($hptoregen == 0) $msg = $buff['effectnodmgmsg']; + else $msg = $buff['effectmsg']; + + if (is_array($msg)) { + $msg = sprintf_translate($msg); + $msg = substitute("`)".$msg."`0`n", array("{damage}"), array($hptoregen)); + output_notl($msg); //Here it's already translated + }elseif ($msg!="") { + $msg = substitute_array("`)".$msg."`0`n", array("{damage}"), array($hptoregen)); + output($msg); + } + if (isset($buff['aura']) && $buff['aura'] == true) { + global $companions; + $auraeffect = (int)round($buff['regen']/3); + if (is_array($companions) && count($companions)>0 && $auraeffect != 0) { + foreach ($companions as $name => $companion) { + $unset = false; + // Need this for 0 || ($companion['cannotdie'] == true && $auraeffect > 0))) { + $hptoregen = min($auraeffect, $companion['maxhitpoints']-$companion['hitpoints']); + $companion['hitpoints'] += $hptoregen; + $msg = substitute_array("`)".$buff['auramsg']."`0`n", array("{damage}","{companion}"),array($hptoregen,$companion['name'])); + output($msg); + if ($hptoregen < 0 && $companion['hitpoints'] <= 0) { + if (isset($companion['dyingtext'])) { + tlschema("battle"); + output($companion['dyingtext']); + tlschema(); + } + if (isset($companion['cannotdie']) && $companion['cannotdie'] == true) { + $companion['hitpoints'] = 0; + } else { + $unset = true; + } + } + } + if (!$unset) $newcompanions[$name] = $companion; + } + $companions = $newcompanions; // Seemed to need this... + } + } + } + if (isset($buff['minioncount']) && $tag == "roundstart" && ((isset($buff['areadamage']) && $buff['areadamage'] == true) || $badguy['istarget'] == true) && $badguy['dead'] == false) { + $who = -1; + if (isset($buff['maxbadguydamage']) && + $buff['maxbadguydamage'] <> 0) { + $max = $buff['maxbadguydamage']; + $min = isset($buff['minbadguydamage'])?$buff['minbadguydamage']:0; + $who = 0; + } else { + $max = isset($buff['maxgoodguydamage'])?$buff['maxgoodguydamage']:0; + $min = isset($buff['mingoodguydamage'])?$buff['mingoodguydamage']:0; + $who = 1; + } + $minioncounter = 1; + while ($minioncounter <= $buff['minioncount'] && $who >= 0) { + $damage = e_rand($min, $max); + if ($who == 0) { + $badguy['creaturehealth'] -= $damage; + if ($badguy['creaturehealth'] <= 0) { + $badguy['istarget'] = false; + $badguy['dead'] = true; + $count = 1; + } + } else if ($who == 1) { + $session['user']['hitpoints'] -= $damage; + } + if ($damage < 0) { + $msg = $buff['effectfailmsg']; + } else if ($damage == 0) { + $msg = $buff['effectnodmgmsg']; + } else if ($damage > 0) { + $msg = $buff['effectmsg']; + } + if (is_array($msg)) { + $msg = sprintf_translate($msg); + $msg = substitute("`)".$msg."`0`n", array("{damage}"), array(abs($damage))); + output_notl($msg); //Here it's already translated + }else if ($msg>"") { + $msg = substitute_array("`)".$msg."`0`n", array("{damage}"), array(abs($damage))); + output($msg); + } + if ($badguy['dead'] == true) break; + $minioncounter++; + } + } + if ($buff['schema']) tlschema(); + } + tlschema(); + return $result; +} + +function process_lifetaps($ltaps, $damage) { + global $session, $badguy; + tlschema("buffs"); + foreach($ltaps as $buff) { + if (isset($buff['suspended']) && $buff['suspended']) continue; + if ($buff['schema']) tlschema($buff['schema']); + $healhp = $session['user']['maxhitpoints'] - $session['user']['hitpoints']; + if ($healhp < 0) { + $healhp = 0; + } + if ($healhp == 0) { + $msg = isset($buff['effectnodmgmsg'])?$buff['effectnodmgmsg']:""; + } else { + if ($healhp > $damage * $buff['lifetap']) { + $healhp = round($damage * $buff['lifetap'], 0); + } + if ($healhp < 0) { + $healhp = 0; + } + if ($healhp > 0) { + $msg = isset($buff['effectmsg'])?$buff['effectmsg']:""; + } else if ($healhp == 0) { + $msg = isset($buff['effectfailmsg'])?$buff['effectfailmsg']:""; + } + } + $session['user']['hitpoints'] += $healhp; + if (is_array($msg)) { + $msg = sprintf_translate($msg); + $msg = substitute("`)".$msg."`0`n", array("{damage}"), array($healhp)); + output_notl($msg); //Here it's already translated + }else if ($msg>"") { + $msg = substitute_array("`)".$msg."`0`n", array("{damage}"), array($healhp)); + output($msg); + } + if ($buff['schema']) tlschema(); + } + tlschema(); +} + +function process_dmgshield($dshield, $damage) { + global $session, $badguy; + tlschema("buffs"); + foreach($dshield as $buff) { + if (isset($buff['suspended']) && $buff['suspended']) { + continue; + } + if ($buff['schema']) { + tlschema($buff['schema']); + } + $realdamage = round($damage * $buff['damageshield'], 0); + if ($realdamage < 0) { + $realdamage = 0; + } + $msg = ""; + if ($realdamage > 0) { + if (isset($buff['effectmsg'])) { + $msg = $buff['effectmsg']; + } + } else if ($realdamage == 0) { + if (isset($buff['effectfailmsg'])) { + $msg = $buff['effectfailmsg']; + } + } + $badguy['creaturehealth'] -= $realdamage; + if ($badguy['creaturehealth'] <= 0) { + $badguy['istarget'] = false; + $badguy['dead'] = true; + $count = 1; + } + if (is_array($msg)) { + $msg = sprintf_translate($msg); + $msg = substitute("`)".$msg."`0`n", array("{damage}"), array($realdamage)); + output_notl($msg); //Here it's already translated + }else if ($msg>"") { + $msg = substitute_array("`)".$msg."`0`n", array("{damage}"), array($realdamage)); + output($msg); + } + if ($buff['schema']) { + tlschema(); + } + } + tlschema(); +} + +function expire_buffs() { + global $session, $badguy; + tlschema("buffs"); + foreach($session['bufflist'] as $key=>$buff) { + if (array_key_exists('suspended',$buff) && $buff['suspended']) continue; + if ($buff['schema']) tlschema($buff['schema']); + if (array_key_exists('used',$buff) && $buff['used']) { + $session['bufflist'][$key]['used'] = 0; + if ($session['bufflist'][$key]['rounds']>0) { + $session['bufflist'][$key]['rounds']--; + } + if ((int)$session['bufflist'][$key]['rounds'] == 0) { + if (isset($buff['wearoff']) && $buff['wearoff']) { + if (is_array($buff['wearoff'])) { + $buff['wearoff'] = str_replace("`%", "`%%", $buff['wearoff']); + $msg = sprintf_translate($buff['wearoff']); + $msg = substitute("`5".$msg."`0`n"); + output_notl($msg); //Here it's already translated + }else{ + $msg = substitute_array("`5".$buff['wearoff']."`0`n"); + output($msg); + } + } + //unset($session['bufflist'][$key]); + strip_buff($key); + } + } + if ($buff['schema']) tlschema(); + } + tlschema(); +} + +?> diff --git a/lotgd-web/lotgd/lib/battle-skills.php b/lotgd-web/lotgd/lib/battle-skills.php new file mode 100755 index 0000000..7180aea --- /dev/null +++ b/lotgd-web/lotgd/lib/battle-skills.php @@ -0,0 +1,279 @@ +0 && $session['user']['hitpoints']>0){ + if ($options['type']=='pvp') { + $adjustedcreaturedefense = $badguy['creaturedefense']; + } else { + $adjustedcreaturedefense = + ($creaturedefmod*$badguy['creaturedefense'] / + ($adjustment*$adjustment)); + } + + $creatureattack = $badguy['creatureattack']*$creatureatkmod; + $adjustedselfdefense = ($session['user']['defense'] * $adjustment * $defmod); + + /* + debug("Base creature defense: " . $badguy['creaturedefense']); + debug("Creature defense mod: $creaturedefmod"); + debug("Adjustment: $adjustment"); + debug("Adjusted creature defense: $adjustedcreaturedefense"); + debug("Adjusted creature attack: $creatureattack"); + debug("Adjusted self defense: $adjustedselfdefense"); + */ + + while(!isset($creaturedmg) || !isset($selfdmg) || $creaturedmg==0 && $selfdmg==0){ + $atk = $session['user']['attack']*$atkmod; + if (e_rand(1,20)==1 && $options['type'] != "pvp") $atk*=3; + /* + debug("Attack score: $atk"); + */ + + $patkroll = bell_rand(0,$atk); + /* + debug("Player Attack roll: $patkroll"); + */ + + // Set up for crit detection + $atk = $patkroll; + $catkroll = bell_rand(0,$adjustedcreaturedefense); + /* + debug("Creature defense roll: $catkroll"); + */ + + $creaturedmg = 0-(int)($catkroll - $patkroll); + if ($creaturedmg<0) { + $creaturedmg = (int)($creaturedmg/2); + $creaturedmg = round($buffset['badguydmgmod'] * + $creaturedmg, 0); + } + if ($creaturedmg > 0) { + $creaturedmg = round($buffset['dmgmod']*$creaturedmg,0); + } + $pdefroll = bell_rand(0,$adjustedselfdefense); + $catkroll = bell_rand(0,$creatureattack); + /* + debug("Creature attack roll: $catkroll"); + debug("Player defense roll: $pdefroll"); + */ + $selfdmg = 0-(int)($pdefroll - $catkroll); + if ($selfdmg<0) { + $selfdmg=(int)($selfdmg/2); + $selfdmg = round($selfdmg*$buffset['dmgmod'], 0); + } + if ($selfdmg > 0) { + $selfdmg = round($selfdmg*$buffset['badguydmgmod'], 0); + } + } + }else{ + $creaturedmg=0; + $selfdmg=0; + } + // Handle god mode's invulnerability + if ($buffset['invulnerable']) { + $creaturedmg = abs($creaturedmg); + $selfdmg = -abs($selfdmg); + } + return array("creaturedmg"=>(isset($creaturedmg)?$creaturedmg:0),"selfdmg"=>(isset($selfdmg)?$selfdmg:0)); +} + +function report_power_move($crit, $dmg) { + global $session; + $uatk = $session['user']['attack']; + if ($crit > $uatk) { + $power = 0; + if ($crit > $uatk*4) { + $msg = "`&`bYou execute a `%MEGA`& power move!!!`b`n"; + $power=1; + + } elseif ($crit > $uatk*3) { + $msg = "`&`bYou execute a `^DOUBLE`& power move!!!`b`n"; + $power=1; + } elseif ($crit > $uatk*2) { + $msg = "`&`bYou execute a power move!!!`b`0`n"; + $power=1; + }elseif ($crit > ($uatk * 1.5)) { + $msg = "`7`bYou execute a minor power move!`b`0`n"; + $power=1; + } + if ($power) { + tlschema("battle"); + output($msg); + tlschema(); + + $dmg += e_rand($crit/4, $crit/2); + $dmg = max($dmg, 1); + } + } + return $dmg; +} + + +function suspend_buffs($susp=false, $msg=false){ + global $session, $badguy; + $suspendnotify = 0; + reset($session['bufflist']); + while (list($key,$buff)=each($session['bufflist'])){ + if (array_key_exists('suspended', $buff) && $buff['suspended']) + continue; + // Suspend non pvp allowed buffs when in pvp + if ($susp && (!isset($buff[$susp]) || !$buff[$susp])) { + $session['bufflist'][$key]['suspended'] = 1; + $suspendnotify = 1; + } + // reset the 'used this round state' + $buff['used']=0; + } + + if ($suspendnotify) { + $schema = false; + if ($msg === false) { + $schema = "battle"; + $msg = "`&The gods have suspended some of your enhancements!`n"; + } + if ($schema) tlschema($schema); + output($msg); + if ($schema) tlschema(); + } +} + +function suspend_buff_by_name($name, $msg=false) { + global $session; + // If it's not already suspended. + if ($session['bufflist'][$name] && + !$session['bufflist'][$name]['suspended']) { + $session['bufflist'][$name]['suspended'] = 1; + + // And notify. + $schema = false; + if ($msg === false) { + $schema = "battle"; + $msg = "`&The gods have suspended some of your enhancements!`n"; + } + if ($schema) tlschema($schema); + output($msg); + if ($schema) tlschema(); + } +} + +function unsuspend_buff_by_name($name, $msg=false) { + global $session; + // If it's not already suspended. + if ($session['bufflist'][$name] && + $session['bufflist'][$name]['suspended']) { + $session['bufflist'][$name]['suspended'] = 0; + + // And notify. + $schema = false; + if ($msg === false) { + $schema = "battle"; + $msg = "`&The gods have restored all suspended enhancements.`n`n"; + } + if ($schema) tlschema($schema); + output($msg); + if ($schema) tlschema(); + } +} + +function is_buff_active($name) { + global $session; + // If it's not already suspended. + return (($session['bufflist'][$name] && !$session['bufflist'][$name]['suspended'])?1:0); +} + + +function unsuspend_buffs($susp=false,$msg=false) { + global $session, $badguy; + $unsuspendnotify = 0; + reset($session['bufflist']); + while (list($key,$buff)=each($session['bufflist'])){ + if (array_key_exists("expireafterfight",$buff) && $buff['expireafterfight']) unset($session['bufflist'][$key]); + elseif (array_key_exists("suspended",$buff) && $buff['suspended'] && $susp && (!array_key_exists($susp, $buff) || !$buff[$susp])) { + $session['bufflist'][$key]['suspended'] = 0; + $unsuspendnotify=1; + } + } + + if ($unsuspendnotify) { + $schema = false; + if ($msg === false) { + $schema = "battle"; + $msg = "`&The gods have restored all suspended enhancements.`n`n"; + } + if ($schema) tlschema($schema); + output($msg); + if ($schema) tlschema(); + } +} + +function apply_bodyguard($level){ + global $session, $badguy; + if (!isset($session['bufflist']['bodyguard'])) { + switch($level){ + case 1: + $badguyatkmod=1.05; + $defmod=0.95; + $rounds=-1; + break; + case 2: + $badguyatkmod=1.1; + $defmod=0.9; + $rounds=-1; + break; + case 3: + $badguyatkmod=1.2; + $defmod=0.8; + $rounds=-1; + break; + case 4: + $badguyatkmod=1.3; + $defmod=0.7; + $rounds=-1; + break; + case 5: + $badguyatkmod=1.4; + $defmod=0.6; + $rounds=-1; + break; + } + apply_buff('bodyguard' , array( + "startmsg"=>"`\${badguy}'s bodyguard protects them!", + "name"=>"`&Bodyguard", + "wearoff"=>"The bodyguard seems to have fallen asleep.", + "badguyatkmod"=>$badguyatkmod, + "defmod"=>$defmod, + "rounds"=>$rounds, + "allowinpvp"=>1, + "expireafterfight"=>1, + "schema"=>"pvp" + ) + ); + } +} + +function apply_skill($skill,$l){ + global $session; + if ($skill=="godmode"){ + apply_buff('godmode',array( + "name"=>"`&GOD MODE", + "rounds"=>1, + "wearoff"=>"You feel mortal again.", + "atkmod"=>25, + "defmod"=>25, + "invulnerable"=>1, + "startmsg"=>"`&`bYou feel godlike.`b", + "schema"=>"skill" + )); + } + modulehook("apply-specialties"); +} +?> diff --git a/lotgd-web/lotgd/lib/bell_rand.php b/lotgd-web/lotgd/lib/bell_rand.php new file mode 100755 index 0000000..255f61a --- /dev/null +++ b/lotgd-web/lotgd/lib/bell_rand.php @@ -0,0 +1,630 @@ +$max){ + //min is bigger than max, switch. + $x = $max; + $max = $min; + $min = $x; + } + if (($min-$max)==0){ + //equal values, return one of them. + return $min; + } + if (!is_array($bell_curve)){ + $bell_curve = array( +3 => -0.716599, +4 => -0.708501841, +5 => -0.688258942, +6 => -0.676113203, +7 => -0.659918884, +8 => -0.651821725, +9 => -0.639675985, +10 => -0.631578826, +11 => -0.627530246, +12 => -0.619433087, +13 => -0.611335927, +14 => -0.607287348, +15 => -0.599190188, +16 => -0.595141608, +17 => -0.591093029, +18 => -0.587044449, +19 => -0.582995869, +20 => -0.57894729, +21 => -0.57489871, +22 => -0.57085013, +23 => -0.56680155, +24 => -0.562752971, +25 => -0.558704391, +26 => -0.554655811, +28 => -0.550607232, +29 => -0.546558652, +31 => -0.542510072, +32 => -0.538461492, +34 => -0.534412913, +35 => -0.530364333, +37 => -0.526315753, +39 => -0.522267174, +41 => -0.518218594, +43 => -0.514170014, +45 => -0.510121434, +47 => -0.506072855, +50 => -0.502024275, +52 => -0.497975695, +54 => -0.493927115, +57 => -0.489878536, +60 => -0.485829956, +63 => -0.481781376, +66 => -0.477732797, +69 => -0.473684217, +72 => -0.469635637, +75 => -0.465587057, +79 => -0.461538478, +83 => -0.457489898, +86 => -0.453441318, +90 => -0.449392739, +95 => -0.445344159, +99 => -0.441295579, +104 => -0.437246999, +108 => -0.43319842, +113 => -0.42914984, +118 => -0.42510126, +124 => -0.421052681, +129 => -0.417004101, +135 => -0.412955521, +141 => -0.408906941, +147 => -0.404858362, +154 => -0.400809782, +161 => -0.396761202, +168 => -0.392712623, +175 => -0.388664043, +183 => -0.384615463, +191 => -0.380566883, +199 => -0.376518304, +207 => -0.372469724, +216 => -0.368421144, +226 => -0.364372565, +235 => -0.360323985, +245 => -0.356275405, +256 => -0.352226825, +266 => -0.348178246, +277 => -0.344129666, +289 => -0.340081086, +301 => -0.336032506, +313 => -0.331983927, +326 => -0.327935347, +340 => -0.323886767, +354 => -0.319838188, +368 => -0.315789608, +383 => -0.311741028, +399 => -0.307692448, +415 => -0.303643869, +431 => -0.299595289, +448 => -0.295546709, +466 => -0.29149813, +485 => -0.28744955, +504 => -0.28340097, +523 => -0.27935239, +544 => -0.275303811, +565 => -0.271255231, +587 => -0.267206651, +609 => -0.263158072, +633 => -0.259109492, +657 => -0.255060912, +682 => -0.251012332, +708 => -0.246963753, +734 => -0.242915173, +762 => -0.238866593, +790 => -0.234818014, +820 => -0.230769434, +850 => -0.226720854, +881 => -0.222672274, +914 => -0.218623695, +947 => -0.214575115, +982 => -0.210526535, +1017 => -0.206477955, +1054 => -0.202429376, +1091 => -0.198380796, +1130 => -0.194332216, +1171 => -0.190283637, +1212 => -0.186235057, +1255 => -0.182186477, +1298 => -0.178137897, +1344 => -0.174089318, +1390 => -0.170040738, +1438 => -0.165992158, +1488 => -0.161943579, +1539 => -0.157894999, +1591 => -0.153846419, +1645 => -0.149797839, +1700 => -0.14574926, +1757 => -0.14170068, +1816 => -0.1376521, +1876 => -0.133603521, +1938 => -0.129554941, +2002 => -0.125506361, +2068 => -0.121457781, +2135 => -0.117409202, +2204 => -0.113360622, +2275 => -0.109312042, +2348 => -0.105263463, +2423 => -0.101214883, +2500 => -0.097166303, +2579 => -0.093117723, +2660 => -0.089069144, +2743 => -0.085020564, +2828 => -0.080971984, +2916 => -0.076923405, +3005 => -0.072874825, +3097 => -0.068826245, +3192 => -0.064777665, +3288 => -0.060729086, +3387 => -0.056680506, +3489 => -0.052631926, +3593 => -0.048583346, +3700 => -0.044534767, +3809 => -0.040486187, +3920 => -0.036437607, +4035 => -0.032389028, +4152 => -0.028340448, +4272 => -0.024291868, +4394 => -0.020243288, +4520 => -0.016194709, +4648 => -0.012146129, +4779 => -0.008097549, +4913 => -0.00404897, +5050 => 0, // 5th percentile +5190 => 0.00404819, +5334 => 0.00809677, +5480 => 0.012145349, +5629 => 0.016193929, +5782 => 0.020242509, +5938 => 0.024291088, +6097 => 0.028339668, +6260 => 0.032388248, +6426 => 0.036436828, +6595 => 0.040485407, +6768 => 0.044533987, +6944 => 0.048582567, +7123 => 0.052631146, +7307 => 0.056679726, +7493 => 0.060728306, +7684 => 0.064776886, +7878 => 0.068825465, +8076 => 0.072874045, +8277 => 0.076922625, +8482 => 0.080971205, +8692 => 0.085019784, +8904 => 0.089068364, +9121 => 0.093116944, +9342 => 0.097165523, +9566 => 0.101214103, +9795 => 0.105262683, +10027 => 0.109311263, +10264 => 0.113359842, +10504 => 0.117408422, +10749 => 0.121457002, +10997 => 0.125505581, +11250 => 0.129554161, +11507 => 0.133602741, +11768 => 0.137651321, +12033 => 0.1416999, +12302 => 0.14574848, +12576 => 0.14979706, +12854 => 0.153845639, +13136 => 0.157894219, +13422 => 0.161942799, +13712 => 0.165991379, +14007 => 0.170039958, +14306 => 0.174088538, +14609 => 0.178137118, +14917 => 0.182185697, +15229 => 0.186234277, +15545 => 0.190282857, +15866 => 0.194331437, +16190 => 0.198380016, +16519 => 0.202428596, +16853 => 0.206477176, +17190 => 0.210525755, +17532 => 0.214574335, +17879 => 0.218622915, +18229 => 0.222671495, +18584 => 0.226720074, +18943 => 0.230768654, +19306 => 0.234817234, +19674 => 0.238865814, +20045 => 0.242914393, +20421 => 0.246962973, +20801 => 0.251011553, +21186 => 0.255060132, +21574 => 0.259108712, +21966 => 0.263157292, +22363 => 0.267205872, +22763 => 0.271254451, +23168 => 0.275303031, +23576 => 0.279351611, +23989 => 0.28340019, +24405 => 0.28744877, +24825 => 0.29149735, +25249 => 0.29554593, +25677 => 0.299594509, +26109 => 0.303643089, +26544 => 0.307691669, +26983 => 0.311740248, +27425 => 0.315788828, +27871 => 0.319837408, +28321 => 0.323885988, +28774 => 0.327934567, +29230 => 0.331983147, +29690 => 0.336031727, +30153 => 0.340080306, +30619 => 0.344128886, +31089 => 0.348177466, +31561 => 0.352226046, +32037 => 0.356274625, +32515 => 0.360323205, +32997 => 0.364371785, +33481 => 0.368420365, +33968 => 0.372468944, +34458 => 0.376517524, +34950 => 0.380566104, +35445 => 0.384614683, +35942 => 0.388663263, +36442 => 0.392711843, +36944 => 0.396760423, +37448 => 0.400809002, +37955 => 0.404857582, +38463 => 0.408906162, +38974 => 0.412954741, +39486 => 0.417003321, +40001 => 0.421051901, +40517 => 0.425100481, +41034 => 0.42914906, +41553 => 0.43319764, +42074 => 0.43724622, +42596 => 0.441294799, +43119 => 0.445343379, +43644 => 0.449391959, +44170 => 0.453440539, +44696 => 0.457489118, +45224 => 0.461537698, +45753 => 0.465586278, +46282 => 0.469634857, +46812 => 0.473683437, +47342 => 0.477732017, +47873 => 0.481780597, +48405 => 0.485829176, +48936 => 0.489877756, +49468 => 0.493926336, +50000 => 0.497974916, +50532 => 0.502023495, +51064 => 0.506072075, +51595 => 0.510120655, +52127 => 0.514169234, +52658 => 0.518217814, +53188 => 0.522266394, +53718 => 0.526314974, +54247 => 0.530363553, +54776 => 0.534412133, +55304 => 0.538460713, +55830 => 0.542509292, +56356 => 0.546557872, +56881 => 0.550606452, +57404 => 0.554655032, +57926 => 0.558703611, +58447 => 0.562752191, +58966 => 0.566800771, +59483 => 0.57084935, +59999 => 0.57489793, +60514 => 0.57894651, +61026 => 0.58299509, +61537 => 0.587043669, +62045 => 0.591092249, +62552 => 0.595140829, +63056 => 0.599189408, +63558 => 0.603237988, +64058 => 0.607286568, +64555 => 0.611335148, +65050 => 0.615383727, +65542 => 0.619432307, +66032 => 0.623480887, +66519 => 0.627529466, +67003 => 0.631578046, +67485 => 0.635626626, +67963 => 0.639675206, +68439 => 0.643723785, +68911 => 0.647772365, +69381 => 0.651820945, +69847 => 0.655869525, +70310 => 0.659918104, +70770 => 0.663966684, +71226 => 0.668015264, +71679 => 0.672063843, +72129 => 0.676112423, +72575 => 0.680161003, +73017 => 0.684209583, +73456 => 0.688258162, +73891 => 0.692306742, +74323 => 0.696355322, +74751 => 0.700403901, +75175 => 0.704452481, +75595 => 0.708501061, +76011 => 0.712549641, +76424 => 0.71659822, +76832 => 0.7206468, +77237 => 0.72469538, +77637 => 0.728743959, +78034 => 0.732792539, +78426 => 0.736841119, +78814 => 0.740889699, +79199 => 0.744938278, +79579 => 0.748986858, +79955 => 0.753035438, +80326 => 0.757084017, +80694 => 0.761132597, +81057 => 0.765181177, +81416 => 0.769229757, +81771 => 0.773278336, +82121 => 0.777326916, +82468 => 0.781375496, +82810 => 0.785424076, +83147 => 0.789472655, +83481 => 0.793521235, +83810 => 0.797569815, +84134 => 0.801618394, +84455 => 0.805666974, +84771 => 0.809715554, +85083 => 0.813764134, +85391 => 0.817812713, +85694 => 0.821861293, +85993 => 0.825909873, +86288 => 0.829958452, +86578 => 0.834007032, +86864 => 0.838055612, +87146 => 0.842104192, +87424 => 0.846152771, +87698 => 0.850201351, +87967 => 0.854249931, +88232 => 0.85829851, +88493 => 0.86234709, +88750 => 0.86639567, +89003 => 0.87044425, +89251 => 0.874492829, +89496 => 0.878541409, +89736 => 0.882589989, +89973 => 0.886638568, +90205 => 0.890687148, +90434 => 0.894735728, +90658 => 0.898784308, +90879 => 0.902832887, +91096 => 0.906881467, +91308 => 0.910930047, +91518 => 0.914978626, +91723 => 0.919027206, +91924 => 0.923075786, +92122 => 0.927124366, +92316 => 0.931172945, +92507 => 0.935221525, +92693 => 0.939270105, +92877 => 0.943318685, +93056 => 0.947367264, +93232 => 0.951415844, +93405 => 0.955464424, +93574 => 0.959513003, +93740 => 0.963561583, +93903 => 0.967610163, +94062 => 0.971658743, +94218 => 0.975707322, +94371 => 0.979755902, +94520 => 0.983804482, +94666 => 0.987853061, +94810 => 0.991901641, +94950 => 0.995950221, +95087 => 1, // 95th Percentile +95221 => 1.00404738, +95352 => 1.00809596, +95480 => 1.01214454, +95606 => 1.016193119, +95728 => 1.020241699, +95848 => 1.024290279, +95965 => 1.028338859, +96080 => 1.032387438, +96191 => 1.036436018, +96300 => 1.040484598, +96407 => 1.044533177, +96511 => 1.048581757, +96613 => 1.052630337, +96712 => 1.056678917, +96808 => 1.060727496, +96903 => 1.064776076, +96995 => 1.068824656, +97084 => 1.072873236, +97172 => 1.076921815, +97257 => 1.080970395, +97340 => 1.085018975, +97421 => 1.089067554, +97500 => 1.093116134, +97577 => 1.097164714, +97652 => 1.101213294, +97725 => 1.105261873, +97796 => 1.109310453, +97865 => 1.113359033, +97932 => 1.117407612, +97998 => 1.121456192, +98062 => 1.125504772, +98124 => 1.129553352, +98184 => 1.133601931, +98243 => 1.137650511, +98300 => 1.141699091, +98355 => 1.14574767, +98409 => 1.14979625, +98461 => 1.15384483, +98512 => 1.15789341, +98562 => 1.161941989, +98610 => 1.165990569, +98656 => 1.170039149, +98702 => 1.174087728, +98745 => 1.178136308, +98788 => 1.182184888, +98829 => 1.186233468, +98870 => 1.190282047, +98909 => 1.194330627, +98946 => 1.198379207, +98983 => 1.202427786, +99018 => 1.206476366, +99053 => 1.210524946, +99086 => 1.214573526, +99119 => 1.218622105, +99150 => 1.222670685, +99180 => 1.226719265, +99210 => 1.230767845, +99238 => 1.234816424, +99266 => 1.238865004, +99292 => 1.242913584, +99318 => 1.246962163, +99343 => 1.251010743, +99367 => 1.255059323, +99391 => 1.259107903, +99413 => 1.263156482, +99435 => 1.267205062, +99456 => 1.271253642, +99477 => 1.275302221, +99496 => 1.279350801, +99515 => 1.283399381, +99534 => 1.287447961, +99552 => 1.29149654, +99569 => 1.29554512, +99585 => 1.2995937, +99601 => 1.303642279, +99617 => 1.307690859, +99632 => 1.311739439, +99646 => 1.315788019, +99660 => 1.319836598, +99674 => 1.323885178, +99687 => 1.327933758, +99699 => 1.331982337, +99711 => 1.336030917, +99723 => 1.340079497, +99734 => 1.344128077, +99744 => 1.348176656, +99755 => 1.352225236, +99765 => 1.356273816, +99774 => 1.360322396, +99784 => 1.364370975, +99793 => 1.368419555, +99801 => 1.372468135, +99809 => 1.376516714, +99817 => 1.380565294, +99825 => 1.384613874, +99832 => 1.388662454, +99839 => 1.392711033, +99846 => 1.396759613, +99853 => 1.400808193, +99859 => 1.404856772, +99865 => 1.408905352, +99871 => 1.412953932, +99876 => 1.417002512, +99882 => 1.421051091, +99887 => 1.425099671, +99892 => 1.429148251, +99896 => 1.43319683, +99901 => 1.43724541, +99905 => 1.44129399, +99910 => 1.44534257, +99914 => 1.449391149, +99917 => 1.453439729, +99921 => 1.457488309, +99925 => 1.461536888, +99928 => 1.465585468, +99931 => 1.469634048, +99934 => 1.473682628, +99937 => 1.477731207, +99940 => 1.481779787, +99943 => 1.485828367, +99946 => 1.489876946, +99948 => 1.493925526, +99950 => 1.497974106, +99953 => 1.502022686, +99955 => 1.506071265, +99957 => 1.510119845, +99959 => 1.514168425, +99961 => 1.518217005, +99963 => 1.522265584, +99965 => 1.526314164, +99966 => 1.530362744, +99968 => 1.534411323, +99969 => 1.538459903, +99971 => 1.542508483, +99972 => 1.546557063, +99974 => 1.550605642, +99975 => 1.554654222, +99976 => 1.558702802, +99977 => 1.562751381, +99978 => 1.566799961, +99979 => 1.570848541, +99980 => 1.574897121, +99981 => 1.5789457, +99982 => 1.58299428, +99983 => 1.58704286, +99984 => 1.591091439, +99985 => 1.595140019, +99986 => 1.603237179, +99987 => 1.607285758, +99988 => 1.615382918, +99989 => 1.623480077, +99990 => 1.627528657, +99991 => 1.635625816, +99992 => 1.647771556, +99993 => 1.655868715, +99994 => 1.672063034, +99995 => 1.684208773, +99996 => 1.704451672, +99997 => 1.712548831 + ); + } + $r = mt_rand(0,100000); + //echo $r." = "; + reset($bell_curve); + while (list($key,$val)=each($bell_curve)){ + if ($key>=$r) { + return $min + $val * ($max-$min); + } + } + //We're above 0.99997 + return $min + $val * ($max-$min); + + //below optomizations don't work atm. + echo $r." = "; + $index="0.00000"; + for ($n = 0; $n=7){ + return $min + $bell_curve[(float)$f] * ($max-$min); + } + $o = strlen($f)-2; + $o = pow(10,$o); // $o is orders of magnitude of our current closest index match + for ($n = 0; $n<10000; $n++){ + $x = $n / $o; + if (isset($bell_curve[(float)($f+$x)])) return $min + $bell_curve[(float)($f+$x)] * ($max-$min); + if (isset($bell_curve[(float)($f-$x)])) return $min + $bell_curve[(float)($f-$x)] * ($max-$min); + } + echo "\n
Unable to locate random value, \$r was $r
\n"; +} + +?> diff --git a/lotgd-web/lotgd/lib/buffs.php b/lotgd-web/lotgd/lib/buffs.php new file mode 100755 index 0000000..0b1897b --- /dev/null +++ b/lotgd-web/lotgd/lib/buffs.php @@ -0,0 +1,212 @@ + replacements for get_module_pref('variable','module') + $value = preg_replace("/<([A-Za-z0-9]+)\\|([A-Za-z0-9]+)>/","get_module_pref('\\2','\\1')",$value); + //simple replacements for $session['user']['variable'] + $value = preg_replace("/<([A-Za-z0-9]+)>/","\$session['user']['\\1']",$value); + + if (!defined("OLDSU")) { + define("OLDSU", $session['user']['superuser']); + } + if ($value != $origstring){ + if (strtolower(substr($value,0,6))=="debug:"){ + $errors=""; + $origstring = substr($origstring,6); + $value = substr($value,6); + if (!isset($debuggedbuffs[$buffname])) $debuggedbuffs[$buffname]=array(); + + ob_start(); + $val = eval("return $value;"); + $errors = ob_get_contents(); + ob_end_clean(); + + if (!isset($debuggedbuffs[$buffname][$property])){ + if ($errors==""){ + debug("Buffs[$buffname][$property] evaluates successfully to $val"); + }else{ + debug("Buffs[$buffname][$property] has an evaluation error
" + .htmlentities($origstring, ENT_COMPAT, getsetting("charset", "ISO-8859-1"))." becomes
" + .htmlentities($value, ENT_COMPAT, getsetting("charset", "ISO-8859-1"))."
" + .$errors); + $val=""; + } + $debuggedbuffs[$buffname][$property]=true; + } + + $origstring="debug:".$origstring; + $value="debug".$value; + }else{ + $val = eval("return $value;"); + } + }else{ + $val = $value; + } + + $session['user']['superuser'] = OLDSU; + + //Avoiding PHP bug 27646 + // (http://bugs.php.net/bug.php?id=27646&edit=2) - + // Unserialize doesn't recognize NAN, -INF and INF + if (function_exists('is_nan')) { + if (is_numeric($val) && + (is_nan($val) || is_infinite($val))) + $val=$value; + } else { + // We have an older version of PHP, so, let's try + // something else. + $l = strtolower("$val"); + if ((substr($l, 3) == "nan") || (substr($l, -3) == "inf")) + $val = $value; + } + if (!isset($output)) $output = ""; + if ($output == "" && (string)$val != (string)$origstring){ + $buffreplacements[$buffname][$property] = $origstring; + $session['bufflist'][$buffname][$property] = $val; + }//end if + unset($val); + }//end while + $session['bufflist'][$buffname]['fields_calculated']=true; + }//end if + }//end while + +}//end function + +function restore_buff_fields(){ + global $session, $buffreplacements; + if (is_array($buffreplacements)){ + reset($buffreplacements); + while (list($buffname,$val)=each($buffreplacements)){ + reset($val); + while (list($property,$value)=each($val)){ + if (isset($session['bufflist'][$buffname])){ + $session['bufflist'][$buffname][$property] = $value; + unset($session['bufflist'][$buffname]['fields_calculated']); + }//end if + }//end while + unset($buffreplacements[$buffname]); + }//end while + }//end if + + //restore temp stats + if (!is_array($session['bufflist'])) $session['bufflist'] = array(); + reset($session['bufflist']); + while (list($buffname,$buff)=each($session['bufflist'])){ + if (array_key_exists("tempstats_calculated",$buff) && $buff['tempstats_calculated']){ + reset($buff); + while (list($property,$value)=each($buff)){ + if (substr($property,0,9)=='tempstat-'){ + apply_temp_stat(substr($property,9),-$value); + } + }//end while + unset($session['bufflist'][$buffname]['tempstats_calculated']); + }//end if + }//end while +}//end function + +function apply_buff($name,$buff){ + global $session,$buffreplacements, $translation_namespace; + + if (!isset($buff['schema']) || $buff['schema'] == "") { + $buff['schema'] = $translation_namespace; + } + + if (isset($buffreplacements[$name])) unset($buffreplacements[$name]); + if (isset($session['bufflist'][$name])){ + //we'll need to unapply buff fields before applying this buff since + //it's already set. + restore_buff_fields(); + } + $buff = modulehook("modify-buff", array("name"=>$name, "buff"=>$buff)); + $session['bufflist'][$name] = $buff['buff']; + calculate_buff_fields(); +} + +function apply_companion($name,$companion,$ignorelimit=false){ + global $session, $companions; + if (!is_array($companions)) { + $companions = @unserialize($session['user']['companions']); + } + $companionsallowed = getsetting("companionsallowed", 1); + $args = modulehook("companionsallowed", array("maxallowed"=>$companionsallowed)); + $companionsallowed = $args['maxallowed']; + $current = 0; + foreach ($companions as $thisname=>$thiscompanion) { + if (isset($companion['ignorelimit']) && $companion['ignorelimit'] == true) { + } else { + if ($thisname != $name) + ++$current; + } + } + if ($current < $companionsallowed || $ignorelimit == true) { + if (isset($companions[$name])) { + unset($companions[$name]); + } + if (!isset($companion['ignorelimit']) && $ignorelimit == true) { + $companion['ignorelimit'] = true; + } + $companions[$name] = $companion; + $session['user']['companions'] = createstring($companions); + return true; // success! + } else { + debug("Failed to add companion due to restrictions regarding the maximum amount of companions allowed."); + return false; + } +} + + +function strip_buff($name){ + global $session, $buffreplacements; + restore_buff_fields(); + if (isset($session['bufflist'][$name])) + unset($session['bufflist'][$name]); + if (isset($buffreplacements[$name])) + unset($buffreplacements[$name]); + calculate_buff_fields(); +} + +function strip_all_buffs(){ + global $session; + $thebuffs = $session['bufflist']; + reset($thebuffs); + while (list($buffname,$buff)=each($thebuffs)){ + strip_buff($buffname); + } +} + +function has_buff($name){ + global $session; + if (isset($session['bufflist'][$name])) return true; + return false; +} + +?> diff --git a/lotgd-web/lotgd/lib/censor.php b/lotgd-web/lotgd/lib/censor.php new file mode 100755 index 0000000..8f9cfb4 --- /dev/null +++ b/lotgd-web/lotgd/lib/censor.php @@ -0,0 +1,138 @@ + "") + $times = preg_match_all($word,$output,$matches); + else + $times = 0; + for ($x=0; $x<$times; $x++){ + if (strlen($matches[0][$x]) < strlen($matches[1][$x])){ + $shortword = $matches[0][$x]; + $longword = $matches[1][$x]; + }else{ + $shortword = $matches[1][$x]; + $longword = $matches[0][$x]; + } + if (isset($exceptions[strtolower($longword)])){ + $x--; + $times--; + if ($debug) + output("This word is ok because it was caught by an exception: `b`^%s`7`b`n",$longword); + }else{ + if ($debug) + output("`7This word is not ok: \"`%%s`7\"; it blocks on the pattern `i%s`i at \"`\$%s`7\".`n",$longword,$word,$shortword); + // if the word should be filtered, drop it from the + // search terms ($output), and mask its bytes out of + // the output mask. + $len = strlen($shortword); + $pad = str_pad("",$len,"_"); + //while (($p = strpos($output,$shortword))!==false){ + $p = strpos($output,$shortword); + $output = substr($output,0,$p) . $pad . + substr($output,$p+$len); + $mix_mask = substr($mix_mask,0,$p) . $pad . + substr($mix_mask,$p+$len); + //} + $changed_content = true; + }//end if + }//end for + } while ($times > 0); + } + $y = 0; //position within final output + $pad = '#@%$!'; + for ($x=0; $x$input)); + return $final_output; + } + }else{ + return $final_output; + } +} + +function good_word_list(){ + $sql = "SELECT * FROM " . db_prefix("nastywords") . " WHERE type='good'"; + $result = db_query_cached($sql,"goodwordlist"); + $row = db_fetch_assoc($result); + return explode(" ",$row['words']); +} + +function nasty_word_list(){ + $search = datacache("nastywordlist",600); + if ($search!==false && is_array($search)) return $search; + + $sql = "SELECT * FROM " . db_prefix("nastywords") . " WHERE type='nasty'"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + $search = " ".$row['words']." "; + $search = preg_replace('/(?<=.)(? diff --git a/lotgd-web/lotgd/lib/charcleanup.php b/lotgd-web/lotgd/lib/charcleanup.php new file mode 100755 index 0000000..289efa0 --- /dev/null +++ b/lotgd-web/lotgd/lib/charcleanup.php @@ -0,0 +1,65 @@ +$id, "deltype"=>$type, "dodel"=>true)); + + if(!$return['dodel']) return false; + + // delete the output field from the accounts_output table introduced in 1.1.1 + + db_query("DELETE FROM " . db_prefix("accounts_output") . " WHERE acctid=$id;"); + + // delete the comments the user posted, necessary to have the systemcomments with acctid 0 working + + db_query("DELETE FROM " . db_prefix("commentary") . " WHERE author=$id;"); + + // Clean up any clan positions held by this character + $sql = "SELECT clanrank,clanid FROM " . db_prefix("accounts") . + " WHERE acctid=$id"; + $res = db_query($sql); + $row = db_fetch_assoc($res); + if ($row['clanid'] != 0 && $row['clanrank'] == CLAN_LEADER) { + $cid = $row['clanid']; + // We need to auto promote or disband the clan. + $sql = "SELECT name,acctid,clanrank FROM " . db_prefix("accounts") . + " WHERE clanid=$cid AND clanrank > " . CLAN_APPLICANT . " AND acctid<>$id ORDER BY clanrank DESC, clanjoindate"; + $res = db_query($sql); + if (db_num_rows($res)) { + // Okay, we can promote if needed + $row = db_fetch_assoc($res); + if ($row['clanrank'] != CLAN_LEADER) { + // No other leaders, promote this one + $id1 = $row['acctid']; + $sql = "UPDATE " . db_prefix("accounts") . + " SET clanrank=" . CLAN_LEADER . " WHERE acctid=$id1"; + db_query($sql); + } + } else { + // this clan needs to be disbanded. + $sql = "DELETE FROM " . db_prefix("clans") . " WHERE clanid=$cid"; + db_query($sql); + // And just in case we goofed, no players associated with a + // deleted clan This shouldn't be important, but. + $sql = "UPDATE " . db_prefix("accounts") . " SET clanid=0,clanrank=0,clanjoindate='0000-00-00 00:00;00' WHERE clanid=$cid"; + db_query($sql); + } + } + + // Delete any module user prefs + module_delete_userprefs($id); + + // Delete any mail to or from the user + db_query('DELETE FROM ' . db_prefix('mail') . ' WHERE msgto=' . $id . ' OR msgfrom=' . $id); + + // Delete any news from the user + db_query('DELETE FROM ' . db_prefix('news') . ' WHERE accountid=' . $id); + + return true; +} + +?> diff --git a/lotgd-web/lotgd/lib/checkban.php b/lotgd-web/lotgd/lib/checkban.php new file mode 100755 index 0000000..a292268 --- /dev/null +++ b/lotgd-web/lotgd/lib/checkban.php @@ -0,0 +1,48 @@ +'') OR (uniqueid='$id' AND uniqueid<>'')) AND (banexpire='0000-00-00' OR banexpire>='".date("Y-m-d")."')"; + $result = db_query($sql); + if (db_num_rows($result)>0){ + $session=array(); + tlschema("ban"); + $session['message'].=translate_inline("`n`4You fall under a ban currently in place on this website:`n"); + while ($row = db_fetch_assoc($result)) { + $session['message'].=$row['banreason']."`n"; + if ($row['banexpire']=='0000-00-00') + $session['message'].=translate_inline(" `\$This ban is permanent!`0"); + else + $session['message'].=sprintf_translate(" `^This ban will be removed `\$after`^ %s.`0",date("M d, Y",strtotime($row['banexpire']))); + $sql = "UPDATE " . db_prefix("bans") . " SET lasthit='".date("Y-m-d H:i:s")."' WHERE ipfilter='{$row['ipfilter']}' AND uniqueid='{$row['uniqueidid']}'"; + db_query($sql); + $session['message'].="`n"; + } + $session['message'].=translate_inline("`4If you wish, you may appeal your ban with the petition link."); + tlschema(); + header("Location: index.php"); + exit(); + } + db_free_result($result); +} + +?> diff --git a/lotgd-web/lotgd/lib/clan/applicant.php b/lotgd-web/lotgd/lib/clan/applicant.php new file mode 100755 index 0000000..e861baa --- /dev/null +++ b/lotgd-web/lotgd/lib/clan/applicant.php @@ -0,0 +1,46 @@ +0){ + //applied for membership to a clan + output("`7You approach `%%s`7 who smiles at you, but lets you know that your application to %s hasn't yet been accepted.",$registrar,$claninfo['clanname']); + output("Perhaps you'd like to take a seat in the waiting area, she suggests."); + addnav("Waiting Area","clan.php?op=waiting"); + addnav("Withdraw Application","clan.php?op=withdraw"); + }else{ + //hasn't applied for membership to any clan. + output("You are not a member of any clan."); + addnav("Apply for Membership to a Clan","clan.php?op=apply"); + addnav("Apply for a New Clan","clan.php?op=new"); + } + } + } +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/clan/applicant_apply.php b/lotgd-web/lotgd/lib/clan/applicant_apply.php new file mode 100755 index 0000000..d96afc8 --- /dev/null +++ b/lotgd-web/lotgd/lib/clan/applicant_apply.php @@ -0,0 +1,72 @@ +0){ + output("`%%s`7 accepts your application, files it in her out box, and folds her hands on the desk, staring at you.",$registrar); + output("You stand there staring blankly back at her for a few minutes before she suggests that perhaps you'd like to take a seat in the waiting area."); + + addnav("Return to the Lobby","clan.php"); + addnav("Waiting Area","clan.php?op=waiting"); + $session['user']['clanid']=$to; + $session['user']['clanrank']=CLAN_APPLICANT; + $session['user']['clanjoindate']=date("Y-m-d H:i:s"); + $sql = "SELECT acctid FROM " . db_prefix("accounts") . " WHERE clanid='{$session['user']['clanid']}' AND clanrank>=".CLAN_OFFICER; + $result = db_query($sql); + $sql = "DELETE FROM . ". db_prefix("mail") . " WHERE msgfrom=0 AND seen=0 AND subject='".serialize($apply_subj)."'"; + db_query($sql); + while ($row = db_fetch_assoc($result)){ + $msg = array("`^You have a new clan applicant! `&%s`^ has completed a membership application for your clan!",$session['user']['name']); + systemmail($row['acctid'],$apply_subj,$msg); + } + + // send reminder mail if clan of choice has a description + + $sql = "SELECT * FROM " . db_prefix("clans") . " WHERE clanid='$to'"; + $res = db_query_cached($sql, "clandata-$to", 3600); + $row = db_fetch_assoc($res); + + if ( nltoappon($row['clandesc']) != "" ) { + + $subject = "Clan Application Reminder"; + $mail = "`&Did you remember to read the description of the clan of your choice before applying? Note that some clans may have requirements that you have to fulfill before you can become a member. If you are not accepted into the clan of your choice anytime soon, it may be because you have not fulfilled these requirements. For your convenience, the description of the clan you are applying to is reproduced below.`n`n`c`#%s`@ <`^%s`@>`0`c`n%s"; + + systemmail($session['user']['acctid'],array($subject),array($mail, $row['clanname'], $row['clanshort'], nltoappon($row['clandesc']))); + } + }else{ + $sql = "SELECT MAX(" . db_prefix("clans") . ".clanid) AS clanid,MAX(clanname) AS clanname,count(" . db_prefix("accounts") . ".acctid) AS c FROM " . db_prefix("clans") . " INNER JOIN " . db_prefix("accounts") . " ON " . db_prefix("clans") . ".clanid=" . db_prefix("accounts") . ".clanid WHERE " . db_prefix("accounts") . ".clanrank > ".CLAN_APPLICANT." GROUP BY " . db_prefix("clans") . ".clanid ORDER BY c DESC"; + $result = db_query($sql); + if (db_num_rows($result)>0){ + output("`7You ask %s`7 for a clan membership application form.",$registrar); + output("She opens a drawer in her desk and pulls out a form. It contains only two lines: Name and Clan Name."); + output("You furrow your brow, not sure if you really like having to deal with all this red tape, and get set to concentrate really hard in order to complete the form."); + output("Noticing your attempt to write on the form with your %s, %s`7 claims the form back from you, writes %s`7 on the first line, and asks you the name of the clan that you'd like to join:`n`n",$session['user']['weapon'],$registrar,$session['user']['name']); + for ($i=0;$i%s %s`n", + $row['clanid'], + full_sanitize(htmlentities($row['clanname'], ENT_COMPAT, getsetting("charset", "ISO-8859-1"))), + $memb, true); + addnav("","clan.php?op=apply&to={$row['clanid']}"); + } + } + addnav("Return to the Lobby","clan.php"); + }else{ + output("`7You ask %s`7 for a clan membership application form.",$registrar); + output("She stares at you blankly for a few moments, then says, \"`5Sorry pal, no one has had enough gumption to start up a clan yet. Maybe that should be you, eh?`7\""); + addnav("Apply for a New Clan","clan.php?op=new"); + addnav("Return to the Lobby","clan.php"); + } + } +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/clan/applicant_new.php b/lotgd-web/lotgd/lib/clan/applicant_new.php new file mode 100755 index 0000000..3e44a42 --- /dev/null +++ b/lotgd-web/lotgd/lib/clan/applicant_new.php @@ -0,0 +1,103 @@ +50){ + output_notl($e[1],$registrar); + clanform(); + addnav("Return to the Lobby","clan.php"); + }elseif (strlen($clanshort)<2 || strlen($clanshort)>5){ + output_notl($e[2],$registrar); + clanform(); + addnav("Return to the Lobby","clan.php"); + }elseif (db_num_rows($result)>0){ + output_notl($e[3],$registrar,stripslashes($clanname)); + clanform(); + addnav("Return to the Lobby","clan.php"); + }else{ + $sql = "SELECT * FROM " . db_prefix("clans") . " WHERE clanshort='$clanshort'"; + $result = db_query($sql); + if (db_num_rows($result)>0){ + output_notl($e[4],$registrar,stripslashes($clanshort)); + clanform(); + addnav("Return to the Lobby","clan.php"); + }else{ + if ($session['user']['gold']<$gold || $session['user']['gems']<$gems){ + if ($gold>0 && $gems<=0) output_notl($e[5],$registrar,$gold); + elseif ($gems>0 && $gold<=0) output_notl($e[7],$registrar,$gems); + else output_notl($e[6],$registrar,$gold,$gems); + output_notl($e[8],$registrar); + addnav("Return to the Lobby","clan.php"); + }else{ +/*//*/ $args = array("ocn"=>$ocn, "ocs"=>$ocs, "clanname"=>$clanname, "clanshort"=>$clanshort); +/*//*/ $args = modulehook("process-createclan", $args); +/*//*/ if (isset($args['blocked']) && $args['blocked']){ +/*//*/ output_notl(sprintf_translate($args['blockmsg'])); +/*//*/ clanform(); +/*//*/ addnav("Return to the Lobby","clan.php"); +/*//*/ } else { + $sql = "INSERT INTO " . db_prefix("clans") . " (clanname,clanshort) VALUES ('$clanname','$clanshort')"; + db_query($sql); + $id = db_insert_id(); + $session['user']['clanid'] = $id; + $session['user']['clanrank']=CLAN_LEADER+1; //+1 because he is the founder + $session['user']['clanjoindate']=date("Y-m-d H:i:s"); + $session['user']['gold']-=$gold; + $session['user']['gems']-=$gems; + debuglog("has started a new clan (<$clanshort> $clanname) for $gold gold and $gems gems."); + output("%s`7 looks over your form, and finding that everything seems to be in order, she takes your fees, stamps the form \"`\$APPROVED`7\" and files it in a drawer.`n`n",$registrar); + output("Congratulations, you've created a new clan named %s!",stripslashes($clanname)); + addnav("Enter your clan hall","clan.php"); +/*//*/ } + } + } + } + }else{ + output("`7You approach %s`7 and inquire about starting a new clan.",$registrar); + output("She tells you that there are three requirements to starting a clan."); + output("First, you have to decide on a full name for your clan."); + output("Second, you have to decide on an abbreviation for your clan."); + output("Third you have to decide on whether or not you're willing to give up the fees that are required to start the clan."); + output("This fee is used to tailor the locks on your clan door to you and your members.`n"); + output("The fees are as follows:`nGold: `^%s`7`nGems: `%%s`7",$gold,$gems); + addnav("Return to the Lobby","clan.php"); + $e1 = translate_inline("`n`n\"`5Since you do not have enough gold with you, I cannot allow you to apply for a clan,`7\" she says."); + $e2 = translate_inline("`n`n\"`5Since you do not have enough gems with you, I cannot allow you to apply for a clan,`7\" she says."); + $e3 = translate_inline("`n`n\"`5If you're ok with these three requirements, please fill out the following form,`7\" she says, handing you a sheet of paper."); + if ($session['user']['gold']<$gold){ + output_notl($e1); + }else{ + if ($session['user']['gems']<$gems){ + output_notl($e2,$registrar); + }else{ + output_notl($e3,$registrar); + clanform(); + } + } + } +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/clan/clan_default.php b/lotgd-web/lotgd/lib/clan/clan_default.php new file mode 100755 index 0000000..a84d0b7 --- /dev/null +++ b/lotgd-web/lotgd/lib/clan/clan_default.php @@ -0,0 +1,76 @@ +"clanentry")); + output("Having pressed the secret levers and turned the secret knobs on the lock of the door to your clan's hall, you gain entrance and chat with your clan mates.`n`n"); + modulehook("}collapse"); + + $sql = "SELECT name FROM " . db_prefix("accounts") . " WHERE acctid={$claninfo['motdauthor']}"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + $motdauthname = $row['name']; + + $sql = "SELECT name FROM " . db_prefix("accounts") . " WHERE acctid={$claninfo['descauthor']}"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + $descauthname = $row['name']; + + if ($claninfo['clanmotd'] != '') { + rawoutput("
"); + output("`&`bCurrent MoTD:`b `#by %s`2`n",$motdauthname); + output_notl(nltoappon($claninfo['clanmotd'])."`n"); + rawoutput("
"); + output_notl("`n"); + } + + commentdisplay("", "clan-{$claninfo['clanid']}","Speak",25,($claninfo['customsay']>''?$claninfo['customsay']:"says")); + + modulehook("clanhall"); + + if ($claninfo['clandesc'] != '') { + modulehook("collapse{", array("name"=>"collapsedesc")); + output("`n`n`&`bCurrent Description:`b `#by %s`2`n",$descauthname); + output_notl(nltoappon($claninfo['clandesc'])); + modulehook("}collapse"); + } + $sql = "SELECT count(*) AS c, clanrank FROM " . db_prefix("accounts") . " WHERE clanid={$claninfo['clanid']} GROUP BY clanrank DESC"; + $result = db_query($sql); + // begin collapse + modulehook("collapse{", array("name"=>"clanmemberdet")); + output("`n`n`bMembership Details:`b`n"); + $leaders = 0; + while ($row = db_fetch_assoc($result)){ + output_notl($ranks[$row['clanrank']].": `0".$row['c']."`n"); + if ($row['clanrank']>CLAN_OFFICER) $leaders += $row['c']; + } + output("`n"); + $noleader = translate_inline("`^There is currently no leader! Promoting %s`^ to leader as they are the highest ranking member (or oldest member in the event of a tie).`n`n"); + if ($leaders==0){ + //There's no leader here, probably because the leader's account + //expired. + $sql = "SELECT name,acctid,clanrank FROM " . db_prefix("accounts") . " WHERE clanid={$session['user']['clanid']} AND clanrank > " . CLAN_APPLICANT . " ORDER BY clanrank DESC, clanjoindate"; + $result = db_query($sql); + if (db_num_rows($result)) { + $row = db_fetch_assoc($result); + $sql = "UPDATE " . db_prefix("accounts") . " SET clanrank=".CLAN_LEADER." WHERE acctid={$row['acctid']}"; + db_query($sql); + output_notl($noleader,$row['name']); + if ($row['acctid']==$session['user']['acctid']){ + //if it's the current user, we'll need to update their + //session in order for the db write to take effect. + $session['user']['clanrank']=CLAN_LEADER; + } + } else { + // There are no viable leaders. But we cannot disband the clan + // here. + } + } + // end collapse + modulehook("}collapse"); + + if ($session['user']['clanrank']>CLAN_MEMBER){ + addnav("Update MoTD / Clan Desc","clan.php?op=motd"); + } + addnav("M?View Membership","clan.php?op=membership"); + addnav("Online Members","list.php?op=clan"); + addnav("Your Clan's Waiting Area","clan.php?op=waiting"); + addnav("Withdraw From Your Clan","clan.php?op=withdrawconfirm"); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/clan/clan_membership.php b/lotgd-web/lotgd/lib/clan/clan_membership.php new file mode 100755 index 0000000..d21698a --- /dev/null +++ b/lotgd-web/lotgd/lib/clan/clan_membership.php @@ -0,0 +1,107 @@ +"") { + $sql="SELECT name,login,clanrank FROM ".db_prefix("accounts")." WHERE acctid=$whoacctid LIMIT 1"; + $result=db_query($sql); + $row=db_fetch_assoc($result); + $who = $row['login']; + $whoname = $row['name']; + if ($setrank>""){ + $args = modulehook("clan-setrank", array("setrank"=>$setrank, "login"=>$who, "name"=>$whoname, "acctid"=>$whoacctid, "clanid"=>$session['user']['clanid'], "oldrank"=>$row['clanrank'])); + if (!(isset($args['handled']) && $args['handled'])) { + $sql = "UPDATE " . db_prefix("accounts") . " SET clanrank=GREATEST(0,least({$session['user']['clanrank']},$setrank)) WHERE login='$who'"; + db_query($sql); + debuglog("Player {$session['user']['name']} changed rank of {$whoname} to {$setrank}.", $whoacctid); + } + } + } + $remove = httpget('remove'); + if ($remove>""){ + $sql = "SELECT name,login,clanrank FROM " . db_prefix("accounts") . " WHERE acctid='$remove'"; + $row = db_fetch_assoc(db_query($sql)); + $args = modulehook("clan-setrank", array("setrank"=>0, "login"=>$row['login'], "name"=>$row['name'], "acctid"=>$remove, "clanid"=>$session['user']['clanid'], "oldrank"=>$row['clanrank'])); + $sql = "UPDATE " . db_prefix("accounts") . " SET clanrank=".CLAN_APPLICANT.",clanid=0,clanjoindate='0000-00-00 00:00:00' WHERE acctid='$remove' AND clanrank<={$session['user']['clanrank']}"; + db_query($sql); + debuglog("Player {$session['user']['name']} removed player {$row['login']} from {$claninfo['clanname']}.", $remove); + //delete unread application emails from this user. + //breaks if the applicant has had their name changed via + //dragon kill, superuser edit, or lodge color change + require_once("lib/safeescape.php"); + $subj = safeescape(serialize(array($apply_short, $row['name']))); + $sql = "DELETE FROM " . db_prefix("mail") . " WHERE msgfrom=0 AND seen=0 AND subject='$subj'"; + db_query($sql); + } + $sql = "SELECT name,login,acctid,clanrank,laston,clanjoindate,dragonkills,level FROM " . db_prefix("accounts") . " WHERE clanid={$claninfo['clanid']} ORDER BY clanrank DESC ,dragonkills DESC,level DESC,clanjoindate"; + $result = db_query($sql); + rawoutput(""); + $rank = translate_inline("Rank"); + $name = translate_inline("Name"); + $lev = translate_inline("Level"); + $dk = translate_inline("Dragon Kills"); + $jd = translate_inline("Join Date"); + $lo = translate_inline("Last On"); + $ops = translate_inline("Operations"); + $promote = translate_inline("Promote"); + $demote = translate_inline("Demote"); + $stepdown = translate_inline("`\$Step down as founder"); + $remove = translate_inline("Remove From Clan"); + $confirm = translate_inline("Are you sure you wish to remove this member from your clan?"); + rawoutput("".($session['user']['clanrank']>CLAN_MEMBER?"":"")."",true); + $i=0; + $tot = 0; + require_once("lib/clan/func.php"); + while ($row=db_fetch_assoc($result)){ + $i++; + $tot += $row['dragonkills']; + rawoutput(""); + rawoutput(""); + if ($session['user']['clanrank']>CLAN_MEMBER){ + rawoutput(""); + } + rawoutput(""); + } + rawoutput("
$rank$name$lev$dk$jd$lo$ops
"); + output_notl($ranks[$row['clanrank']]); + rawoutput(""); + $link = "bio.php?char=".$row['acctid']."&ret=".urlencode($_SERVER['REQUEST_URI']); + rawoutput("", true); + addnav("", $link); + output_notl("`&%s`0", $row['name']); + rawoutput(""); + rawoutput(""); + output_notl("`^%s`0",$row['level']); + rawoutput(""); + output_notl("`\$%s`0",$row['dragonkills']); + rawoutput(""); + output_notl("`3%s`0",$row['clanjoindate']); + rawoutput(""); + output_notl("`#%s`0",reltime(strtotime($row['laston']))); + rawoutput(""); + if ($row['clanrank']<$session['user']['clanrank'] && $row['clanrank']$promote | "); + addnav("","clan.php?op=membership&setrank=".clan_nextrank($ranks,$row['clanrank'])."&who=".rawurlencode($row['login'])."&whoname=".rawurlencode($row['name'])."&whoacctid=".$row['acctid']); + }else{ + output_notl("[ `)%s`0 | ", $promote); + } + if ($row['clanrank']<=$session['user']['clanrank'] && $row['clanrank']>CLAN_APPLICANT && $row['login']!=$session['user']['login'] && clan_previousrank($ranks,$row['clanrank']) > 0){ + rawoutput("$demote | "); + addnav("","clan.php?op=membership&setrank=".clan_previousrank($ranks,$row['clanrank'])."&whoacctid=".$row['acctid']); + }elseif ($row['clanrank']==CLAN_FOUNDER && $row['clanrank']>CLAN_APPLICANT && $row['login']==$session['user']['login']){ + output_notl("$stepdown | ",true); + addnav("","clan.php?op=membership&setrank=".clan_previousrank($ranks,$row['clanrank'])."&whoacctid=".$row['acctid']); + } else { + output_notl("`)%s`0 | ", $demote); + } + if ($row['clanrank'] <= $session['user']['clanrank'] && $row['login']!=$session['user']['login']){ + rawoutput("$remove ]"); + addnav("","clan.php?op=membership&remove=".$row['acctid']); + }else{ + output_notl("`)%s`0 ]", $remove); + } + rawoutput("
"); + output("`n`n`^This clan has a total of `\$%s`^ dragon kills.",$tot); +?> diff --git a/lotgd-web/lotgd/lib/clan/clan_motd.php b/lotgd-web/lotgd/lib/clan/clan_motd.php new file mode 100755 index 0000000..0010eda --- /dev/null +++ b/lotgd-web/lotgd/lib/clan/clan_motd.php @@ -0,0 +1,71 @@ +=CLAN_OFFICER){ + $clanmotd = substr(httppost('clanmotd'),0,4096); + if (httppostisset('clanmotd') && + stripslashes($clanmotd)!=$claninfo['clanmotd']){ + $sql = "UPDATE " . db_prefix("clans") . " SET clanmotd='$clanmotd',motdauthor={$session['user']['acctid']} WHERE clanid={$claninfo['clanid']}"; + db_query($sql); + invalidatedatacache("clandata-{$claninfo['clanid']}"); + $claninfo['clanmotd']=stripslashes($clanmotd); + output("Updating MoTD`n"); + $claninfo['motdauthor']=$session['user']['acctid']; + } + $clandesc = httppost('clandesc'); + if (httppostisset('clandesc') && + stripslashes($clandesc)!=$claninfo['clandesc'] && + $claninfo['descauthor']!=4294967295){ + $sql = "UPDATE " . db_prefix("clans") . " SET clandesc='".addslashes(substr(stripslashes($clandesc),0,4096))."',descauthor={$session['user']['acctid']} WHERE clanid={$claninfo['clanid']}"; + db_query($sql); + invalidatedatacache("clandata-{$claninfo['clanid']}"); + output("Updating description`n"); + $claninfo['clandesc']=stripslashes($clandesc); + $claninfo['descauthor']=$session['user']['acctid']; + } + $customsay = httppost('customsay'); + if (httppostisset('customsay') && $customsay!=$claninfo['customsay'] && $session['user']['clanrank']>=CLAN_LEADER){ + $sql = "UPDATE " . db_prefix("clans") . " SET customsay='$customsay' WHERE clanid={$claninfo['clanid']}"; + db_query($sql); + invalidatedatacache("clandata-{$claninfo['clanid']}"); + output("Updating custom say line`n"); + $claninfo['customsay']=stripslashes($customsay); + } + $sql = "SELECT name FROM " . db_prefix("accounts") . " WHERE acctid={$claninfo['motdauthor']}"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + $motdauthname = $row['name']; + + $sql = "SELECT name FROM " . db_prefix("accounts") . " WHERE acctid={$claninfo['descauthor']}"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + $descauthname = $row['name']; + + output("`&`bCurrent MoTD:`b `#by %s`2`n",$motdauthname); + output_notl(nltoappon($claninfo['clanmotd'])."`n"); + output("`&`bCurrent Description:`b `#by %s`2`n",$descauthname); + output_notl(nltoappon($claninfo['clandesc'])."`n"); + + rawoutput("
"); + addnav("","clan.php?op=motd"); + output("`&`bMoTD:`b `7(4096 chars)`n"); + rawoutput("
"); + output("`n`&`bDescription:`b `7(4096 chars)`n"); + $blocked = translate_inline("Your clan has been blocked from posting a description.`n"); + if ($claninfo['descauthor']==INT_MAX){ + output_notl($blocked); + }else{ + rawoutput("
"); + } + if ($session['user']['clanrank']>=CLAN_LEADER){ + output("`n`&`bCustom Talk Line`b `7(blank means \"says\" -- 15 chars max)`n"); + rawoutput("
"); + } + $save = translate_inline("Save"); + rawoutput(""); + rawoutput("
"); + }else{ + output("You do not have authority to change your clan's motd or description."); + } + addnav("Return to your clan hall","clan.php"); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/clan/clan_start.php b/lotgd-web/lotgd/lib/clan/clan_start.php new file mode 100755 index 0000000..a86f59e --- /dev/null +++ b/lotgd-web/lotgd/lib/clan/clan_start.php @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/clan/clan_withdraw.php b/lotgd-web/lotgd/lib/clan/clan_withdraw.php new file mode 100755 index 0000000..74295af --- /dev/null +++ b/lotgd-web/lotgd/lib/clan/clan_withdraw.php @@ -0,0 +1,56 @@ +$session['user']['clanid'], 'clanrank'=>$session['user']['clanrank'], 'acctid'=>$session['user']['acctid'])); + if ($session['user']['clanrank']>=CLAN_LEADER){ + //first test to see if we were the leader. + $sql = "SELECT count(*) AS c FROM " . db_prefix("accounts") . " WHERE clanid={$session['user']['clanid']} AND clanrank>=".CLAN_LEADER." AND acctid<>{$session['user']['acctid']}"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + if ($row['c']==0){ + //we were the solitary leader. + $sql = "SELECT name,acctid,clanrank FROM " . db_prefix("accounts") . " WHERE clanid={$session['user']['clanid']} AND clanrank > " . CLAN_APPLICANT . " AND acctid<>{$session['user']['acctid']} ORDER BY clanrank DESC, clanjoindate LIMIT 1"; + $result = db_query($sql); + if ($row = db_fetch_assoc($result)){ + //there is no alternate leader, let's promote the + //highest ranking member (or oldest member in the + //event of a tie). This will capture even people + //who applied for membership. + $sql = "UPDATE " . db_prefix("accounts") . " SET clanrank=".CLAN_LEADER." WHERE acctid={$row['acctid']}"; + db_query($sql); + output("`^Promoting %s`^ to leader as they are the highest ranking member (or oldest member in the event of a tie).`n`n",$row['name']); + }else{ + //There are no other members, we need to delete the clan. + modulehook("clan-delete", array("clanid"=>$session['user']['clanid'])); + $sql = "DELETE FROM " . db_prefix("clans") . " WHERE clanid={$session['user']['clanid']}"; + db_query($sql); + //just in case we goofed, we don't want to have to worry + //about people being associated with a deleted clan. + $sql = "UPDATE " . db_prefix("accounts") . " SET clanid=0,clanrank=".CLAN_APPLICANT.",clanjoindate='0000-00-00 00:00:00' WHERE clanid={$session['user']['clanid']}"; + db_query($sql); + output("`^As you were the last member of this clan, it has been deleted."); + } + }else{ + //we don't have to do anything special with this clan as + //although we were leader, there is another leader already + //to take our place. + } + }else{ + //we don't have to do anything special with this clan as we were + //not the leader, and so there should still be other members. + } + $sql = "SELECT acctid FROM " . db_prefix("accounts") . " WHERE clanid='{$session['user']['clanid']}' AND clanrank>=".CLAN_OFFICER." AND acctid<>'{$session['user']['acctid']}'"; + $result = db_query($sql); + $withdraw_subj = array("`\$Clan Withdraw: `&%s`0",$session['user']['name']); + $msg = array("`^One of your clan members has resigned their membership. `&%s`^ has surrendered their position within your clan!",$session['user']['name']); + $sql = "DELETE FROM " . db_prefix("mail") . " WHERE msgfrom=0 AND seen=0 AND subject='".serialize($withdraw_subj)."'"; + db_query($sql); + while ($row = db_fetch_assoc($result)){ + systemmail($row['acctid'],$withdraw_subj,$msg); + } + + $session['user']['clanid']=0; + $session['user']['clanrank']=CLAN_APPLICANT; + $session['user']['clanjoindate']="0000-00-00 00:00:00"; + output("`&You have withdrawn from your clan."); + addnav("Clan Options"); + addnav("Return to the Lobby","clan.php"); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/clan/detail.php b/lotgd-web/lotgd/lib/clan/detail.php new file mode 100755 index 0000000..b3d0079 --- /dev/null +++ b/lotgd-web/lotgd/lib/clan/detail.php @@ -0,0 +1,95 @@ +"" && $clanshort>""){ + $sql = "UPDATE " . db_prefix("clans") . " SET clanname='$clanname',clanshort='$clanshort' WHERE clanid='$detail'"; + output("Updating clan names`n"); + db_query($sql); + invalidatedatacache("clandata-$detail"); + } + if (httppost('block')>""){ + $blockdesc = translate_inline("Description blocked for inappropriate usage."); + $sql = "UPDATE " . db_prefix("clans") . " SET descauthor=4294967295, clandesc='$blockdesc' where clanid='$detail'"; + output("Blocking public description`n"); + db_query($sql); + invalidatedatacache("clandata-$detail"); + }elseif (httppost('unblock')>""){ + $sql = "UPDATE " . db_prefix("clans") . " SET descauthor=0, clandesc='' where clanid='$detail'"; + output("UNblocking public description`n"); + db_query($sql); + invalidatedatacache("clandata-$detail"); + } + } + $sql = "SELECT * FROM " . db_prefix("clans") . " WHERE clanid='$detail'"; + $result1 = db_query_cached($sql, "clandata-$detail", 3600); + $row1 = db_fetch_assoc($result1); + if ($session['user']['superuser'] & SU_EDIT_COMMENTS){ + rawoutput("
"); + rawoutput("
"); + addnav("","clan.php?detail=$detail"); + output("Superuser / Moderator renaming:`n"); + output("Long Name: "); + rawoutput(""); + output("`nShort Name: "); + rawoutput(""); + output_notl("`n"); + $save = translate_inline("Save"); + rawoutput(""); + $snu = htmlentities(translate_inline("Save & UNblock public description"), ENT_COMPAT, getsetting("charset", "ISO-8859-1")); + $snb = htmlentities(translate_inline("Save & Block public description"), ENT_COMPAT, getsetting("charset", "ISO-8859-1")); + if ($row1['descauthor']=="4294967295") + rawoutput(""); + else + rawoutput(""); + rawoutput("
"); + rawoutput("
"); + rawoutput("",true); + $e = translate_inline("Edit Clan Info"); + rawoutput("$e",true); + output_notl("`n"); + } + + output_notl(nltoappon($row1['clandesc'])); + if ( nltoappon($row1['clandesc']) != "" ) output ("`n`n"); + output("`0This is the current clan membership of %s < %s >:`n",$row1['clanname'],$row1['clanshort']); + page_header("Clan Membership for %s <%s>", full_sanitize($row1['clanname']), full_sanitize($row1['clanshort'])); + addnav("Clan Options"); + $rank = translate_inline("Rank"); + $name = translate_inline("Name"); + $dk = translate_inline("Dragon Kills"); + $jd = translate_inline("Join Date"); + rawoutput(""); + rawoutput(""); + $i=0; + $sql = "SELECT acctid,name,login,clanrank,clanjoindate,dragonkills FROM " . db_prefix("accounts") . " WHERE clanid=$detail ORDER BY clanrank DESC,clanjoindate"; + $result = db_query($sql); + $tot = 0; + //little hack with the hook...can't think of any other way + $ranks = array(CLAN_APPLICANT=>"`!Applicant`0",CLAN_MEMBER=>"`#Member`0",CLAN_OFFICER=>"`^Officer`0",CLAN_LEADER=>"`&Leader`0", CLAN_FOUNDER=>"`\$Founder"); + $args = modulehook("clanranks", array("ranks"=>$ranks, "clanid"=>$detail)); + $ranks = translate_inline($args['ranks']); + //end + while ($row=db_fetch_assoc($result)){ + $i++; + $tot += $row['dragonkills']; + rawoutput(""); + rawoutput(""); + } + rawoutput("
$rank$name$dk$jd
"); + output_notl($ranks[$row['clanrank']]); //translated earlier + rawoutput(""); + $link = "bio.php?char=".$row['acctid']."&ret=".urlencode($_SERVER['REQUEST_URI']); + rawoutput(""); + addnav("", $link); + output_notl("`&%s`0", $row['name']); + rawoutput(""); + rawoutput(""); + output_notl("`\$%s`0", $row['dragonkills']); + rawoutput(""); + output_notl("`3%s`0", $row['clanjoindate']); + rawoutput("
"); + output("`n`n`^This clan has a total of `\$%s`^ dragon kills.",$tot); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/clan/func.php b/lotgd-web/lotgd/lib/clan/func.php new file mode 100755 index 0000000..71272b0 --- /dev/null +++ b/lotgd-web/lotgd/lib/clan/func.php @@ -0,0 +1,49 @@ +0) { + $key=array_shift($ranks); + if ($key>$current) return $key; + } + return 30; + +} + +/** + * Returns the numeric value of the previous rank from the given array + * + * @param array $ranks The ranks + * @param int $current The numeric value of the current rank + * @return int The numeric value of the previous rank + */ +function clan_previousrank($ranks,$current) { + $temp=array_pop($ranks); + $ranks=array_keys($ranks); + while (count($ranks)>0) { + $key=array_pop($ranks); + if ($key<$current) return $key; + } + return 0; +} +?> diff --git a/lotgd-web/lotgd/lib/clan/list.php b/lotgd-web/lotgd/lib/clan/list.php new file mode 100755 index 0000000..d1e0129 --- /dev/null +++ b/lotgd-web/lotgd/lib/clan/list.php @@ -0,0 +1,43 @@ +".CLAN_APPLICANT." GROUP BY " . db_prefix("clans") . ".clanid ORDER BY c DESC"; + $result = db_query($sql); + if (db_num_rows($result)>0){ + output("`7You ask %s`7 for the clan listings. She points you toward a marquee board near the entrance of the lobby that lists the clans.`0`n`n",$registrar); + $v = 0; + $memb_n = translate_inline("(%s members)"); + $memb_1 = translate_inline("(%s member)"); + rawoutput(''); + while ($row = db_fetch_assoc($result)){ + if ($row['c']==0){ + $sql = "DELETE FROM " . db_prefix("clans") . " WHERE clanid={$row['clanid']}"; + db_query($sql); + }else{ + rawoutput(''); + addnav("","clan.php?detail={$row['clanid']}"); + $v++; + } + } + rawoutput("
', true); + if ($row['c'] == 1) { + $memb = sprintf($memb_1, $row['c']); + } else { + $memb = sprintf($memb_n, $row['c']); + } + output_notl("• <%s> %s %s`n", + $row['clanshort'], + $row['clanid'], + full_sanitize(htmlentities($row['clanname']), ENT_COMPAT, getsetting("charset", "ISO-8859-1")), + $memb, true); + rawoutput('
", true); + addnav("Return to the Lobby","clan.php"); + }else{ + output("`7You ask %s`7 for the clan listings. She stares at you blankly for a few moments, then says, \"`5Sorry pal, no one has had enough gumption to start up a clan yet. Maybe that should be you, eh?`7\"",$registrar); + addnav("Apply for a New Clan","clan.php?op=new"); + addnav("Return to the Lobby","clan.php"); + } + + page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/clan/waiting.php b/lotgd-web/lotgd/lib/clan/waiting.php new file mode 100755 index 0000000..32eb849 --- /dev/null +++ b/lotgd-web/lotgd/lib/clan/waiting.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/commentary.php b/lotgd-web/lotgd/lib/commentary.php new file mode 100755 index 0000000..dbaf229 --- /dev/null +++ b/lotgd-web/lotgd/lib/commentary.php @@ -0,0 +1,629 @@ +0) { + $return = '/' . httpget('returnpath'); + $section = httpget('section'); + $sql = "SELECT " . + db_prefix("commentary").".*,".db_prefix("accounts").".name,". + db_prefix("accounts").".acctid, ".db_prefix("accounts").".clanrank,". + db_prefix("clans").".clanshort FROM ".db_prefix("commentary"). + " INNER JOIN ".db_prefix("accounts")." ON ". + db_prefix("accounts").".acctid = " . db_prefix("commentary"). + ".author LEFT JOIN ".db_prefix("clans")." ON ". + db_prefix("clans").".clanid=".db_prefix("accounts"). + ".clanid WHERE commentid=$remove"; + $row = db_fetch_assoc(db_query($sql)); + $sql = "INSERT LOW_PRIORITY INTO ".db_prefix("moderatedcomments"). + " (moderator,moddate,comment) VALUES ('{$session['user']['acctid']}','".date("Y-m-d H:i:s")."','".addslashes(serialize($row))."')"; + db_query($sql); + $sql = "DELETE FROM ".db_prefix("commentary")." WHERE commentid='$remove';"; + db_query($sql); + invalidatedatacache("comments-$section"); + invalidatedatacache("comments-or11"); + $session['user']['specialinc']==''; //just to make sure he was not in a special + $return = cmd_sanitize($return); + $return = substr($return,strrpos($return,"/")+1); + if (strpos($return,"?")===false && strpos($return,"&")!==false){ + $x = strpos($return,"&"); + $return = substr($return,0,$x-1)."?".substr($return,$x+1); + } + debug($return); + redirect($return); + } + if (array_key_exists('commentcounter',$session) && + $session['commentcounter']==$counter) { + if ($section || $talkline || $comment) { + $tcom = color_sanitize($comment); + if ($tcom == "" || $tcom == ":" || $tcom == "::" || $tcom == "/me") + $emptypost = 1; + else injectcommentary($section, $talkline, $comment, $schema); + } + } +} + +function injectsystemcomment($section,$comment) { + //function lets gamemasters put in comments without a user association...be careful, it is not trackable who posted it + if (strncmp($comment, "/game", 5) !== 0) { + $comment = "/game" . $comment; + } + injectrawcomment($section,0,$comment); +} + +function injectrawcomment($section, $author, $comment) +{ + $sql = "INSERT INTO " . db_prefix("commentary") . " (postdate,section,author,comment) VALUES ('".date("Y-m-d H:i:s")."','$section',$author,\"$comment\")"; + db_query($sql); + invalidatedatacache("comments-{$section}"); + // invalidate moderation screen also. + invalidatedatacache("comments-or11"); +} + +function injectcommentary($section, $talkline, $comment, $schema=false) { + global $session,$doublepost, $translation_namespace; + if ($schema===false) $schema=$translation_namespace; + // Make the comment pristine so that we match on it correctly. + $comment = stripslashes($comment); + tlschema("commentary"); + $doublepost=0; + $emptypost = 0; + $colorcount = 0; + if ($comment !="") { + $commentary = str_replace("`n","",soap($comment)); + $y = strlen($commentary); + for ($x=0;$x<$y;$x++){ + if (substr($commentary,$x,1)=="`"){ + $colorcount++; + if ($colorcount>=getsetting("maxcolors",10)){ + $commentary = substr($commentary,0,$x).color_sanitize(substr($commentary,$x)); + $x=$y; + } + $x++; + } + } + + $args = array('commentline'=>$commentary, 'commenttalk'=>$talkline); + $args = modulehook("commentary", $args); + $commentary = $args['commentline']; + $talkline = $args['commenttalk']; + tlschema($schema); + $talkline = translate_inline($talkline); + tlschema(); + + $commentary = preg_replace("'([^[:space:]]{45,45})([^[:space:]])'","\\1 \\2",$commentary); + $commentary = addslashes($commentary); + // do an emote if the area has a custom talkline and the user + // isn't trying to emote already. + if ($talkline!="says" && substr($commentary,0,1)!=":" && + substr($commentary,0,2)!="::" && + substr($commentary,0,3)!="/me" && + substr($commentary,0,5) != "/game") { + $commentary = ":`3$talkline, \\\"`#$commentary`3\\\""; + } + if (substr($commentary,0,5)=="/game" && ($session['user']['superuser']&SU_IS_GAMEMASTER)==SU_IS_GAMEMASTER) { + //handle game master inserts now, allow double posts + injectsystemcomment($section,$commentary); + } else { + $sql = "SELECT comment,author FROM " . db_prefix("commentary") . " WHERE section='$section' ORDER BY commentid DESC LIMIT 1"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + db_free_result($result); + if ($row['comment']!=stripslashes($commentary) || + $row['author']!=$session['user']['acctid']){ + injectrawcomment($section, $session['user']['acctid'], + $commentary); + $session['user']['laston']=date("Y-m-d H:i:s"); + } else { + $doublepost = 1; + } + } + tlschema(); + } +} + +function commentdisplay($intro, $section, $message="Interject your own commentary?",$limit=10,$talkline="says",$schema=false) { + // Let's add a hook for modules to block commentary sections + $args = modulehook("blockcommentarea", array("section"=>$section)); + if (isset($args['block']) && ($args['block'] == "yes")) + return; + + if ($intro) output($intro); + viewcommentary($section, $message, $limit, $talkline, $schema); +} + +function viewcommentary($section,$message="Interject your own commentary?",$limit=10,$talkline="says",$schema=false) { + global $session,$REQUEST_URI,$doublepost, $translation_namespace; + global $emptypost; + + rawoutput(""); + // Let's add a hook for modules to block commentary sections + $args = modulehook("blockcommentarea", array("section"=>$section)); + if (isset($args['block']) && ($args['block'] == "yes")) + return; + + if ($schema === false) + $schema=$translation_namespace; + tlschema("commentary"); + + $nobios = array("motd.php"=>true); + if (!array_key_exists(basename($_SERVER['SCRIPT_NAME']),$nobios)) $nobios[basename($_SERVER['SCRIPT_NAME'])] = false; + if ($nobios[basename($_SERVER['SCRIPT_NAME'])]) + $linkbios=false; + else + $linkbios=true; + + if ($message=="X") $linkbios=true; + + if ($doublepost) output("`\$`bDouble post?`b`0`n"); + if ($emptypost) output("`\$`bWell, they say silence is a virtue.`b`0`n"); + + $clanrankcolors=array("`!","`#","`^","`&","`\$"); + + // Needs to be here because scrolling through the commentary pages, entering a bio, then scrolling again forward + // then re-entering another bio will lead to $com being smaller than 0 and this will lead to an SQL error later on. + $com=(int)httpget("comscroll"); + if ($com < 0) $com = 0; + $cc = false; + if (httpget("comscroll") !==false && (int)$session['lastcom']==$com+1) + $cid = (int)$session['lastcommentid']; + else + $cid = 0; + + $session['lastcom'] = $com; + + if ($com > 0 || $cid > 0) { + // Find newly added comments. + $sql = "SELECT COUNT(commentid) AS newadded FROM " . + db_prefix("commentary") . " LEFT JOIN " . + db_prefix("accounts") . " ON " . + db_prefix("accounts") . ".acctid = " . + db_prefix("commentary"). ".author WHERE section='$section' AND " . + "(".db_prefix("accounts").".locked=0 or ".db_prefix('accounts').".locked is null) AND commentid > '$cid'"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + $newadded = $row['newadded']; + } else { + $newadded = 0; + } + + $commentbuffer = array(); + if ($cid == 0) { + $sql = "SELECT ". db_prefix("commentary") . ".*, " . + db_prefix("accounts").".name, " . + db_prefix("accounts").".acctid, " . + db_prefix("accounts").".clanrank, " . + db_prefix("clans") . ".clanshort FROM " . + db_prefix("commentary") . " LEFT JOIN " . + db_prefix("accounts") . " ON " . + db_prefix("accounts") . ".acctid = " . + db_prefix("commentary"). ".author LEFT JOIN " . + db_prefix("clans") . " ON " . + db_prefix("clans") . ".clanid=" . + db_prefix("accounts") . + ".clanid WHERE section = '$section' AND " . + "( ".db_prefix("accounts") . ".locked=0 OR ".db_prefix("accounts") .".locked is null ) ". + "ORDER BY commentid DESC LIMIT " . + ($com*$limit).",$limit"; + if ($com==0 && strstr( $_SERVER['REQUEST_URI'], "/moderate.php" ) !== $_SERVER['REQUEST_URI'] ) + $result = db_query_cached($sql,"comments-{$section}"); + else + $result = db_query($sql); + while($row = db_fetch_assoc($result)) $commentbuffer[] = $row; + } else { + $sql = "SELECT " . db_prefix("commentary") . ".*, " . + db_prefix("accounts").".name, " . + db_prefix("accounts").".acctid, " . + db_prefix("accounts").".clanrank, " . + db_prefix("clans").".clanshort FROM " . + db_prefix("commentary") . " LEFT JOIN " . + db_prefix("accounts") . " ON " . + db_prefix("accounts") . ".acctid = " . + db_prefix("commentary"). ".author LEFT JOIN " . + db_prefix("clans") . " ON " . db_prefix("clans") . ".clanid=" . + db_prefix("accounts") . + ".clanid WHERE section = '$section' AND " . + "( ".db_prefix("accounts") . ".locked=0 OR ".db_prefix("accounts") .".locked is null ) ". + "AND commentid > '$cid' " . + "ORDER BY commentid ASC LIMIT $limit"; + $result = db_query($sql); + while ($row = db_fetch_assoc($result)) $commentbuffer[] = $row; + $commentbuffer = array_reverse($commentbuffer); + } + + $rowcount = count($commentbuffer); + if ($rowcount > 0) + $session['lastcommentid'] = $commentbuffer[0]['commentid']; + + $counttoday=0; + for ($i=0; $i < $rowcount; $i++){ + $row = $commentbuffer[$i]; + $row['comment'] = comment_sanitize($row['comment']); + $commentids[$i] = $row['commentid']; + if (date("Y-m-d",strtotime($row['postdate']))==date("Y-m-d")){ + if ($row['name']==$session['user']['name']) $counttoday++; + } + $x=0; + $ft=""; + for ($x=0;strlen($ft)<5 && $x""?"{$clanrankcolors[ceil($row['clanrank']/10)]}<`2{$row['clanshort']}{$clanrankcolors[ceil($row['clanrank']/10)]}> `&":"").$row['name']; + } + if ($ft=="::" || $ft=="/me" || $ft==":"){ + $x = strpos($row['comment'],$ft); + if ($x!==false){ + if ($linkbios) + $op[$i] = str_replace("&","&",HTMLEntities(substr($row['comment'],0,$x), ENT_COMPAT, getsetting("charset", "ISO-8859-1")))."`0\n`&{$row['name']}`0\n`& ".str_replace("&","&",HTMLEntities(substr($row['comment'],$x+strlen($ft)), ENT_COMPAT, getsetting("charset", "ISO-8859-1")))."`0`n"; + else + $op[$i] = str_replace("&","&",HTMLEntities(substr($row['comment'],0,$x), ENT_COMPAT, getsetting("charset", "ISO-8859-1")))."`0`&{$row['name']}`0`& ".str_replace("&","&",HTMLEntities(substr($row['comment'],$x+strlen($ft)), ENT_COMPAT, getsetting("charset", "ISO-8859-1")))."`0`n"; + $rawc[$i] = str_replace("&","&",HTMLEntities(substr($row['comment'],0,$x), ENT_COMPAT, getsetting("charset", "ISO-8859-1")))."`0`&{$row['name']}`0`& ".str_replace("&","&",HTMLEntities(substr($row['comment'],$x+strlen($ft)), ENT_COMPAT, getsetting("charset", "ISO-8859-1")))."`0`n"; + } + } + if ($ft=="/game" && !$row['name']) { + $x = strpos($row['comment'],$ft); + if ($x!==false){ + $op[$i] = str_replace("&","&",HTMLEntities(substr($row['comment'],0,$x), ENT_COMPAT, getsetting("charset", "ISO-8859-1")))."`0`&".str_replace("&","&",HTMLEntities(substr($row['comment'],$x+strlen($ft)), ENT_COMPAT, getsetting("charset", "ISO-8859-1")))."`0`n"; + } + } + if (!isset($op) || !is_array($op)) $op = array(); + if (!array_key_exists($i,$op) || $op[$i] == "") { + if ($linkbios) + $op[$i] = "`0`&{$row['name']}`0`3 says, \"`#".str_replace("&","&",HTMLEntities($row['comment'], ENT_COMPAT, getsetting("charset", "ISO-8859-1")))."`3\"`0`n"; + elseif (substr($ft,0,5)=='/game' && !$row['name']) + $op[$i] = str_replace("&","&",HTMLEntities($row['comment'], ENT_COMPAT, getsetting("charset", "ISO-8859-1"))); + else + $op[$i] = "`&{$row['name']}`3 says, \"`#".str_replace("&","&",HTMLEntities($row['comment'], ENT_COMPAT, getsetting("charset", "ISO-8859-1")))."`3\"`0`n"; + $rawc[$i] = "`&{$row['name']}`3 says, \"`#".str_replace("&","&",HTMLEntities($row['comment'], ENT_COMPAT, getsetting("charset", "ISO-8859-1")))."`3\"`0`n"; + } + + if (!array_key_exists('timestamp', $session['user']['prefs'])) + $session['user']['prefs']['timestamp'] = 0; + + $session['user']['prefs']['timeoffset'] = round($session['user']['prefs']['timeoffset'],1); + + if ($session['user']['prefs']['timestamp']==1) { + if (!isset($session['user']['prefs']['timeformat'])) $session['user']['prefs']['timeformat'] = "[m/d h:ia]"; + $time = strtotime($row['postdate']) + ($session['user']['prefs']['timeoffset'] * 60 * 60); + $s=date("`7" . $session['user']['prefs']['timeformat'] . "`0 ",$time); + $op[$i] = $s.$op[$i]; + }elseif ($session['user']['prefs']['timestamp']==2) { + $s=reltime(strtotime($row['postdate'])); + $op[$i] = "`7($s)`0 ".$op[$i]; + } + if ($message=="X") + $op[$i]="`0({$row['section']}) ".$op[$i]; + if ($row['postdate']>=$session['user']['recentcomments']) + $op[$i]="> ".$op[$i]; + addnav("",$link); + $auth[$i] = $row['author']; + if (isset($rawc[$i])) { + $rawc[$i] = full_sanitize($rawc[$i]); + $rawc[$i] = htmlentities($rawc[$i], ENT_QUOTES, getsetting("charset", "ISO-8859-1")); + } + } + $i--; + $outputcomments=array(); + $sect="x"; + + $moderating=false; + if (($session['user']['superuser'] & SU_EDIT_COMMENTS) && $message=="X") + $moderating=true; + + $del=translate_inline("Del"); + $scriptname=substr($_SERVER['SCRIPT_NAME'],strrpos($_SERVER['SCRIPT_NAME'],"/")+1); + $pos=strpos($_SERVER['REQUEST_URI'],"?"); + $return=$scriptname.($pos==false?"":substr($_SERVER['REQUEST_URI'],$pos)); + $one=(strstr($return,"?")==false?"?":"&"); + + for (;$i>=0;$i--){ + $out=""; + if ($moderating){ + if ($session['user']['superuser'] & SU_EDIT_USERS){ + $out.="`0[ | Ban ] "; + addnav("","user.php?op=setupban&userid=$auth[$i]&reason=".rawurlencode($rawc[$i])); + }else{ + $out.="`0[ ] "; + } + $matches=array(); + preg_match("/[(]([^)]*)[)]/",$op[$i],$matches); + $sect=trim($matches[1]); + if (substr($sect,0,5)!="clan-" || $sect==$section){ + if (substr($sect,0,4)!="pet-"){ + $out.=$op[$i]; + if (!isset($outputcomments[$sect]) || + !is_array($outputcomments[$sect])) + $outputcomments[$sect]=array(); + array_push($outputcomments[$sect],$out); + } + } + }else{ + if ($session['user']['superuser'] & SU_EDIT_COMMENTS) { + $out.="`2[$del`2]`0 "; + addnav("",$return.$one."removecomment={$commentids[$i]}§ion=$section&returnpath=".URLEncode($return).""); + } + $out.=$op[$i]; + if (!array_key_exists($sect,$outputcomments) || !is_array($outputcomments[$sect])) + $outputcomments[$sect]=array(); + array_push($outputcomments[$sect],$out); + } + } + + if ($moderating){ + $scriptname=substr($_SERVER['SCRIPT_NAME'],strrpos($_SERVER['SCRIPT_NAME'],"/")+1); + addnav("","$scriptname?op=commentdelete&return=".URLEncode($_SERVER['REQUEST_URI'])); + $mod_Del1 = htmlentities(translate_inline("Delete Checked Comments"), ENT_COMPAT, getsetting("charset", "ISO-8859-1")); + $mod_Del2 = htmlentities(translate_inline("Delete Checked & Ban (3 days)"), ENT_COMPAT, getsetting("charset", "ISO-8859-1")); + $mod_Del_confirm = addslashes(htmlentities(translate_inline("Are you sure you wish to ban this user and have you specified the exact reason for the ban, i.e. cut/pasted their offensive comments?"), ENT_COMPAT, getsetting("charset", "ISO-8859-1"))); + $mod_reason = translate_inline("Reason:"); + $mod_reason_desc = htmlentities(translate_inline("Banned for comments you posted."), ENT_COMPAT, getsetting("charset", "ISO-8859-1")); + + output_notl("
",true); + output_notl("",true); + output_notl("",true); + output_notl("`n$mod_reason ",true); + } + + + //output the comments + ksort($outputcomments); + reset($outputcomments); + $sections = commentarylocs(); + $needclose = 0; + + while (list($sec,$v)=each($outputcomments)){ + if ($sec!="x") { + if($needclose) modulehook("}collapse"); + output_notl("`n
`b`^%s`0`b`n", + $sec, isset($sections[$sec]) ? $sections[$sec] : "($sec)", true); + addnav("", "moderate.php?area=$sec"); + modulehook("collapse{",array("name"=>"com-".$sec)); + $needclose = 1; + } else { + modulehook("collapse{",array("name"=>"com-".$section)); + $needclose = 1; + } + reset($v); + while (list($key,$val)=each($v)){ + $args = array('commentline'=>$val); + $args = modulehook("viewcommentary", $args); + $val = $args['commentline']; + output_notl($val, true); + } + } + + if ($moderating && $needclose) { + modulehook("}collapse"); + $needclose = 0; + } + + if ($moderating){ + output_notl("`n"); + rawoutput(""); + rawoutput(""); + output_notl("`n%s ", $mod_reason); + rawoutput(""); + rawoutput("
"); + output_notl("`n"); + } + + if ($session['user']['loggedin']) { + $args = modulehook("insertcomment", array("section"=>$section)); + if (array_key_exists("mute",$args) && $args['mute'] && + !($session['user']['superuser'] & SU_EDIT_COMMENTS)) { + output_notl("%s", $args['mutemsg']); + } elseif ($counttoday<($limit/2) || + ($session['user']['superuser']&~SU_DOESNT_GIVE_GROTTO) + || !getsetting('postinglimit',1)){ + if ($message!="X"){ + $message="`n`@$message`n"; + output($message); + talkform($section,$talkline,$limit,$schema); + } + }else{ + $message="`n`@$message`n"; + output($message); + output("Sorry, you've exhausted your posts in this section for now.`0`n"); + } + } + + $jump = false; + if (!isset($session['user']['prefs']['nojump']) || $session['user']['prefs']['nojump'] == false) { + $jump = true; + } + + $firstu = translate_inline("<< First Unseen"); + $prev = translate_inline("< Previous"); + $ref = translate_inline("Refresh"); + $next = translate_inline("Next >"); + $lastu = translate_inline("Last Page >>"); + if ($rowcount>=$limit || $cid>0){ + $sql = "SELECT count(commentid) AS c FROM " . db_prefix("commentary") . " WHERE section='$section' AND postdate > '{$session['user']['recentcomments']}'"; + $r = db_query($sql); + $val = db_fetch_assoc($r); + $val = round($val['c'] / $limit + 0.5,0) - 1; + if ($val>0){ + $first = comscroll_sanitize($REQUEST_URI)."&comscroll=".($val); + $first = str_replace("?&","?",$first); + if (!strpos($first,"?")) $first = str_replace("&","?",$first); + $first .= "&refresh=1"; + if ($jump) { + $first .= "#$section"; + } + output_notl("$firstu",true); + addnav("",$first); + }else{ + output_notl($firstu,true); + } + $req = comscroll_sanitize($REQUEST_URI)."&comscroll=".($com+1); + $req = str_replace("?&","?",$req); + if (!strpos($req,"?")) $req = str_replace("&","?",$req); + $req .= "&refresh=1"; + if ($jump) { + $req .= "#$section"; + } + output_notl("$prev",true); + addnav("",$req); + }else{ + output_notl("$firstu $prev",true); + } + $last = appendlink(comscroll_sanitize($REQUEST_URI),"refresh=1"); + + // Okay.. we have some smart-ass (or stupidass, you guess) players + // who think that the auto-reload firefox plugin is a good way to + // avoid our timeouts. Won't they be surprised when I take that little + // hack away. + $last = appendcount($last); + + $last = str_replace("?&","?",$last); + if ($jump) { + $last .= "#$section"; + } + //if (!strpos($last,"?")) $last = str_replace("&","?",$last); + //debug($last); + output_notl(" $ref ",true); + addnav("",$last); + if ($com>0 || ($cid > 0 && $newadded > $limit)){ + $req = comscroll_sanitize($REQUEST_URI)."&comscroll=".($com-1); + $req = str_replace("?&","?",$req); + if (!strpos($req,"?")) $req = str_replace("&","?",$req); + $req .= "&refresh=1"; + if ($jump) { + $req .= "#$section"; + } + output_notl(" $next",true); + addnav("",$req); + output_notl(" $lastu",true); + }else{ + output_notl("$next $lastu",true); + } + if (!$cc) db_free_result($result); + tlschema(); + if ($needclose) modulehook("}collapse"); +} + +function talkform($section,$talkline,$limit=10,$schema=false){ + require_once("lib/forms.php"); + global $REQUEST_URI,$session,$translation_namespace; + if ($schema===false) $schema=$translation_namespace; + tlschema("commentary"); + + $jump = false; + if (isset($session['user']['prefs']['nojump']) && $session['user']['prefs']['nojump'] == true) { + $jump = true; + } + + $counttoday=0; + if (substr($section,0,5)!="clan-"){ + $sql = "SELECT author FROM " . db_prefix("commentary") . " WHERE section='$section' AND postdate>'".date("Y-m-d 00:00:00")."' ORDER BY commentid DESC LIMIT $limit"; + $result = db_query($sql); + while ($row=db_fetch_assoc($result)){ + if ($row['author']==$session['user']['acctid']) $counttoday++; + } + if (round($limit/2,0)-$counttoday <= 0 && getsetting('postinglimit',1)){ + if ($session['user']['superuser']&~SU_DOESNT_GIVE_GROTTO){ + output("`n`)(You'd be out of posts if you weren't a superuser or moderator.)`n"); + }else{ + output("`n`)(You are out of posts for the time being. Once some of your existing posts have moved out of the comment area, you'll be allowed to post again.)`n"); + return false; + } + } + } + if (translate_inline($talkline,$schema)!="says") + $tll = strlen(translate_inline($talkline,$schema))+11; + else $tll=0; + $req = comscroll_sanitize($REQUEST_URI)."&comment=1"; + $req = str_replace("?&","?",$req); + if (!strpos($req,"?")) $req = str_replace("&","?",$req); + if ($jump) { + $req .= "#$section"; + } + addnav("",$req); + output_notl("
",true); + previewfield("insertcommentary", $session['user']['name'], $talkline, true, array("size"=>"40", "maxlength"=>200-$tll)); + rawoutput(""); + rawoutput(""); + rawoutput(""); + $session['commentcounter'] = $session['counter']; + if ($section=="X"){ + $vname = getsetting("villagename", LOCATION_FIELDS); + $iname = getsetting("innname", LOCATION_INN); + $sections = commentarylocs(); + reset ($sections); + output_notl("",true); + }else{ + output_notl("",true); + } + $add = htmlentities(translate_inline("Add"), ENT_QUOTES, getsetting("charset", "ISO-8859-1")); + output_notl("`n",true); + if (round($limit/2,0)-$counttoday < 3 && getsetting('postinglimit',1)){ + output("`)(You have %s posts left today)`n`0",(round($limit/2,0)-$counttoday)); + } + rawoutput("
"); + tlschema(); +} +?> diff --git a/lotgd-web/lotgd/lib/constants.php b/lotgd-web/lotgd/lib/constants.php new file mode 100755 index 0000000..a18e572 --- /dev/null +++ b/lotgd-web/lotgd/lib/constants.php @@ -0,0 +1,87 @@ + diff --git a/lotgd-web/lotgd/lib/creatures.php b/lotgd-web/lotgd/lib/creatures.php new file mode 100755 index 0000000..566585b --- /dev/null +++ b/lotgd-web/lotgd/lib/creatures.php @@ -0,0 +1,158 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/datacache.php b/lotgd-web/lotgd/lib/datacache.php new file mode 100755 index 0000000..f9d077d --- /dev/null +++ b/lotgd-web/lotgd/lib/datacache.php @@ -0,0 +1,138 @@ + strtotime("-$duration seconds")){ + //the cache file *does* exist, and is not overly old. + $fullfile = @file_get_contents($fullname); + if ($fullfile > ""){ + $datacache[$name] = @unserialize($fullfile); + return $datacache[$name]; + }else{ + return false; + } + } + } + } + // The field didn't exist, or it was too old. + return false; +} + +//do NOT send simply a false value in to array or it will bork datacache in to +//thinking that no data is cached or we are outside of the cache period. +function updatedatacache($name,$data){ + global $datacache; + if (getsetting("usedatacache",0)){ + $fullname = makecachetempname($name); + $datacache[$name] = $data; //serialize($array); + $fp = fopen($fullname,"w"); + if ($fp){ + if (!fwrite($fp,serialize($data))){ + }else{ + } + fclose($fp); + }else{ + } + return true; + } + //debug($datacache); + return false; +} + +//we want to be able to invalidate data caches when we know we've done +//something which would change the data. +function invalidatedatacache($name,$full=false){ + global $datacache; + if (getsetting("usedatacache",0)){ + if(!$full) $fullname = makecachetempname($name); + else $fullname = $name; + if (file_exists($fullname)) @unlink($fullname); + unset($datacache[$name]); + } +} + + +//Invalidates *all* caches, which contain $name at the beginning of their filename. +function massinvalidate($name) { + if (getsetting("usedatacache",0)){ + $name = DATACACHE_FILENAME_PREFIX.$name; + global $datacachefilepath; + if ($datacachefilepath=="") + $datacachefilepath = getsetting("datacachepath","/tmp"); + $dir = @dir($datacachefilepath); + if(is_object($dir)) { + while(false !== ($file = $dir->read())) { + if (strpos($file, $name) !== false) { + invalidatedatacache($dir->path."/".$file,true); + } + } + $dir->close(); + } + } +} + + +function makecachetempname($name){ + //one place to sanitize names for data caches. + global $datacache, $datacachefilepath,$checkedforolddatacaches; + if ($datacachefilepath=="") + $datacachefilepath = getsetting("datacachepath","/tmp"); + //let's make sure that someone can't trick us in to + $name = DATACACHE_FILENAME_PREFIX.preg_replace("'[^A-Za-z0-9.-]'","",$name); + $fullname = $datacachefilepath."/".$name; + //clean out double slashes (this also blocks file wrappers woot) + $fullname = preg_replace("'//'","/",$fullname); + $fullname = preg_replace("'\\\\'","\\",$fullname); + + + if ($checkedforolddatacaches==false){ + $checkedforolddatacaches=true; + // we want this to be 1 in 100 chance per page hit, not per data + // cache call. + // Once a hundred page hits, we want to clean out old caches. +// if (mt_rand(1,100)<2){ +// $handle = opendir($datacachefilepath); +// while (($file = readdir($handle)) !== false) { +// if (substr($file,0,strlen(DATACACHE_FILENAME_PREFIX)) == +// DATACACHE_FILENAME_PREFIX){ +// $fn = $datacachefilepath."/".$file; +// $fn = preg_replace("'//'","/",$fn); +// $fn = preg_replace("'\\\\'","\\",$fn); +// if (is_file($fn) && +// filemtime($fn) < strtotime("-24 hours")){ +// unlink($fn); +// }else{ +// } +// } +// } +// } + } + return $fullname; +} + +?> diff --git a/lotgd-web/lotgd/lib/datetime.php b/lotgd-web/lotgd/lib/datetime.php new file mode 100755 index 0000000..6d85263 --- /dev/null +++ b/lotgd-web/lotgd/lib/datetime.php @@ -0,0 +1,166 @@ +"d","h"=>"h","m"=>"m","s"=>"s"); + $array=translate_inline($array,"datetime"); + if ($d > 0) + $o = $d.$array['d'].($h>0?$h.$array['h']:""); + elseif ($h > 0) + $o = $h.$array['h'].($m>0?$m.$array['m']:""); + elseif ($m > 0) + $o = $m.$array['m'].($s>0?$s.$array['s']:""); + else + $o = $s.$array['s']; + +/* if ($d > 0) + $o = sprintf("%3s%2s",$d.$array['d'],($h>0?$h.$array['h']:"")); + elseif ($h > 0) + $o = sprintf("%3s%2s",$h.$array['h'],($m>0?$m.$array['m']:"")); + elseif ($m > 0) + $o = sprintf("%3s%2s",$m.$array['m'],($s>0?$s.$array['s']:"")); + else + $o = sprintf("%5s", $s.$array['s']); + $o = str_replace(" ", " ", $o);*/ + }else{ + $array=array("day"=>"day","days"=>"days","hour"=>"hour","hours"=>"hours","minute"=>"minute","minutes"=>"minutes","second"=>"second","seconds"=>"second"); + $array=translate_inline($array,"datetime"); //translate it... tl-ready now + if ($d > 0) + $o = "$d ".($d>1?$array['days']:$array['day']).($h>0?", $h ".($h>1?$array['hours']:$array['hour']):""); + elseif ($h > 0) + $o = "$h ".($h>1?$array['hours']:$array['hour']).($m>0?", $m ".($m>1?$array['minutes']:$array['minute']):""); + elseif ($m > 0) + $o = "$m ".($m>1?$array['minutes']:$array['minute']).($s>0?", $s ".($s>1?$array['seconds']:$array['second']):""); + else + $o = "$s ".($s>0?$array['seconds']:$array['second']); + } + return $o; +} + +function relativedate($indate){ + $laston = round((strtotime("now")-strtotime($indate)) / 86400,0) . " days"; + tlschema("datetime"); + if (substr($laston,0,2)=="1 ") + $laston=translate_inline("1 day"); + elseif (date("Y-m-d",strtotime($laston)) == date("Y-m-d")) + $laston=translate_inline("Today"); + elseif (date("Y-m-d",strtotime($laston)) == date("Y-m-d",strtotime("-1 day"))) + $laston=translate_inline("Yesterday"); + elseif (strpos($indate,"0000-00-00")!==false) + $laston = translate_inline("Never"); + else { + $laston= sprintf_translate("%s days", round((strtotime("now")-strtotime($indate)) / 86400,0)); + rawoutput(tlbutton_clear()); + } + tlschema(); + return $laston; +} + +function checkday() { + global $session,$revertsession,$REQUEST_URI; + if ($session['user']['loggedin']){ + output_notl("",true); + if(is_new_day()){ + $post = $_POST; + unset($post['i_am_a_hack']); + if (count($post) > 0){ + $session['user']['lasthit'] = "0000-00-00 00:00:00"; + return; + } else { + $session=$revertsession; + $session['user']['restorepage']=$REQUEST_URI; + $session['allowednavs']=array(); + addnav("","newday.php"); + redirect("newday.php"); + } + } + } +} + +function is_new_day($now=0){ + global $session; + + if ($session['user']['lasthit'] == "0000-00-00 00:00:00") { + return true; + } + $t1 = gametime(); + $t2 = convertgametime(strtotime($session['user']['lasthit']." +0000")); + $d1 = gmdate("Y-m-d",$t1); + $d2 = gmdate("Y-m-d",$t2); + + if ($d1!=$d2){ + return true; + } + return false; +} + +function getgametime(){ + return gmdate("g:i a",gametime()); +} + +function gametime(){ + $time = convertgametime(strtotime("now")); + return $time; +} + +function convertgametime($intime,$debug=false){ + + //adjust the requested time by the game offset + $intime -= getsetting("gameoffsetseconds",0); + + // we know that strtotime gives us an identical timestamp for + // everywhere in the world at the same time, if it is provided with + // the GMT offset: + $epoch = strtotime(getsetting("game_epoch",gmdate("Y-m-d 00:00:00 O",strtotime("-30 days")))); + $now = strtotime(gmdate("Y-m-d H:i:s O",$intime)); + $logd_timestamp = ($now - $epoch) * getsetting("daysperday",4); + if ($debug){ + echo "Game Timestamp: ".$logd_timestamp.", which makes it ".gmdate("Y-m-d H:i:s",$logd_timestamp)."
"; + } + return $logd_timestamp; +} + +function gametimedetails(){ + $ret = array(); + $ret['now'] = date("Y-m-d 00:00:00"); + $ret['gametime'] = gametime(); + $ret['daysperday'] = getsetting("daysperday", 4); + $ret['secsperday'] = 86400/$ret['daysperday']; + $ret['today'] = strtotime(gmdate("Y-m-d 00:00:00 O", $ret['gametime'])); + $ret['tomorrow'] = + strtotime(gmdate("Y-m-d H:i:s O",$ret['gametime'])." + 1 day"); + $ret['tomorrow'] = strtotime(gmdate("Y-m-d 00:00:00 O",$ret['tomorrow'])); + // Why isn't this + // $ret['tomorrow'] = + // strtotime(gmdate("Y-m-d 00:00:00 O",$ret['gametime'])." + 1 day"); + $ret['secssofartoday'] = $ret['gametime'] - $ret['today']; + $ret['secstotomorrow'] = $ret['tomorrow']-$ret['gametime']; + $ret['realsecssofartoday'] = $ret['secssofartoday'] / $ret['daysperday']; + $ret['realsecstotomorrow'] = $ret['secstotomorrow'] / $ret['daysperday']; + $ret['dayduration'] = ($ret['tomorrow']-$ret['today'])/$ret['daysperday']; + return $ret; +} + +function secondstonextgameday($details=false) { + if ($details===false) $details = gametimedetails(); + return strtotime("{$details['now']} + {$details['realsecstotomorrow']} seconds"); +} + +function getmicrotime(){ + list($usec, $sec) = explode(" ",microtime()); + return ((float)$usec + (float)$sec); +} + + +?> diff --git a/lotgd-web/lotgd/lib/dbwrapper.php b/lotgd-web/lotgd/lib/dbwrapper.php new file mode 100755 index 0000000..40ecc64 --- /dev/null +++ b/lotgd-web/lotgd/lib/dbwrapper.php @@ -0,0 +1,33 @@ + diff --git a/lotgd-web/lotgd/lib/dbwrapper_mysql.php b/lotgd-web/lotgd/lib/dbwrapper_mysql.php new file mode 100755 index 0000000..ff41d79 --- /dev/null +++ b/lotgd-web/lotgd/lib/dbwrapper_mysql.php @@ -0,0 +1,197 @@ +".HTMLEntities($sql, ENT_COMPAT, getsetting("charset", "ISO-8859-1"))."" + .db_error(LINK) + .show_backtrace() + ); + }else{ + die("A most bogus error has occurred. I apologise, but the page you were trying to access is broken. Please use your browser's back button and try again."); + } + } + } + $endtime = getmicrotime(); + if ($endtime - $starttime >= 1.00 && ($session['user']['superuser'] & SU_DEBUG_OUTPUT)){ + $s = trim($sql); + if (strlen($s) > 800) $s = substr($s,0,400)." ... ".substr($s,strlen($s)-400); + debug("Slow Query (".round($endtime-$starttime,2)."s): ".(HTMLEntities($s, ENT_COMPAT, getsetting("charset", "ISO-8859-1")))."`n"); + } + unset($dbinfo['affected_rows']); + $dbinfo['affected_rows']=db_affected_rows(); + $dbinfo['querytime'] += $endtime-$starttime; + return $r; +} + +//& at the start returns a reference to the data array. +//since it's possible this array is large, we'll save ourselves +//the overhead of duplicating the array, then destroying the old +//one by returning a reference instead. +function &db_query_cached($sql,$name,$duration=900){ + //this function takes advantage of the data caching library to make + //all of the other db_functions act just like MySQL queries but rely + //instead on disk cached data. + //if (getsetting("usedatacache", 0) == 1) debug("DataCache: $name"); + //standard is 15 minutes, als hooks don't need to be cached *that* often, normally you invalidate the cache properly + global $dbinfo; + $data = datacache($name,$duration); + if (is_array($data)){ + reset($data); + $dbinfo['affected_rows']=-1; + return $data; + }else{ + $result = db_query($sql); + $data = array(); + while ($row = db_fetch_assoc($result)) { + $data[] = $row; + } + updatedatacache($name,$data); + reset($data); + return $data; + } +} + +if (file_exists("lib/dbremote.php")) { + require_once("lib/dbremote.php"); +} + +function db_error($link=false){ + $fname = DBTYPE."_error"; + if ($link!==false) + $r = @$fname($link); + else + $r = @$fname(); + if ($r=="" && defined("DB_NODB") && !defined("DB_INSTALLER_STAGE4")) return "The database connection was never established"; + return $r; +} + +function db_fetch_assoc(&$result){ + if (is_array($result)){ + //cached data + if (list($key,$val)=each($result)) + return $val; + else + return false; + }else{ + $fname = DBTYPE."_fetch_assoc"; + $r = $fname($result); + return $r; + } +} + +function db_insert_id(){ + if (defined("DB_NODB") && !defined("LINK")) return -1; + $fname = DBTYPE."_insert_id"; + $r = $fname(LINK); + return $r; +} + +function db_num_rows($result){ + if (is_array($result)){ + return count($result); + }else{ + if (defined("DB_NODB") && !defined("LINK")) return 0; + $fname = DBTYPE."_num_rows"; + $r = @$fname($result); //Whyfor turn off error reporting here? + return $r; + } +} + +function db_affected_rows($link=false){ + global $dbinfo; + if (isset($dbinfo['affected_rows'])) { + return $dbinfo['affected_rows']; + } + if (defined("DB_NODB") && !defined("LINK")) return 0; + $fname = DBTYPE."_affected_rows"; + if ($link===false) { + $r = $fname(LINK); + }else{ + $r = $fname($link); + } + return $r; +} + +function db_pconnect($host,$user,$pass){ + $fname = DBTYPE."_pconnect"; + $r = $fname($host,$user,$pass); + return $r; +} + +function db_connect($host,$user,$pass){ + $fname = DBTYPE."_connect"; + $r = $fname($host,$user,$pass); + return $r; +} + +function db_get_server_version() +{ + $fname = DBTYPE."_get_server_info"; + if (defined("LINK")) $r = $fname(LINK); + else $r = $fname(); + return $r; +} + +function db_select_db($dbname){ + $fname = DBTYPE."_select_db"; + if(!defined("LINK")) $r = $fname($dbname); + else $r = $fname($dbname, LINK); + return $r; +} +function db_free_result($result){ + if (is_array($result)){ + //cached data + unset($result); + }else{ + if (defined("DB_NODB") && !defined("LINK")) return false; + $fname = DBTYPE."_free_result"; + $r = $fname($result); + return $r; + } +} + +function db_table_exists($tablename){ + if (defined("DB_NODB") && !defined("LINK")) return false; + $fname = DBTYPE."_query"; + $exists = $fname("SELECT 1 FROM `$tablename` LIMIT 0"); + if ($exists) return true; + return false; +} + +function db_prefix($tablename, $force=false) { + global $DB_PREFIX; + + if ($force === false) { + $special_prefixes = array(); + + // The following file should be used to override or modify the + // special_prefixes array to be correct for your site. Do NOT + // do this unles you know EXACTLY what this means to you, your + // game, your county, your state, your nation, your planet and + // your universe! + if (file_exists("prefixes.php")) require_once("prefixes.php"); + + $prefix = $DB_PREFIX; + if (isset($special_prefixes[$tablename])) { + $prefix = $special_prefixes[$tablename]; + } + } else { + $prefix = $force; + } + return $prefix . $tablename; +} + +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/dbwrapper_mysqli_oos.php b/lotgd-web/lotgd/lib/dbwrapper_mysqli_oos.php new file mode 100755 index 0000000..9b254dd --- /dev/null +++ b/lotgd-web/lotgd/lib/dbwrapper_mysqli_oos.php @@ -0,0 +1,210 @@ +Query($sql); + + if (!$r && $die === true) { + if (defined("IS_INSTALLER")){ + return array(); + }else{ + if ($session['user']['superuser'] & SU_DEVELOPER || 1){ + require_once("lib/show_backtrace.php"); + die( + "
".HTMLEntities($sql, ENT_COMPAT, getsetting("charset", "ISO-8859-1"))."
" + .db_error(LINK) + .show_backtrace() + ); + }else{ + die("A most bogus error has occurred. I apologise, but the page you were trying to access is broken. Please use your browser's back button and try again."); + } + } + } + $endtime = getmicrotime(); + if ($endtime - $starttime >= 1.00 && ($session['user']['superuser'] & SU_DEBUG_OUTPUT)){ + $s = trim($sql); + if (strlen($s) > 800) $s = substr($s,0,400)." ... ".substr($s,strlen($s)-400); + debug("Slow Query (".round($endtime-$starttime,2)."s): ".(HTMLEntities($s, ENT_COMPAT, getsetting("charset", "ISO-8859-1")))."`n"); + } + unset($dbinfo['affected_rows']); + $dbinfo['affected_rows']=db_affected_rows(); + $dbinfo['querytime'] += $endtime-$starttime; + return $r; +} + +//& at the start returns a reference to the data array. +//since it's possible this array is large, we'll save ourselves +//the overhead of duplicating the array, then destroying the old +//one by returning a reference instead. +function &db_query_cached($sql,$name,$duration=900){ + //this function takes advantage of the data caching library to make + //all of the other db_functions act just like MySQL queries but rely + //instead on disk cached data. + //if (getsetting("usedatacache", 0) == 1) debug("DataCache: $name"); + //standard is 15 minutes, als hooks don't need to be cached *that* often, normally you invalidate the cache properly + global $dbinfo; + $data = datacache($name,$duration); + if (is_array($data)){ + reset($data); + $dbinfo['affected_rows']=-1; + return $data; + }else{ + $result = db_query($sql); + $data = array(); + while ($row = db_fetch_assoc($result)) { + $data[] = $row; + } + updatedatacache($name,$data); + reset($data); + return $data; + } +} + +if (file_exists("lib/dbremote.php")) { + require_once("lib/dbremote.php"); +} + +function db_error(){ + global $mysqli_resource; + $r = $mysqli_resource->error; + if ($r=="" && defined("DB_NODB") && !defined("DB_INSTALLER_STAGE4")) return "The database connection was never established"; + return $r; +} + +function db_fetch_assoc(&$result){ + if (is_array($result)){ + //cached data + if (list($key,$val)=each($result)) + return $val; + else + return false; + }else{ + //$fname = DBTYPE."_fetch_assoc"; + //$r = $fname($result); + $r = $result->Fetch_Assoc(); + return $r; + } +} + +function db_insert_id(){ + global $mysqli_resource; + if (defined("DB_NODB") && !defined("LINK")) return -1; + //$fname = DBTYPE."_insert_id"; + //$r = $fname(); + $r = $mysqli_resource->insert_id; + return $r; +} + +function db_num_rows($result){ + if (is_array($result)){ + return count($result); + }else{ + if (defined("DB_NODB") && !defined("LINK")) return 0; + + $r = $result->num_rows; + return $r; + } +} + +function db_affected_rows($link=false){ + global $dbinfo, $mysqli_resource; + if (isset($dbinfo['affected_rows'])) { + return $dbinfo['affected_rows']; + } + if (defined("DB_NODB") && !defined("LINK")) return 0; + + $r = $mysqli_resource->affected_rows; + + return $r; +} + +function db_pconnect($host,$user,$pass){ + global $mysqli_resource; + + // Constants cannot be an object + // MySQLi do not know a pconnect + $mysqli_resource = New MySQLi($host, $user, $pass); + + if($mysqli_resource) { + return true; + } + else { + return false; + } +} + +function db_connect($host,$user,$pass){ + global $mysqli_resource; + + // Constants cannot be an object + $mysqli_resource = New MySQLi($host, $user, $pass); + + if($mysqli_resource) { + return true; + } + else { + return false; + } +} + +function db_get_server_version() { + global $mysqli_resource; + return $mysqli_resource->server_info; +} + +function db_select_db($dbname){ + global $mysqli_resource; + $r = $mysqli_resource->select_db($dbname); + return $r; +} + +function db_free_result($result){ + if (is_array($result)){ + //cached data + unset($result); + }else{ + if (defined("DB_NODB") && !defined("LINK")) return false; + $result->Free(); + return true; + } +} + +function db_table_exists($tablename){ + global $mysqli_resource; + if (defined("DB_NODB") && !defined("LINK")) return false; + $exists = $mysqli_resource->Query("SELECT 1 FROM `$tablename` LIMIT 0"); + if ($exists) return true; + return false; +} + +function db_prefix($tablename, $force=false) { + global $DB_PREFIX; + + if ($force === false) { + $special_prefixes = array(); + + // The following file should be used to override or modify the + // special_prefixes array to be correct for your site. Do NOT + // do this unles you know EXACTLY what this means to you, your + // game, your county, your state, your nation, your planet and + // your universe! + if (file_exists("prefixes.php")) require_once("prefixes.php"); + + $prefix = $DB_PREFIX; + if (isset($special_prefixes[$tablename])) { + $prefix = $special_prefixes[$tablename]; + } + } else { + $prefix = $force; + } + return $prefix . $tablename; +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/dbwrapper_mysqli_proc.php b/lotgd-web/lotgd/lib/dbwrapper_mysqli_proc.php new file mode 100755 index 0000000..bf9c3cf --- /dev/null +++ b/lotgd-web/lotgd/lib/dbwrapper_mysqli_proc.php @@ -0,0 +1,203 @@ +".HTMLEntities($sql, ENT_COMPAT, getsetting("charset", "ISO-8859-1"))."" + .db_error(LINK) + .show_backtrace() + ); + }else{ + die("A most bogus error has occurred. I apologise, but the page you were trying to access is broken. Please use your browser's back button and try again."); + } + } + } + $endtime = getmicrotime(); + if ($endtime - $starttime >= 1.00 && ($session['user']['superuser'] & SU_DEBUG_OUTPUT)){ + $s = trim($sql); + if (strlen($s) > 800) $s = substr($s,0,400)." ... ".substr($s,strlen($s)-400); + debug("Slow Query (".round($endtime-$starttime,2)."s): ".(HTMLEntities($s, ENT_COMPAT, getsetting("charset", "ISO-8859-1")))."`n"); + } + unset($dbinfo['affected_rows']); + $dbinfo['affected_rows']=db_affected_rows(); + $dbinfo['querytime'] += $endtime-$starttime; + return $r; +} + +//& at the start returns a reference to the data array. +//since it's possible this array is large, we'll save ourselves +//the overhead of duplicating the array, then destroying the old +//one by returning a reference instead. +function &db_query_cached($sql,$name,$duration=900){ + //this function takes advantage of the data caching library to make + //all of the other db_functions act just like MySQL queries but rely + //instead on disk cached data. + //if (getsetting("usedatacache", 0) == 1) debug("DataCache: $name"); + //standard is 15 minutes, als hooks don't need to be cached *that* often, normally you invalidate the cache properly + global $dbinfo; + $data = datacache($name,$duration); + if (is_array($data)){ + reset($data); + $dbinfo['affected_rows']=-1; + return $data; + }else{ + $result = db_query($sql); + $data = array(); + while ($row = db_fetch_assoc($result)) { + $data[] = $row; + } + updatedatacache($name,$data); + reset($data); + return $data; + } +} + +if (file_exists("lib/dbremote.php")) { + require_once("lib/dbremote.php"); +} + +function db_error(){ + global $mysqli_resource; + + $r = mysqli_error($mysqli_resource); + if ($r=="" && defined("DB_NODB") && !defined("DB_INSTALLER_STAGE4")) return "The database connection was never established"; + return $r; +} + +function db_fetch_assoc(&$result){ + if (is_array($result)){ + //cached data + if (list($key,$val)=each($result)) + return $val; + else + return false; + }else{ + $r = mysqli_fetch_assoc($result); + return $r; + } +} + +function db_insert_id(){ + global $mysqli_resource; + if (defined("DB_NODB") && !defined("LINK")) return -1; + $r = mysqli_insert_id($mysqli_resource); + return $r; +} + +function db_num_rows($result){ + if (is_array($result)){ + return count($result); + }else{ + if (defined("DB_NODB") && !defined("LINK")) return 0; + $r = mysqli_num_rows($result); + return $r; + } +} + +function db_affected_rows($link=false){ + global $dbinfo, $mysqli_resource; + if (isset($dbinfo['affected_rows'])) { + return $dbinfo['affected_rows']; + } + if (defined("DB_NODB") && !defined("LINK")) return 0; + + $r = mysqli_affected_rows($mysqli_resource); + + return $r; +} + +function db_pconnect($host,$user,$pass){ + global $mysqli_resource; + + $mysqli_resource = mysqli_connect($host, $user, $pass); + + if($mysqli_resource) { + return true; + } + else { + return false; + } +} + +function db_connect($host,$user,$pass){ + global $mysqli_resource; + + $mysqli_resource = mysqli_connect($host, $user, $pass); + + if($mysqli_resource) { + return true; + } + else { + return false; + } +} + +function db_get_server_version() { + global $mysqli_resource; + return mysqli_get_server_info($mysqli_resource); +} + +function db_select_db($dbname){ + global $mysqli_resource; + $r = mysqli_select_db($mysqli_resource, $dbname); + return $r; +} + +function db_free_result($result){ + if (is_array($result)){ + //cached data + unset($result); + }else{ + if (defined("DB_NODB") && !defined("LINK")) return false; + mysqli_free_result($result); + return true; + } +} + +function db_table_exists($tablename){ + global $mysqli_resource; + if (defined("DB_NODB") && !defined("LINK")) return false; + $exists = $mysqli_resource->Query("SELECT 1 FROM `$tablename` LIMIT 0"); + if ($exists) return true; + return false; +} + +function db_prefix($tablename, $force=false) { + global $DB_PREFIX; + + if ($force === false) { + $special_prefixes = array(); + + // The following file should be used to override or modify the + // special_prefixes array to be correct for your site. Do NOT + // do this unles you know EXACTLY what this means to you, your + // game, your county, your state, your nation, your planet and + // your universe! + if (file_exists("prefixes.php")) require_once("prefixes.php"); + + $prefix = $DB_PREFIX; + if (isset($special_prefixes[$tablename])) { + $prefix = $special_prefixes[$tablename]; + } + } else { + $prefix = $force; + } + return $prefix . $tablename; +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/debuglog.php b/lotgd-web/lotgd/lib/debuglog.php new file mode 100755 index 0000000..40b7fed --- /dev/null +++ b/lotgd-web/lotgd/lib/debuglog.php @@ -0,0 +1,44 @@ +'".date("Y-m-d 00:00:00")."'"; + $result = db_query($sql); + if (db_num_rows($result)>0){ + $row = db_fetch_assoc($result); + $value = $row['value']+$value; + $message = $row['message']; + $id = $row['id']; + } + } + if ($corevalue!==false) $message.=" ($corevalue)"; + if ($field===false) $field=""; + if ($value===false) $value=0; + if ($id > 0){ + $sql = "UPDATE ".db_prefix("debuglog")." + SET + date='".date("Y-m-d H:i:s")."', + actor='$user', + target='$target', + message='".addslashes($message)."', + field='$field', + value='$value' + WHERE + id=$id + "; + }else{ + $sql = "INSERT INTO " . db_prefix("debuglog") . " (id,date,actor,target,message,field,value) VALUES($id,'".date("Y-m-d H:i:s")."',$user,$target,'".addslashes($message)."','$field','$value')"; + } + db_query($sql); +} + +?> diff --git a/lotgd-web/lotgd/lib/dhms.php b/lotgd-web/lotgd/lib/dhms.php new file mode 100755 index 0000000..8257fd6 --- /dev/null +++ b/lotgd-web/lotgd/lib/dhms.php @@ -0,0 +1,10 @@ + diff --git a/lotgd-web/lotgd/lib/dump_item.php b/lotgd-web/lotgd/lib/dump_item.php new file mode 100755 index 0000000..3fce302 --- /dev/null +++ b/lotgd-web/lotgd/lib/dump_item.php @@ -0,0 +1,43 @@ +"; + while(list($key, $val) = @each($temp)) { + $out .= "'$key' = '" . dump_item($val) . "'`n"; + } + $out .= "}"; + } else { + $out .= $item; + } + return $out; +} + +function dump_item_ascode($item,$indent="\t"){ + $out = ""; + if (is_array($item)) $temp = $item; + else $temp = @unserialize($item); + if (is_array($temp)) { + $out .= "array(\n$indent"; + $row = array(); + while(list($key, $val) = @each($temp)) { + array_push($row,"'$key'=>" . dump_item_ascode($val,$indent."\t")); + } + if (strlen(join(", ",$row)) > 80){ + $out .= join(",\n$indent",$row); + }else{ + $out .= join(", ",$row); + } + $out .= "\n$indent)"; + } else { + $out .= "'".htmlentities(addslashes($item), ENT_COMPAT, getsetting("charset", "ISO-8859-1"))."'"; + } + return $out; +} + +?> diff --git a/lotgd-web/lotgd/lib/e_dom.js b/lotgd-web/lotgd/lib/e_dom.js new file mode 100755 index 0000000..63de76f --- /dev/null +++ b/lotgd-web/lotgd/lib/e_dom.js @@ -0,0 +1,152 @@ +/* + * translator ready + * addnews ready + * mail ready + */ + +//Javascript Generic DOM +//By Eric Stevens +// +function fetchDOM(filename){ + var xmldom; + if (document.implementation && + document.implementation.createDocument){ + //Mozilla style browsers + xmldom = document.implementation.createDocument("", "", null); + } else if (window.ActiveXObject) { + //IE style browsers + xmldom = new ActiveXObject("Microsoft.XMLDOM"); + } + + xmldom.async=false; + try { + xmldom.load(filename); + } catch(e){ + xmldom.parseXML("Failed to load "+filename+""); + } + return xmldom; +} +if (document.implementation && document.implementation.createDocument){ + var dom = document.implementation.createDocument("","",null); +}else{ + var dom = new ActiveXObject("Microsoft.XMLDOM"); +} +function fetchDOMasync(filename,args,theCode){ + var xmldom; + try { + xmldom = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmldom = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmldom = false; + } + } + if (!xmldom && typeof XMLHttpRequest!='undefined') { + xmldom = new XMLHttpRequest(); + } + xmldom.onreadystatechange = function(){ + if (xmldom.readyState == 4) { + theCode(); + } + }; + xmldom.open("POST",filename,true); + xmldom.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); + xmldom.send(args); + return xmldom; +} +function createXML(node){ + if (!node) return "You cannot pass null to createXML"; + if (node.xml) + return node.xml; + var out = ""; + if (node.nodeType==1){ + var x=0; + out = "<" + node.nodeName; + for (x=0; x < node.attributes.length; x++){ + out = out + " " + node.attributes[x].name + "=\"" + HTMLencode(node.attributes[x].nodeValue) + "\""; + } + out = out + ">"; + for (x=0; x < node.childNodes.length; x++){ + out = out + createXML(node.childNodes[x]); + } + out = out + ""; + }else if(node.nodeType==3){ + out = out + HTMLencode(node.nodeValue); + } + return out; +} +function selectSingleNode(node,name){ + var nextName = ""; + if (name.indexOf("/") > 0){ + nextName = name.substring(name.indexOf("/")+1); + name = name.substring(0,name.indexOf("/")); + } + for (var x=0; x/g,">"); + } +} +function HTMLdecode(input){ + if (input == null){ + return ""; + }else{ + return input.replace(/>/g,">").replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&"); + } +} diff --git a/lotgd-web/lotgd/lib/e_dom.php b/lotgd-web/lotgd/lib/e_dom.php new file mode 100755 index 0000000..91b2cd1 --- /dev/null +++ b/lotgd-web/lotgd/lib/e_dom.php @@ -0,0 +1,7 @@ +"); +?> diff --git a/lotgd-web/lotgd/lib/e_rand.php b/lotgd-web/lotgd/lib/e_rand.php new file mode 100755 index 0000000..77e5edc --- /dev/null +++ b/lotgd-web/lotgd/lib/e_rand.php @@ -0,0 +1,41 @@ +$max){ + return @mt_rand($max,$min); + } +} + +function r_rand($min=false,$max=false){ + if ($min===false) return mt_rand(); + $min*=1000; + if ($max===false) return (mt_rand($min)/1000); + $max*=1000; + if ($min==$max) return ($min/1000); + //do NOT ask me why the following line can be executed, it makes no sense, + // but it *does* get executed. + if ($min==0 && $max==0) return 0; + if ($min<$max){ + return (@mt_rand($min,$max)/1000); + }else if($min>$max){ + return (@mt_rand($max,$min)/1000); + } +} +?> diff --git a/lotgd-web/lotgd/lib/errorhandler.php b/lotgd-web/lotgd/lib/errorhandler.php new file mode 100755 index 0000000..f794fa5 --- /dev/null +++ b/lotgd-web/lotgd/lib/errorhandler.php @@ -0,0 +1,133 @@ + 1){//prevents the error handler from being re-called when we're already within a call of it. + if ($errno & (E_USER_WARNING | E_WARNING)){ + echo "PHP Warning: \"$errstr\"
in $errfile at $errline. Additionally this occurred while within logd_error_handler().
"; + }elseif ($errno & (E_USER_ERROR | E_ERROR)){ + echo "PHP ERROR: \"$errstr\"
in $errfile at $errline. Additionally this occurred while within logd_error_handler().
"; + } + $in_error_handler--; + return; + } + switch($errno){ + case E_NOTICE: + case E_USER_NOTICE: + if (getsetting('show_notices', 0) && + $session['user']['superuser'] & SU_SHOW_PHPNOTICE) { + debug("PHP Notice: \"$errstr\"
in $errfile at $errline."); + } + break; + case E_WARNING: + case E_USER_WARNING: + require_once("lib/show_backtrace.php"); + tlschema("errorhandler"); + output("PHP Warning: \"%s\"`nin `b%s`b at `b%s`b.`n",$errstr,$errfile,$errline,true); + tlschema(); + $backtrace = show_backtrace(); + rawoutput($backtrace); + if (getsetting("notify_on_warn",0) > ""){ + //$args = func_get_args(); + //call_user_func_array("logd_error_notify",$args); + logd_error_notify($errno, $errstr, $errfile, $errline, $backtrace); + } + break; + case E_ERROR: + case E_USER_ERROR: + require_once("lib/show_backtrace.php"); + echo sprintf("PHP ERROR: \"%s\"
in %s at %s.
",$errstr,$errfile,$errline); + $backtrace = show_backtrace(); + echo $backtrace; + if (getsetting("notify_on_error",0) > ""){ + //$args = func_get_args(); + //call_user_func_array("logd_error_notify",$args); + logd_error_notify($errno, $errstr, $errfile, $errline, $backtrace); + } + die(); + break; + } + $in_error_handler--; +} + +function logd_error_notify($errno, $errstr, $errfile, $errline, $backtrace){ + global $session; + $sendto = explode(";",getsetting("notify_address","")); + $howoften = getsetting("notify_every",30); + reset($sendto); + $data = datacache("error_notify",86400); + if (!is_array($data)){ + $data = array('firstrun'=>true,'errors'=>array()); + }else{ + $data['firstrun'] = false; + } + $do_notice = false; + if (!array_key_exists($errstr,$data['errors'])){ + $do_notice = true; + }elseif (strtotime("now") - ($data['errors'][$errstr]) > $howoften * 60) { + $do_notice = true; + } + if ($data['firstrun']){ + debug("First run, not notifying users."); + }else{ + if ($do_notice){ + + /*** + * Set up the mime bits + **/ + require_once("sanitize.php"); + $notice_text = "This is a multi-part message in MIME format."; + $userstr = ""; + if ($session && isset($session['user']['name']) && isset($sesson['user']['acctid'])) { + $userstr = "Error triggered by user " . $session['user']['name'] . " (" . $session['user']['acctid'] . ")\n"; + } + $plain_text = "$userstr$errstr in $errfile ($errline)\n".sanitize_html($backtrace); + $html_text = "$errstr in $errfile ($errline)
$backtrace"; + + $semi_rand = md5(time()); + $mime_boundary = "==MULTIPART_BOUNDARY_$semi_rand"; + $mime_boundary_header = chr(34) . $mime_boundary . chr(34); + $subject = "{$_SERVER['HTTP_HOST']} $level"; + + $body = "$notice_text + +--$mime_boundary +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +$plain_text + +--$mime_boundary +Content-Type: text/html; charset=us-ascii +Content-Transfer-Encoding: 7bit + +$html_text + +--$mime_boundary--"; + /*** + * Mime bits are set up, + **/ + while (list($key,$email)=each($sendto)){ + debug("Notifying $email of this error."); + + mail($email, $subject, $body, + "From: " . $from . "\n" . + "MIME-Version: 1.0\n" . + "Content-Type: multipart/alternative;\n" . + " boundary=" . $mime_boundary_header); + } + //mark the time that notice was last sent for this error. + $data['errors'][$errstr] = strtotime("now"); + }else{ + debug("Not notifying users for this error, it's only been ".round((strtotime("now") - $data['errors'][$errstr]) / 60,2)." minutes."); + } + } + updatedatacache("error_notify",$data); + debug($data); +} +set_error_handler("logd_error_handler"); +?> diff --git a/lotgd-web/lotgd/lib/errorhandling.php b/lotgd-web/lotgd/lib/errorhandling.php new file mode 100755 index 0000000..96453f3 --- /dev/null +++ b/lotgd-web/lotgd/lib/errorhandling.php @@ -0,0 +1,38 @@ + diff --git a/lotgd-web/lotgd/lib/events.php b/lotgd-web/lotgd/lib/events.php new file mode 100755 index 0000000..09b447b --- /dev/null +++ b/lotgd-web/lotgd/lib/events.php @@ -0,0 +1,69 @@ += 1.00 && ($session['user']['superuser'] & SU_DEBUG_OUTPUT))){ + debug("Slow Event (".round($endtime-$starttime,2)."s): $hookname - {$row['modulename']}`n"); + } + } + if (checknavs()) { + // The page rendered some linkage, so we just want to exit. + page_footer(); + } else { + $skipdesc=true; + $session['user']['specialinc'] = ""; + $session['user']['specialmisc'] = ""; + httpset("op", ""); + } + } + tlschema(); + return $skipdesc; +} +?> diff --git a/lotgd-web/lotgd/lib/experience.php b/lotgd-web/lotgd/lib/experience.php new file mode 100755 index 0000000..454e554 --- /dev/null +++ b/lotgd-web/lotgd/lib/experience.php @@ -0,0 +1,30 @@ +100,2=>400,3=>1002,4=>1912,5=>3140,6=>4707, + 7=>6641,8=>8985, 9=>11795,10=>15143,11=>19121,12=>23840, + 13=>29437,14=>36071,15=>43930); + + if ($curlevel < 1) return 0; + + while(list($key,$val) = each($exparray)) { + $exparray[$key] = round($val + ($curdk/4) * $key * 100, 0); + } + if ($curlevel > 15) $curlevel = 15; + $exprequired = $exparray[$curlevel]; + return $exprequired; +} + +?> diff --git a/lotgd-web/lotgd/lib/expire_chars.php b/lotgd-web/lotgd/lib/expire_chars.php new file mode 100755 index 0000000..afa8f92 --- /dev/null +++ b/lotgd-web/lotgd/lib/expire_chars.php @@ -0,0 +1,72 @@ +0?"OR (laston < \"".date("Y-m-d H:i:s",strtotime("-$old days"))."\")\n":"").($new>0?"OR (laston < \"".date("Y-m-d H:i:s",strtotime("-$new days"))."\" AND level=1 AND dragonkills=0)\n":"").($trash>0?"OR (regdate < date_add(NOW(),interval -".$trash." day) AND laston < regdate)\n":"").")"; + $result1 = db_query($sql1); + $acctids = array(); + $pinfo = array(); + $dk0lvl = 0; + $dk0ct = 0; + $dk1lvl = 0; + $dk1ct = 0; + $dks = 0; + while($row1 = db_fetch_assoc($result1)) { + require_once("lib/charcleanup.php"); + if(!char_cleanup($row1['acctid'], CHAR_DELETE_AUTO)) continue; + array_push($acctids,$row1['acctid']); + array_push($pinfo,"{$row1['login']}:dk{$row1['dragonkills']}-lv{$row1['level']}"); + if ($row1['dragonkills']==0) { + $dk0lvl += $row1['level']; + $dk0ct++; + }else if($row1['dragonkills']==1){ + $dk1lvl += $row1['level']; + $dk1ct++; + } + $dks += $row1['dragonkills']; + } + + //Log which accounts were deleted. + $msg = "[{$dk0ct}] with 0 dk avg lvl [".round($dk0lvl/max(1,$dk0ct),2)."]\n"; + $msg .= "[{$dk1ct}] with 1 dk avg lvl [".round($dk1lvl/max(1,$dk1ct),2)."]\n"; + $msg .= "Avg DK: [".round($dks/max(1,count($acctids)),2)."]\n"; + $msg .= "Accounts: ".join($pinfo,", "); + require_once("lib/gamelog.php"); + gamelog("Deleted ".count($acctids)." accounts:\n$msg","char expiration"); + + # Now delete the accounts themselves + // one less search pass, and a guarantee that the same accounts selected + // above are the ones deleted here. + if (count($acctids)) { + $sql = "DELETE FROM " . db_prefix("accounts") . + " WHERE acctid IN (".join($acctids,",").")"; + db_query($sql); + } + + $old-=5; + $sql = "SELECT acctid,emailaddress FROM " . db_prefix("accounts") . " WHERE 1=0 ".($old>0?"OR (laston < \"".date("Y-m-d H:i:s",strtotime("-$old days"))."\")\n":"")." AND emailaddress!='' AND sentnotice=0 AND (superuser&".NO_ACCOUNT_EXPIRATION.")=0"; + $result = db_query($sql); + $subject = translate_inline("LoGD Character Expiration"); + $body = sprintf_translate("One or more of your characters in Legend of the Green Dragon at %s is about to expire. If you wish to keep this character, you should log on to him or her soon!",getsetting("serverurl","http://".$_SERVER['SERVER_NAME'].($_SERVER['SERVER_PORT'] == 80?"":":".$_SERVER['SERVER_PORT']).dirname($_SERVER['REQUEST_URI']))); + while ($row = db_fetch_assoc($result)) { + mail($row['emailaddress'],$subject, + $body, + "From: ".getsetting("gameadminemail","postmaster@localhost.com") + ); + $sql = "UPDATE " . db_prefix("accounts") . " SET sentnotice=1 WHERE acctid='{$row['acctid']}'"; + db_query($sql); + } +} +?> diff --git a/lotgd-web/lotgd/lib/extended-battle.php b/lotgd-web/lotgd/lib/extended-battle.php new file mode 100755 index 0000000..c574541 --- /dev/null +++ b/lotgd-web/lotgd/lib/extended-battle.php @@ -0,0 +1,561 @@ + $badguy) { + if ((isset($badguy['istarget']) && $badguy['istarget'] == true) && $enemycounter > 1) + $ccode = "`#"; + else + $ccode = "`2"; + if (isset($badguy['hidehitpoints']) && $badguy['hidehitpoints'] == true) { + $health = "???"; + } else { + $health = $badguy['creaturehealth']; + } + if ($session['user']['alive']){ + output("%s%s%s%s's Hitpoints%s (Level %s): `6%s`0`n",$ccode,(isset($badguy['istarget'])&&$badguy['istarget']&&$enemycounter>1)?"*":"", $badguy['creaturename'],$ccode,$ccode, $badguy['creaturelevel'],$badguy['creaturehealth']>0?$health:translate_inline("`7DEAD`0")); + }else{ + output("`2%s`2's Soulpoints: `6%s`0`n",$badguy['creaturename'],$badguy['creaturehealth']>0?$health:translate_inline("`7DEFEATED`0")); + } + } + if ($session['user']['alive']){ + output("`2YOUR Hitpoints: `6%s`0`n",$session['user']['hitpoints']); + }else{ + output("`2YOUR Soulpoints: `6%s`0`n",$session['user']['hitpoints']); + } +} + +/** + * This function prepares the fight, sets up options and gives hook a hook to change options on a per-player basis. + * + * @param array $options The options given by a module or basics. + * @return array The complete options. + */ +function prepare_fight($options=false) { + global $companions; + $basicoptions = array( + "maxattacks"=>getsetting("maxattacks", 4), + ); + if (!is_array($options)) { + $options = array(); + } + $fightoptions = $options + $basicoptions; + $fightoptions = modulehook("fightoptions", $fightoptions); + + // We'll also reset the companions here... + prepare_companions(); + return $fightoptions; +} + +/** + * This functions prepares companions to be able to take part in a fight. Uses global copies. + * + */ +function prepare_companions() { + global $companions; + $newcompanions = array(); + if (is_array($companions)) { + foreach ($companions as $name => $companion) { + if (!isset($companion['suspended']) || $companion['suspended'] == false) { + $companion['used'] = false; + } + $newcompanions[$name] = $companion; + } + } + $companions = $newcompanions; +} + +/** + * Suspends companions on a given parameter. + * + * @param string $susp The type of suspension + * @param mixed $nomsg The message to be displayed upon suspending. If false, no message will be displayed. + */ +function suspend_companions($susp, $nomsg=false) { + global $companions; + $newcompanions = array(); + $suspended = false; + if (is_array($companions)) { + foreach ($companions as $name => $companion) { + if ($susp) { + if (isset($companion[$susp]) && $companion[$susp] == true) { + } else { + if (isset($companion['suspended']) && $companion['suspended'] == true){ + } else { + $suspended = true; + $companion['suspended'] = true; + } + } + } + $newcompanions[$name] = $companion; + } + } + + if ($suspended) { + $schema = false; + if ($nomsg === false) { + $schema = "battle"; + $nomsg = "`&Your companions stand back during this fight!`n"; + } + if ($nomsg !== true){ + if ($schema) tlschema($schema); + output($nomsg); + if ($schema) tlschema(); + } + } + $companions = $newcompanions; +} + +/** + * Enables suspended companions. + * + * @param string $susp The type of suspension + * @param mixed $nomsg The message to be displayed upon unsuspending. If false, no message will be displayed. + */ +function unsuspend_companions($susp, $nomsg=false) { + global $companions; + $notify = false; + $newcompanions = array(); + if (is_array($companions)) { + foreach ($companions as $name => $companion) { + if (isset($companion['suspended']) && $companion['suspended'] == true) { + $notify = true; + $companion['suspended'] = false; + } + $newcompanions[$name] = $companion; + } + } + + if ($notify) { + $schema = false; + if ($nomsg === false) { + $schema = "battle"; + $nomsg = "`&Your companions return to stand by your side!`n"; + } + if ($nomsg !== true){ + if ($schema) tlschema($schema); + output($nomsg); + if ($schema) tlschema(); + } + } + $companions = $newcompanions; +} + +/** + * Automatically chooses the first still living enemy as target for attacks. + * + * @param array $localenemies The stack of enemies to find a valid one from. + * @return array $localenemies The stack with changed targetting. + */ +function autosettarget($localenemies) { + $targetted = 0; + if (is_array($localenemies)) { + foreach ($localenemies as $index=>$badguy) { + $localenemies[$index] += array("dead"=>false, "istarget"=>false); // This line will add these two indices if they haven't been set. + if (count($localenemies) == 1) + $localenemies[$index]['istarget'] = true; + if ($localenemies[$index]['istarget'] == true && $localenemies[$index]['dead'] == false) + $targetted++; + } + } + if (!$targetted && is_array($localenemies)) { + foreach ($localenemies as $index=>$badguy) { + if ($localenemies[$index]['dead'] == false && (!isset($badguy['cannotbetarget']) || $badguy['cannotbetarget'] === false)) { + $localenemies[$index]['istarget'] = true; + $targetted = true; + break; + } else { + continue; + } + } + } + return $localenemies; +} + +/** + * Based upon the type of the companion different actions are performed and the companion is marked as "used" after that. + * + * @param array $companion The companion itself + * @param string $activate The stage of activation. Can be one of these: "fight", "defend", "heal" or "magic". + * @return array The changed companion + */ +function report_companion_move($companion, $activate="fight") { + global $badguy,$session,$creatureattack,$creatureatkmod,$adjustment; + global $creaturedefmod,$defmod,$atkmod,$atk,$def,$count,$defended,$needtosstopfighting; + + if (isset($companion['suspended']) && $companion['suspended'] == true) { + return $companion; + } + if ($activate == "fight" && isset($companion['abilities']['fight']) && $companion['abilities']['fight'] == true && $companion['used'] == false) { + $roll = rollcompaniondamage($companion); + $damage_done = $roll['creaturedmg']; + $damage_received = $roll['selfdmg']; + if ($damage_done==0){ + output("`^%s`4 tries to hit %s but `\$MISSES!`n",$companion['name'],$badguy['creaturename']); + }else if ($damage_done<0){ + output("`^%s`4 tries to hit %s but %s `\$RIPOSTES`4 for `^%s`4 points of damage!`n",$companion['name'],$badguy['creaturename'], $badguy['creaturename'], abs($damage_done)); + $companion['hitpoints']+=$damage_done; + }else{ + output("`^%s`4 hits %s for `^%s`4 points of damage!`n",$companion['name'],$badguy['creaturename'],$damage_done); + $badguy['creaturehealth']-=$damage_done; + } + + if ($badguy['creaturehealth'] >= 0) { + if ($damage_received==0){ + output("`^%s`4 tries to hit `\$%s`4 but `^MISSES!`n",$badguy['creaturename'], $companion['name']); + }else if ($damage_received<0){ + output("`^%s`4 tries to hit `\$%s`4 but %s `^RIPOSTES`4 for `^%s`4 points of damage!`n",$badguy['creaturename'], $companion['name'], $companion['name'], abs($damage_received)); + $badguy['creaturehealth']+=$damage_received; + }else{ + output("`^%s`4 hits `\$%s`4 for `\$%s`4 points of damage!`n",$badguy['creaturename'],$companion['name'],$damage_received); + $companion['hitpoints']-=$damage_received; + } + } + $companion['used'] = true; + } else if ($activate == "heal" && isset($companion['abilities']['heal']) && $companion['abilities']['heal'] == true && $companion['used'] == false) { + // This one will be tricky! We are looking for the first target which can be healed. This can be the player himself + // or any other companion or our fellow companion himself. + // But if our little friend is the second companion, all other companions will have been copied to the newenemies + // array already ... + if ($session['user']['hitpoints'] < $session['user']['maxhitpoints']) { + $hptoheal = min($companion['abilities']['heal'], $session['user']['maxhitpoints'] - $session['user']['hitpoints']); + $session['user']['hitpoints'] += $hptoheal; + $companion['used'] = true; + $msg = $companion['healmsg']; + if ($msg == "") $msg = "{companion} heals your wounds. You regenerate {damage} hitpoints."; + $msg = substitute_array("`)".$msg."`0`n", array("{companion}","{damage}"),array($companion['name'],$hptoheal)); + tlschema(isset($companion['schema'])?$companion['schema']:"battle"); + output($msg); + tlschema(); + } else { + // Okay. We really have to do this :( + global $newcompanions; + $mynewcompanions = $newcompanions; + if (!is_array($mynewcompanions)) $mynewcompanions = array(); + $healed = false; + foreach ($mynewcompanions as $myname => $mycompanion) { + if ($mycompanion['hitpoints'] >= $mycompanion['maxhitpoints'] || $healed || (isset($companion['cannotbehealed']) && $companion['cannotbehealed'] == true)) { + continue; + } else { + $hptoheal = min($companion['abilities']['heal'], $mycompanion['maxhitpoints'] - $mycompanion['hitpoints']); + $mycompanion['hitpoints'] += $hptoheal; + $companion['used'] = true; + $msg = $companion['healcompanionmsg']; + if ($msg == "") $msg = "{companion} heals {target}'s wounds. {target} regenerates {damage} hitpoints."; + $msg = substitute_array("`)".$msg."`0`n", array("{companion}","{damage}","{target}"),array($companion['name'],$hptoheal,$mycompanion['name'])); + tlschema(isset($companion['schema'])?$companion['schema']:"battle"); + output($msg); + tlschema(); + $healed = true; + $newcompanions[$myname] = $mycompanion; + } + } + if (!$healed) { + global $companions,$name; + $mycompanions = $companions; + $foundmyself = false; + foreach ($mycompanions as $myname => $mycompanion) { + if (!$foundmyself || (isset($companion['cannotbehealed']) && $companion['cannotbehealed'] == true)) { + if ($myname == $name) { + $foundmyself = true; + } + continue; + } else { + //There's someone hiding behind us... + foreach ($mycompanions as $myname => $mycompanion) { + if ($mycompanion['hitpoints'] >= $mycompanion['maxhitpoints'] || $healed) { + continue; + } else { + $hptoheal = min($companion['abilities']['heal'], $mycompanion['maxhitpoints'] - $mycompanion['hitpoints']); + $mycompanion['hitpoints'] += $hptoheal; + $companion['used'] = true; + $msg = $companion['healcompanionmsg']; + if ($msg == "") $msg = "{companion} heals {target}'s wounds. {target} regenerates {damage} hitpoints."; + $msg = substitute_array("`)".$msg."`0`n", array("{companion}","{damage}","{target}"),array($companion['name'],$hptoheal,$mycompanion['name'])); + tlschema(isset($companion['schema'])?$companion['schema']:"battle"); + output($msg); + tlschema(); + $healed = true; + $companions[$myname] = $mycompanion; + } // else // These + } // foreach // are + } // else // some + } // foreach // totally + } // if // senseless + } // else // comments. + unset($mynewcompanions); + unset($mycompanions); + $roll = rollcompaniondamage($companion); + $damage_done = $roll['creaturedmg']; + $damage_received = $roll['selfdmg']; + if ($badguy['creaturehealth'] >= 0) { + if ($damage_received==0){ + output("`^%s`4 tries to hit `\$%s`4 but `^MISSES!`n",$badguy['creaturename'], $companion['name']); + }else if ($damage_received<0){ + output("`^%s`4 tries to hit `\$%s`4 but %s `^RIPOSTES`4 for `^%s`4 points of damage!`n",$badguy['creaturename'], $companion['name'], $companion['name'], abs($damage_received)); + $badguy['creaturehealth']+=$damage_received; + }else{ + output("`^%s`4 hits `\$%s`4 for `\$%s`4 points of damage!`n",$badguy['creaturename'],$companion['name'],$damage_received); + $companion['hitpoints']-=$damage_received; + } + } + $companion['used'] = true; + } else if ($activate == "defend" && isset($companion['abilities']['defend']) && $companion['abilities']['defend'] == true && $defended == false && $companion['used'] == false) { + $defended = 1; + $roll = rollcompaniondamage($companion); + $damage_done = $roll['creaturedmg']; + $damage_received = $roll['selfdmg']; + if ($damage_done==0){ + output("`^%s`4 tries to hit %s but `^MISSES!`n",$companion['name'],$badguy['creaturename']); + }else if ($damage_done<0){ + output("`^%s`4 tries to hit %s but %s `^RIPOSTES`4 for `^%s`4 points of damage!`n",$companion['name'],$badguy['creaturename'], $badguy['creaturename'], abs($damage_done)); + $companion['hitpoints']+=$damage_done; + }else{ + output("`^%s`4 hits %s for `\$%s`4 points of damage!`n",$companion['name'],$badguy['creaturename'],$damage_done); + $badguy['creaturehealth']-=$damage_done; + } + + if ($badguy['creaturehealth'] >= 0) { + if ($damage_received==0){ + output("`^%s`4 tries to hit `\$%s`4 but `^MISSES!`n",$badguy['creaturename'], $companion['name']); + }else if ($damage_received<0){ + output("`^%s`4 tries to hit `\$%s`4 but %s `^RIPOSTES`4 for `^%s`4 points of damage!`n",$badguy['creaturename'], $companion['name'], $companion['name'], abs($damage_received)); + $badguy['creaturehealth']+=$damage_received; + }else{ + output("`^%s`4 hits `\$%s`4 for `\$%s`4 points of damage!`n",$badguy['creaturename'],$companion['name'],$damage_received); + $companion['hitpoints']-=$damage_received; + } + } + $companion['used'] = true; + } else if ($activate == "magic" && isset($companion['abilities']['magic']) && $companion['abilities']['magic'] == true && $companion['used'] == false) { + $roll = rollcompaniondamage($companion); + $damage_done = abs($roll['creaturedmg']); + if ($damage_done==0){ + $msg = $companion['magicfailmsg']; + if ($msg == "") $msg = "{companion} shoots a magical arrow at {badguy} but misses."; + $msg = substitute_array("`)".$msg."`0`n", array("{companion}"), array($companion['name'])); + tlschema(isset($companion['schema'])?$companion['schema']:"battle"); + output($msg); + tlschema(); + }else{ + if (isset($companion['magicmsg'])) { + $msg = $companion['magicmsg']; + } else { + $msg = "{companion} shoots a magical arrow at {badguy} and deals {damage} damage."; + } + $msg = substitute_array("`)".$msg."`0`n", array("{companion}","{damage}"), array($companion['name'],$damage_done)); + tlschema(isset($companion['schema'])?$companion['schema']:"battle"); + output($msg); + tlschema(); + $badguy['creaturehealth']-=$damage_done; + } + $companion['hitpoints'] -= $companion['abilities']['magic']; + $companion['used'] = true; + } + if ($badguy['creaturehealth'] <= 0) { + $badguy['dead'] = true; + $badguy['istarget'] = false; + $count = 1; + $needtosstopfighting = true; + } + if ($companion['hitpoints'] <= 0) { + if (isset($companion['dyingtext']) && $companion['dyingtext']>"") { + $msg = $companion['dyingtext']; + } else { + $msg = "`5Your companion catches his last breath before it dies."; + } + tlschema(isset($companion['schema'])?$companion['schema']:"battle"); + output("`5".$msg."`0`n"); + tlschema(); + if (isset($companion['cannotdie']) && $companion['cannotdie'] == true) { + $companion['hitpoints'] = 0; + }else{ + return false; + } + } + + return $companion; +} + +/** + * Based upon the companion's stats damage values are calculated. + * + * @param array $companion + * @return array + */ + +function rollcompaniondamage($companion){ + global $badguy,$creatureattack,$creatureatkmod,$adjustment,$options; + global $creaturedefmod,$compdefmod,$compatkmod,$buffset,$atk,$def; + + if ($badguy['creaturehealth']>0 && $companion['hitpoints']>0){ + if ($options['type']=='pvp') { + $adjustedcreaturedefense = $badguy['creaturedefense']; + } else { + $adjustedcreaturedefense = + ($creaturedefmod*$badguy['creaturedefense'] / + ($adjustment*$adjustment)); + } + + $creatureattack = $badguy['creatureattack']*$creatureatkmod; + $adjustedselfdefense = ($companion['defense'] * $adjustment * $compdefmod); + + /* + debug("Base creature defense: " . $badguy['creaturedefense']); + debug("Creature defense mod: $creaturedefmod"); + debug("Adjustment: $adjustment"); + debug("Adjusted creature defense: $adjustedcreaturedefense"); + debug("Adjusted creature attack: $creatureattack"); + debug("Adjusted self defense: $adjustedselfdefense"); + */ + + while(!isset($creaturedmg) || !isset($selfdmg) || $creaturedmg==0 && $selfdmg==0){ + $atk = $companion['attack']*$compatkmod; + if (e_rand(1,20)==1 && $options['type'] != "pvp") $atk*=3; + /* + debug("Attack score: $atk"); + */ + + $patkroll = bell_rand(0,$atk); + /* + debug("Player Attack roll: $patkroll"); + */ + + // Set up for crit detection + $atk = $patkroll; + $catkroll = bell_rand(0,$adjustedcreaturedefense); + /* + debug("Creature defense roll: $catkroll"); + */ + + $creaturedmg = 0-(int)($catkroll - $patkroll); + if ($creaturedmg<0) { + $creaturedmg = (int)($creaturedmg/2); + $creaturedmg = round($buffset['badguydmgmod'] * $creaturedmg, 0); + } + if ($creaturedmg > 0) { + $creaturedmg = round($buffset['compdmgmod']*$creaturedmg,0); + } + $pdefroll = bell_rand(0,$adjustedselfdefense); + $catkroll = bell_rand(0,$creatureattack); + /* + debug("Creature attack roll: $catkroll"); + debug("Player defense roll: $pdefroll"); + */ + $selfdmg = 0-(int)($pdefroll - $catkroll); + if ($selfdmg<0) { + $selfdmg=(int)($selfdmg/2); + $selfdmg = round($selfdmg*$buffset['compdmgmod'], 0); + } + if ($selfdmg > 0) { + $selfdmg = round($selfdmg*$buffset['badguydmgmod'], 0); + } + } + }else{ + $creaturedmg=0; + $selfdmg=0; + } + // Handle god mode's invulnerability + if ($buffset['invulnerable']) { + $creaturedmg = abs($creaturedmg); + $selfdmg = -abs($selfdmg); + } + return array("creaturedmg"=>(isset($creaturedmg)?$creaturedmg:0),"selfdmg"=>(isset($selfdmg)?$selfdmg:0)); +} + +/** + * Adds a new creature to the badguy array. + * + * @param mixed $creature A standard badguy array. If numeric, the corresponding badguy will be loaded from the database. + */ +function battle_spawn($creature) { + global $enemies, $newenemies, $badguy,$nextindex; + if (!isset($nextindex)) { + $nextindex = count($enemies); + } else { + $nextindex++; + } + if(is_numeric($creature)) { + $sql = "SELECT * FROM " . db_prefix("creatures") . " WHERE creatureid = $creature LIMIT 1"; + $result = db_query($sql); + if ($row = db_fetch_assoc($result)) { + $newenemies[$nextindex] = $row; + output("`^%s`2 summons `^%s`2 for help!`n", $badguy['creaturename'], $row['creaturename']); + } + } else if(is_array($creature)){ + $newenemies[$nextindex] = $creature; + } + ksort($newenemies); +} + +/** + * Allows creatures to heal themselves or another badguy. + * + * @param int $amount Amount of helath to be restored + * @param mixed $target If false badguy will heal itself otherwise the enemy with this index. + */ +function battle_heal($amount, $target=false) { + global $newenemies, $enemies, $badguy; + if ($amount > 0) { + if ($target === false) { + $badguy['creaturehealth']+=$amount; + output("`^%s`2 heals itself for `^%s`2 hitpoints.", $badguy['creaturename'], $amount); + } else { + if (isset($newenemies[$target])) { + // Target had its turn already... + if ($newenemies[$target]['dead'] == false) { + $newenemies[$target]['creaturehealth'] += $amount; + output("`^%s`2 heal `^%s`2 for `^%s`2 hitpoints.", $badguy['creaturename'], $newenemies[$target]['creaturename'], $amount); + } + }else{ + if ($enemies[$target]['dead'] == false) { + $enemies[$target]['creaturehealth'] += $amount; + output("`^%s`2 heal `^%s`2 for `^%s`2 hitpoints.", $badguy['creaturename'], $enemies[$target]['creaturename'], $amount); + } + } + } + } +} + +/** + * Executes the given script or loads the script and then executes it. + * + * @param mixed $script If numeric the corresponding script will be loaded from the database, otherwise the script to be executed. + */ +function execute_ai_script($script) { + global $unsetme; + if (is_numeric($script)) { + $script = load_ai_script($script); + } + if ($script > "") { + eval($script); + } +} + +/** + * Returns an A.I. Script form the database + * + * @param int $spriptid The id for the script + * @return string The script itself. An empty string is returned, if script is found. + */ +function load_ai_script($scriptid) { + if ($scriptid == 0) { + return ""; + } else { + $sql = "SELECT script FROM ".db_prefix("ai")." WHERE scriptid = $scriptid"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + return $row['script']; + } +} + +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/fightnav.php b/lotgd-web/lotgd/lib/fightnav.php new file mode 100755 index 0000000..3252ba2 --- /dev/null +++ b/lotgd-web/lotgd/lib/fightnav.php @@ -0,0 +1,64 @@ +$script)); + + if ($session['user']['superuser'] & SU_DEVELOPER) { + addnav("`&Super user`0",""); + addnav("!?`&• __GOD MODE",$script."op=fight&skill=godmode",true); + } + modulehook("fightnav", array("script"=>$script)); + } + + if (count($newenemies) > 1) { + addnav("Targets"); + foreach ($newenemies as $index=>$badguy){ + if ($badguy['creaturehealth'] <= 0 || (isset($badguy['dead']) && $badguy['dead'] == true)) continue; + addnav(array("%s%s`0",(isset($badguy['istarget'])&&$badguy['istarget'])?"`#*`0":"", $badguy['creaturename']), $script."op=fight&newtarget=$index"); + } + } + tlschema(); +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/forcednavigation.php b/lotgd-web/lotgd/lib/forcednavigation.php new file mode 100755 index 0000000..f0ae61c --- /dev/null +++ b/lotgd-web/lotgd/lib/forcednavigation.php @@ -0,0 +1,50 @@ +"); + if (isset($session['loggedin']) && $session['loggedin']){ + $sql = "SELECT * FROM ".db_prefix("accounts")." WHERE acctid = '".$session['user']['acctid']."'"; + $result = db_query($sql); + if (db_num_rows($result)==1){ + $session['user']=db_fetch_assoc($result); + $baseaccount = $session['user']; + $session['bufflist']=unserialize($session['user']['bufflist']); + if (!is_array($session['bufflist'])) $session['bufflist']=array(); + $session['user']['dragonpoints']=unserialize($session['user']['dragonpoints']); + $session['user']['prefs']=unserialize($session['user']['prefs']); + if (!is_array($session['user']['dragonpoints'])) $session['user']['dragonpoints']=array(); + if (is_array(unserialize($session['user']['allowednavs']))){ + $session['allowednavs']=unserialize($session['user']['allowednavs']); + }else{ + $session['allowednavs']=array($session['user']['allowednavs']); + } + if (!$session['user']['loggedin'] || ( (date("U") - strtotime($session['user']['laston'])) > getsetting("LOGINTIMEOUT",900)) ){ + $session=array(); + redirect("index.php?op=timeout","Account not logged in but session thinks they are."); + } + }else{ + $session=array(); + $session['message']=translate_inline("`4Error, your login was incorrect`0","login"); + redirect("index.php","Account Disappeared!"); + } + db_free_result($result); + if (isset($session['allowednavs'][$REQUEST_URI]) && $session['allowednavs'][$REQUEST_URI] && $overrideforced!==true){ + $session['allowednavs']=array(); + }else{ + if ($overrideforced!==true){ + redirect("badnav.php","Navigation not allowed to $REQUEST_URI"); + } + } + }else{ + if (!$anonymous){ + $session['message']=translate_inline("You are not logged in, this may be because your session timed out.","login"); + redirect("index.php?op=timeout","Not logged in: $REQUEST_URI"); + } + } +} +?> diff --git a/lotgd-web/lotgd/lib/forest.php b/lotgd-web/lotgd/lib/forest.php new file mode 100755 index 0000000..73ab06c --- /dev/null +++ b/lotgd-web/lotgd/lib/forest.php @@ -0,0 +1,56 @@ +1) + addnav("S?Go Slumming","forest.php?op=search&type=slum"); + addnav("T?Go Thrillseeking","forest.php?op=search&type=thrill"); + if (getsetting("suicide", 0)) { + if (getsetting("suicidedk", 10) <= $session['user']['dragonkills']) { + addnav("*?Search `\$Suicidally`0", "forest.php?op=search&type=suicide"); + } + } + if ($session['user']['level']>=15 && $session['user']['seendragon']==0){ + // Only put the green dragon link if we are a location which + // should have a forest. Don't even ask how we got into a forest() + // call if we shouldn't have one. There is at least one way via + // a superuser link, but it shouldn't happen otherwise.. We just + // want to make sure however. + $isforest = 0; + $vloc = modulehook('validforestloc', array()); + foreach($vloc as $i=>$l) { + if ($session['user']['location'] == $i) { + $isforest = 1; + break; + } + } + if ($isforest || count($vloc)==0) { + addnav("G?`@Seek Out the Green Dragon","forest.php?op=dragon"); + } + } + addnav("Other"); + villagenav(); + if ($noshowmessage!=true){ + output("`c`7`bThe Forest`b`0`c"); + output("The Forest, home to evil creatures and evildoers of all sorts.`n`n"); + output("The thick foliage of the forest restricts your view to only a few yards in most places."); + output("The paths would be imperceptible except for your trained eye."); + output("You move as silently as a soft breeze across the thick moss covering the ground, wary to avoid stepping on a twig or any of the numerous pieces of bleached bone that populate the forest floor, lest you betray your presence to one of the vile beasts that wander the forest.`n"); + modulehook("forest-desc"); + } + modulehook("forest", array()); + module_display_events("forest", "forest.php"); + tlschema(); +} + +?> diff --git a/lotgd-web/lotgd/lib/forestoutcomes.php b/lotgd-web/lotgd/lib/forestoutcomes.php new file mode 100755 index 0000000..48f6428 --- /dev/null +++ b/lotgd-web/lotgd/lib/forestoutcomes.php @@ -0,0 +1,207 @@ +$badguy) { + if (getsetting("dropmingold",0)){ + $badguy['creaturegold']= e_rand(round($badguy['creaturegold']/4), round(3*$badguy['creaturegold']/4)); + }else{ + $badguy['creaturegold']=e_rand(0,$badguy['creaturegold']); + } + $gold += $badguy['creaturegold']; + tlschema("battle"); + if(isset($badguy['creaturelose'])) $msg = translate_inline($badguy['creaturelose']); + tlschema(); + if(isset($msg)) output_notl("`b`&%s`0`b`n",$msg); + output("`b`\$You have slain %s!`0`b`n",$badguy['creaturename']); + $count++; + // If any creature did damage, we have no flawless fight. Easy as that. + if ($badguy['diddamage'] == 1) { + $diddamage = true; + } + $creaturelevel = max($creaturelevel, $badguy['creaturelevel']); + if (!$denyflawless && isset($badguy['denyflawless']) && $badguy['denyflawless']>"") { + $denyflawless = $badguy['denyflawless']; + } + $expbonus += round(($badguy['creatureexp'] * (1 + .25 * ($badguy['creaturelevel']-$session['user']['level']))) - $badguy['creatureexp'],0); + } + $multibonus = $count>1?1:0; + $expbonus += $session['user']['dragonkills'] * $session['user']['level'] * $multibonus; + $totalexp = 0; + foreach ($options['experience'] as $index=>$experience) { + $totalexp += $experience; + } + // We now have the total experience which should have been gained during the fight. + // Now we will calculate the average exp per enemy. + $exp = round($totalexp / $count); + $gold = e_rand(round($gold/$count),round($gold/$count)*round(($count+1)*pow(1.2, $count-1),0)); + $expbonus = round ($expbonus/$count,0); + + if ($gold) { + output("`#You receive `^%s`# gold!`n",$gold); + debuglog("received gold for slaying a monster.",false,false,"forestwin",$badguy['creaturegold']); + } + // No gem hunters allowed! + $args = modulehook("alter-gemchance", array("chance"=>getsetting("forestgemchance", 25))); + $gemchances = $args['chance']; + if ($session['user']['level'] < 15 && e_rand(1,$gemchances) == 1) { + output("`&You find A GEM!`n`#"); + $session['user']['gems']++; + debuglog("found gem when slaying a monster.",false,false,"forestwingem",1); + } + if (getsetting("instantexp",false) == true) { + $expgained = 0; + foreach ($options['experiencegained'] as $index=>$experience) { + $expgained += $experience; + } + + $diff = $expgained - $exp; + $expbonus += $diff; + if (floor($exp + $expbonus) < 0) { + $expbonus = -$exp+1; + } + if ($expbonus>0){ + $expbonus = round($expbonus * pow(1+(getsetting("addexp", 5)/100), $count-1),0); + output("`#***Because of the difficult nature of this fight, you are awarded an additional `^%s`# experience! `n",$expbonus); + } elseif ($expbonus<0){ + output("`#***Because of the simplistic nature of this fight, you are penalized `^%s`# experience! `n",abs($expbonus)); + } + if (count($enemies) > 1) { + output("During this fight you received `^%s`# total experience!`n`0",$exp+$expbonus); + } + $session['user']['experience']+=$expbonus; + } else { + if (floor($exp + $expbonus) < 0) { + $expbonus = -$exp+1; + } + if ($expbonus>0){ + $expbonus = round($expbonus * pow(1+(getsetting("addexp", 5)/100), $count-1),0); + output("`#***Because of the difficult nature of this fight, you are awarded an additional `^%s`# experience! `n(%s + %s = %s) ",$expbonus,$exp,abs($expbonus),$exp+$expbonus); + } elseif ($expbonus<0){ + output("`#***Because of the simplistic nature of this fight, you are penalized `^%s`# experience! `n(%s - %s = %s) ",abs($expbonus),$exp,abs($expbonus),$exp+$expbonus); + } + output("You receive `^%s`# total experience!`n`0",$exp+$expbonus); + $session['user']['experience']+=($exp+$expbonus); + } + $session['user']['gold']+=$gold; + // Increase the level for each enemy by one half, so flawless fights can be achieved for + // fighting multiple low-level critters + if (!$creaturelevel) + $creaturelevel = $badguy['creaturelevel']; + else + $creaturelevel+=(0.5*($count-1)); + + if (!$diddamage) { + output("`c`b`&~~ Flawless Fight! ~~`0`b`c"); + if ($denyflawless){ + output("`c`\$%s`0`c", translate_inline($denyflawless)); + }elseif ($session['user']['level']<=$creaturelevel){ + output("`c`b`\$You receive an extra turn!`0`b`c`n"); + $session['user']['turns']++; + }else{ + output("`c`\$A more difficult fight would have yielded an extra turn.`0`c`n"); + } + } + if ($session['user']['hitpoints'] <= 0) { + output("With your dying breath you spy a small stand of mushrooms off to the side."); + output("You recognize them as some of the ones that the healer had drying in the hut and taking a chance, cram a handful into your mouth."); + output("Even raw they have some restorative properties.`n"); + $session['user']['hitpoints'] = 1; + } +} + +function forestdefeat($enemies,$where="in the forest"){ + global $session; + $percent=getsetting('forestexploss',10); + addnav("Daily news","news.php"); + $names = array(); + $killer = false; + foreach ($enemies as $index=>$badguy) { + $names[] = $badguy['creaturename']; + if (isset($badguy['killedplayer']) && $badguy['killedplayer'] == true) $killer = $badguy; + if (isset($badguy['creaturewin']) && $badguy['creaturewin'] > "") { + $msg = translate_inline($badguy['creaturewin'],"battle"); + output_notl("`b`&%s`0`b`n",$msg); + } + } + if($killer) $badguy = $killer; + elseif(!isset($badguy['creaturename'])) $badguy = $enemies[0]; + if (count($names) > 1) $lastname = array_pop($names); + $enemystring = join(", ", $names); + $and = translate_inline("and"); + if (isset($lastname) && $lastname > "") $enemystring = "$enemystring $and $lastname"; + $taunt = select_taunt_array(); + if (is_array($where)) { + $where=sprintf_translate($where); + } else { + $where=translate_inline($where); + } + addnews("`%%s`5 has been slain %s by %s.`n%s",$session['user']['name'],$where,$badguy['creaturename'],$taunt); + $session['user']['alive']=false; + debuglog("lost gold when they were slain $where",false,false,"forestlose",-$session['user']['gold']); + $session['user']['gold']=0; + $session['user']['hitpoints']=0; + $session['user']['experience']=round($session['user']['experience']*(1-($percent/100)),0); + output("`4All gold on hand has been lost!`n"); + output("`4%s %% of experience has been lost!`b`n",$percent); + output("You may begin fighting again tomorrow."); + page_footer(); +} + +function buffbadguy($badguy){ + global $session; + static $dk = false; // This will save us a lot of trouble when going through + // this function more than once... + if ($dk === false) { + //make badguys get harder as you advance in dragon kills. + $dk = 0; + while(list($key, $val)=each($session['user']['dragonpoints'])) { + if ($val=="at" || $val=="de") $dk++; + } + $dk += (int)(($session['user']['maxhitpoints']-($session['user']['level']*10))/5); + // How many of the dk points should actually be used. + // We want to add .05 for every 100 dragonkills. + $add = ($session['user']['dragonkills']/100)*.05; + $dk = round($dk * (.25 + $add)); + } + + $expflux = round($badguy['creatureexp']/10,0); + $expflux = e_rand(-$expflux,$expflux); + $badguy['creatureexp']+=$expflux; + + $atkflux = e_rand(0, $dk); + $defflux = e_rand(0, ($dk-$atkflux)); + + $hpflux = ($dk - ($atkflux+$defflux)) * 5; + $badguy['creatureattack']+=$atkflux; + $badguy['creaturedefense']+=$defflux; + $badguy['creaturehealth']+=$hpflux; + + if (getsetting("disablebonuses", 1)) { + $bonus = 1 + .03*($atkflux+$defflux) + .001*$hpflux; + $badguy['creaturegold'] = round($badguy['creaturegold']*$bonus, 0); + $badguy['creatureexp'] = round($badguy['creatureexp']*$bonus, 0); + } + + $badguy = modulehook("creatureencounter",$badguy); + debug("DEBUG: $dk modification points total."); + debug("DEBUG: +$atkflux allocated to attack."); + debug("DEBUG: +$defflux allocated to defense."); + debug("DEBUG: +".($hpflux/5)."*5 to hitpoints."); + return modulehook("buffbadguy",$badguy); +} +?> diff --git a/lotgd-web/lotgd/lib/forms.php b/lotgd-web/lotgd/lib/forms.php new file mode 100755 index 0000000..c8433a5 --- /dev/null +++ b/lotgd-web/lotgd/lib/forms.php @@ -0,0 +1,217 @@ + + function previewtext$name(t,l){ + var out = \"".addslashes(appoencode($startdiv))." \"; + var end = ''; + var x=0; + var y=''; + var z=''; + var max=document.getElementById('input$name'); + var charsleft='';"); + if ($talkline !== false) { + rawoutput(" if (t.substr(0,2)=='::'){ + x=2; + out += ''; + }else if (t.substr(0,1)==':'){ + x=1; + out += ''; + }else if (t.substr(0,3)=='/me'){ + x=3; + out += '';"); + if ($session['user']['superuser']&SU_IS_GAMEMASTER) { + rawoutput(" + }else if (t.substr(0,5)=='/game'){ + x=5; + out = '';"); + } + rawoutput(" }else{ + out += '".addslashes(appoencode($talkline)).", \"'; + end += '\"'; + }"); + } + if ($showcharsleft == true) { +/* if (translate_inline($talkline,$schema)!="says") + $tll = strlen(translate_inline($talkline,$schema))+11; + else $tll=0; // Don't know why needed + rawoutput(" if (x!=0) { + if (max.maxlength!=200-$tll) max.maxlength=200-$tll; + l=200-$tll; */ // Don't know why needed + rawoutput(" if (x!=0) { + if (max.maxLength!=200) max.maxLength=200; + l=200; + } else { + max.maxLength=l; + } + if (l-t.length<0) charsleft +=''; + charsleft += '".$youhave."'+(l-t.length)+'".$charsleft."
'; + if (l-t.length<0) charsleft +='
'; + document.getElementById('charsleft$name').innerHTML=charsleft+'
';"); + } + rawoutput(" for (; x < t.length; x++){ + y = t.substr(x,1); + if (y=='<'){ + out += '<'; + continue; + }else if(y=='>'){ + out += '>'; + continue; + }else if(y=='\\n'){ + out += '
'; + continue; + }else if (y=='`'){ + if (x < t.length-1){ + z = t.substr(x+1,1); + if (z=='0'){ + out += '
'; + }else if (z=='1'){ + out += '
'; + }else if (z=='2'){ + out += ''; + }else if (z=='3'){ + out += ''; + }else if (z=='4'){ + out += ''; + }else if (z=='5'){ + out += ''; + }else if (z=='6'){ + out += ''; + }else if (z=='7'){ + out += ''; + }else if (z=='q'){ + out += ''; + }else if (z=='!'){ + out += ''; + }else if (z=='@'){ + out += ''; + }else if (z=='#'){ + out += ''; + }else if (z=='$'){ + out += ''; + }else if (z=='%'){ + out += ''; + }else if (z=='^'){ + out += ''; + }else if (z=='&'){ + out += ''; + }else if (z=='Q'){ + out += ''; + }else if (z==')'){ + out += ''; + }else if (z=='r'){ + out += ''; + }else if (z=='R'){ + out += ''; + }else if (z=='v'){ + out += ''; + }else if (z=='V'){ + out += ''; + }else if (z=='g'){ + out += ''; + }else if (z=='G'){ + out += ''; + }else if (z=='T'){ + out += ''; + }else if (z=='t'){ + out += ''; + }else if (z=='~'){ + out += ''; + }else if (z=='j'){ + out += ''; + }else if (z=='J'){ + out += ''; + }else if (z=='e'){ + out += ''; + }else if (z=='E'){ + out += ''; + }else if (z=='l'){ + out += ''; + }else if (z=='L'){ + out += ''; + }else if (z=='x'){ + out += ''; + }else if (z=='X'){ + out += ''; + }else if (z=='y'){ + out += ''; + }else if (z=='Y'){ + out += ''; + }else if (z=='k'){ + out += ''; + }else if (z=='K'){ + out += ''; + }else if (z=='p'){ + out += ''; + }else if (z=='P'){ + out += ''; + }else if (z=='m'){ + out += ''; + }else if (z=='M'){ + out += ''; + } + x++; + } + }else{ + out += y; + } + } + document.getElementById(\"previewtext$name\").innerHTML=out+end+'
'; + } + + "); + if ($charsleft == true) { + rawoutput(""); + } + if (!is_array($info)) { + if ($default) { + rawoutput(""); + } else { + rawoutput(""); + } + } else { + if (isset($info['maxlength'])) { + $l = $info['maxlength']; + } else { + $l=200; + } + if (isset($info['type']) && $info['type'] == 'textarea') { + rawoutput(""); + } else { + if ($default) { + rawoutput(" value='$default'>"); + } else { + rawoutput(">"); + } + } + } + rawoutput("
"); + rawoutput(" + + "); +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/gamelog.php b/lotgd-web/lotgd/lib/gamelog.php new file mode 100755 index 0000000..bee5dfb --- /dev/null +++ b/lotgd-web/lotgd/lib/gamelog.php @@ -0,0 +1,13 @@ + diff --git a/lotgd-web/lotgd/lib/graveyard/case_battle_search.php b/lotgd-web/lotgd/lib/graveyard/case_battle_search.php new file mode 100755 index 0000000..246460f --- /dev/null +++ b/lotgd-web/lotgd/lib/graveyard/case_battle_search.php @@ -0,0 +1,42 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/graveyard/case_default.php b/lotgd-web/lotgd/lib/graveyard/case_default.php new file mode 100755 index 0000000..5f013db --- /dev/null +++ b/lotgd-web/lotgd/lib/graveyard/case_default.php @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/graveyard/case_enter.php b/lotgd-web/lotgd/lib/graveyard/case_enter.php new file mode 100755 index 0000000..96f7309 --- /dev/null +++ b/lotgd-web/lotgd/lib/graveyard/case_enter.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/graveyard/case_haunt.php b/lotgd-web/lotgd/lib/graveyard/case_haunt.php new file mode 100755 index 0000000..78c7242 --- /dev/null +++ b/lotgd-web/lotgd/lib/graveyard/case_haunt.php @@ -0,0 +1,15 @@ +"); +addnav("","graveyard.php?op=haunt2"); +output("Who would you like to haunt? "); +rawoutput(""); +rawoutput(""); +rawoutput(""); +rawoutput(""); +addnav("Places"); +addnav("S?Land of the Shades","shades.php"); +addnav("G?The Graveyard","graveyard.php"); +addnav("M?Return to the Mausoleum","graveyard.php?op=enter"); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/graveyard/case_haunt2.php b/lotgd-web/lotgd/lib/graveyard/case_haunt2.php new file mode 100755 index 0000000..e91031e --- /dev/null +++ b/lotgd-web/lotgd/lib/graveyard/case_haunt2.php @@ -0,0 +1,46 @@ +100){ + output("`\$%s`) thinks you should narrow down the number of people you wish to haunt.",$deathoverlord); + $search = translate_inline("Search"); + rawoutput("
"); + addnav("","graveyard.php?op=haunt2"); + output("Who would you like to haunt? "); + rawoutput(""); + rawoutput(""); + rawoutput("
"); + rawoutput("",true); +}else{ + output("`\$%s`) will allow you to try to haunt these people:`n",$deathoverlord); + $name = translate_inline("Name"); + $lev = translate_inline("Level"); + rawoutput(""); + rawoutput(""); + for ($i=0;$i",true); + addnav("","graveyard.php?op=haunt3&name=".HTMLEntities($row['login'], ENT_COMPAT, getsetting("charset", "ISO-8859-1"))); + } + rawoutput("
$name$lev
"); + output_notl("%s", $row['name']); + rawoutput(""); + output_notl("%s", $row['level']); + rawoutput("
",true); +} +addnav(array("Question `\$%s`0 about the worth of your soul",$deathoverlord),"graveyard.php?op=question"); +$max = $session['user']['level'] * 5 + 50; +$favortoheal = round(10 * ($max-$session['user']['soulpoints'])/$max); +addnav(array("Restore Your Soul (%s favor)",$favortoheal),"graveyard.php?op=restore"); +addnav("Places"); +addnav("S?Land of the Shades","shades.php"); +addnav("G?The Graveyard","graveyard.php"); +addnav("M?Return to the Mausoleum","graveyard.php?op=enter"); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/graveyard/case_haunt3.php b/lotgd-web/lotgd/lib/graveyard/case_haunt3.php new file mode 100755 index 0000000..4cb7873 --- /dev/null +++ b/lotgd-web/lotgd/lib/graveyard/case_haunt3.php @@ -0,0 +1,59 @@ +0){ + $row = db_fetch_assoc($result); + if ($row['hauntedby']!=""){ + output("That person has already been haunted, please select another target"); + }else{ + $session['user']['deathpower']-=25; + $roll1 = e_rand(0,$row['level']); + $roll2 = e_rand(0,$session['user']['level']); + if ($roll2>$roll1){ + output("You have successfully haunted `7%s`)!", $row['name']); + $sql = "UPDATE " . db_prefix("accounts") . " SET hauntedby='".addslashes($session['user']['name'])."' WHERE login='$name'"; + db_query($sql); + addnews("`7%s`) haunted `7%s`)!",$session['user']['name'],$row['name']); + $subj = array("`)You have been haunted"); + $body = array("`)You have been haunted by `&%s`).",$session['user']['name']); + require("lib/systemmail.php"); + systemmail($row['acctid'], $subj, $body); + }else{ + addnews("`7%s`) unsuccessfully haunted `7%s`)!",$session['user']['name'],$row['name']); + switch (e_rand(0,5)){ + case 0: + $msg = "Just as you were about to haunt `7%s`) good, they sneezed, and missed it completely."; + break; + case 1: + $msg = "You haunt `7%s`) real good like, but unfortunately they're sleeping and are completely unaware of your presence."; + break; + case 2: + $msg = "You're about to haunt `7%s`), but trip over your ghostly tail and land flat on your, um... face."; + break; + case 3: + $msg = "You go to haunt `7%s`) in their sleep, but they look up at you, and roll over mumbling something about eating sausage just before going to bed."; + break; + case 4: + $msg = "You wake `7%s`) up, who looks at you for a moment before declaring, \"Neat!\" and trying to catch you."; + break; + case 5: + $msg = "You go to scare `7%s`), but catch a glimpse of yourself in the mirror and panic at the sight of a ghost!"; + break; + } + output($msg, $row['name']); + } + } +}else{ + output("`\$%s`) has lost their concentration on this person, you cannot haunt them now.",$deathoverlord); +} +addnav(array("Question `\$%s`0 about the worth of your soul",$deathoverlord),"graveyard.php?op=question"); +$max = $session['user']['level'] * 5 + 50; +$favortoheal = round(10 * ($max-$session['user']['soulpoints'])/$max); +addnav(array("Restore Your Soul (%s favor)", $favortoheal),"graveyard.php?op=restore"); +addnav("Places"); +addnav("S?Land of the Shades","shades.php"); +addnav("G?The Graveyard","graveyard.php"); +addnav("M?Return to the Mausoleum","graveyard.php?op=enter"); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/graveyard/case_question.php b/lotgd-web/lotgd/lib/graveyard/case_question.php new file mode 100755 index 0000000..e5a1a8b --- /dev/null +++ b/lotgd-web/lotgd/lib/graveyard/case_question.php @@ -0,0 +1,24 @@ +=100) { + output("`\$%s`) speaks, \"`7You have impressed me indeed. I shall grant you the ability to visit your foes in the mortal world.`)\"",$deathoverlord); + addnav(array("%s Favors",sanitize($deathoverlord))); + addnav("H?Haunt a foe (25 favor)","graveyard.php?op=haunt"); + addnav("e?Resurrection (100 favor)","graveyard.php?op=resurrection"); + addnav("Other"); +}elseif ($session['user']['deathpower'] >= 25){ + output("`\$%s`) speaks, \"`7I am moderately impressed with your efforts. A minor favor I now grant to you, but continue my work, and I may yet have more power to bestow.`)\"",$deathoverlord); + addnav(array("%s Favors",sanitize($deathoverlord))); + addnav("H?Haunt a foe (25 favor)","graveyard.php?op=haunt"); + addnav("Other"); +}else{ + output("`\$%s`) speaks, \"`7I am not yet impressed with your efforts. Continue my work, and we may speak further.`)\"",$deathoverlord); +} +output("`n`nYou have `6%s`) favor with `\$%s`).", $session['user']['deathpower'],$deathoverlord); +addnav(array("Restore Your Soul (%s favor)",$favortoheal),"graveyard.php?op=restore"); +addnav("Places"); +addnav("S?Land of the Shades","shades.php"); +addnav("G?Return to the Graveyard","graveyard.php"); +modulehook("ramiusfavors"); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/graveyard/case_restore.php b/lotgd-web/lotgd/lib/graveyard/case_restore.php new file mode 100755 index 0000000..ed84739 --- /dev/null +++ b/lotgd-web/lotgd/lib/graveyard/case_restore.php @@ -0,0 +1,21 @@ +=$favortoheal){ + output("`\$%s`) calls you weak for needing restoration, but as you have enough favor with him, he grants your request at the cost of `4%s`) favor.",$deathoverlord, $favortoheal); + $session['user']['deathpower']-=$favortoheal; + $session['user']['soulpoints']=$max; + }else{ + output("`\$%s`) curses you and throws you from the Mausoleum, you must gain more favor with him before he will grant restoration.",$deathoverlord); + } +}else{ + output("`\$%s`) sighs and mumbles something about, \"`7just 'cause they're dead, does that mean they don't have to think?`)\"`n`n",$deathoverlord); + output("Perhaps you'd like to actually `ineed`i restoration before you ask for it."); +} +addnav(array("Question `\$%s`0 about the worth of your soul",$deathoverlord),"graveyard.php?op=question"); +addnav("Places"); +addnav("S?Land of the Shades","shades.php"); +addnav("G?Return to the Graveyard","graveyard.php"); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/graveyard/case_resurrection.php b/lotgd-web/lotgd/lib/graveyard/case_resurrection.php new file mode 100755 index 0000000..4d138c8 --- /dev/null +++ b/lotgd-web/lotgd/lib/graveyard/case_resurrection.php @@ -0,0 +1,19 @@ + diff --git a/lotgd-web/lotgd/lib/holiday_texts.php b/lotgd-web/lotgd/lib/holiday_texts.php new file mode 100755 index 0000000..4586dc0 --- /dev/null +++ b/lotgd-web/lotgd/lib/holiday_texts.php @@ -0,0 +1,22 @@ +$text,'type'=>$type); + $args = modulehook("holiday", $args); + $text = $args['text']; + + return $text; +} + +?> diff --git a/lotgd-web/lotgd/lib/http.php b/lotgd-web/lotgd/lib/http.php new file mode 100755 index 0000000..3adc6f5 --- /dev/null +++ b/lotgd-web/lotgd/lib/http.php @@ -0,0 +1,83 @@ + 0) ? "," : "") . "$key='$val'"; + $keys .= (($i > 0) ? "," : "") . "$key"; + $vals .= (($i > 0) ? "," : "") . "'$val'"; + $i++; + } + } + return array($sql, $keys, $vals); +} +?> diff --git a/lotgd-web/lotgd/lib/increment_specialty.php b/lotgd-web/lotgd/lib/increment_specialty.php new file mode 100755 index 0000000..61c7b26 --- /dev/null +++ b/lotgd-web/lotgd/lib/increment_specialty.php @@ -0,0 +1,24 @@ +$colorcode)); + }else{ + output("`7You have no direction in the world, you should rest and make some important decisions about your life.`0`n"); + } + tlschema(); + if ($spec !== false) { + $session['user']['specialty'] = $revertspec; + } +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/inn/inn_bartender.php b/lotgd-web/lotgd/lib/inn/inn_bartender.php new file mode 100755 index 0000000..df9d452 --- /dev/null +++ b/lotgd-web/lotgd/lib/inn/inn_bartender.php @@ -0,0 +1,127 @@ +",true); + $testtext = httppost('testtext'); + output("You entered %s`n", prevent_colors(HTMLEntities($testtext, ENT_COMPAT, getsetting("charset", "ISO-8859-1"))), true); + output("It looks like %s`n", $testtext); + $try = translate_inline("Try"); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + output("`0`n`nThese colors can be used in your name, and in any conversations you have."); + addnav("",$REQUEST_URI); +}else if($act=="specialty"){ + $specialty = httpget('specialty'); + if ($specialty==""){ + output("\"`2I want to change my specialty,`0\" you announce to %s`0.`n`n",$barkeep); + output("With out a word, %s`0 grabs you by the shirt, pulls you over the counter, and behind the barrels behind him.",$barkeep); + output("There, he rotates the tap on a small keg labeled \"Fine Swill XXX\"`n`n"); + output("You look around for the secret door that you know must be opening nearby when %s`0 rotates the tap back, and lifts up a freshly filled foamy mug of what is apparently his fine swill, blue-green tint and all.`n`n",$barkeep); + output("\"`3What? Were you expecting a secret room?`0\" he asks. \"`3Now then, you must be more careful about how loudly you say that you want to change your specialty, not everyone looks favorably on that sort of thing.`n`n"); + output("`0\"`3What new specialty did you have in mind?`0\""); + $specialities = modulehook("specialtynames"); + foreach($specialities as $key=>$name) { + addnav($name,cmd_sanitize($REQUEST_URI)."&specialty=$key"); + } + }else{ + output("\"`3Ok then,`0\" %s`0 says, \"`3You're all set.`0\"`n`n\"`2That's it?`0\" you ask him.`n`n",$barkeep); + output("\"`3Yep. What'd you expect, some sort of fancy arcane ritual???`0\" %s`0 begins laughing loudly.",$barkeep); + output("\"`3You're all right, kid... just don't ever play poker, eh?`0`n`n"); + output("\"`3Oh, one more thing. Your old use points and skill level still apply to that skill, you'll have to build up some points in this one to be very good at it.`0\""); + $session['user']['specialty']=$specialty; + } +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/inn/inn_default.php b/lotgd-web/lotgd/lib/inn/inn_default.php new file mode 100755 index 0000000..4171982 --- /dev/null +++ b/lotgd-web/lotgd/lib/inn/inn_default.php @@ -0,0 +1,64 @@ +"inn")); +if (!isset($args['block']) || $args['block'] != 'yes') { + addnav("Converse with patrons","inn.php?op=converse"); +} +addnav(array("B?Talk to %s`0 the Barkeep",$barkeep),"inn.php?op=bartender"); + +addnav("Other"); +addnav("Get a room (log out)","inn.php?op=room"); + + +if (!$skipinndesc) { + if ($op=="strolldown"){ + output("You stroll down the stairs of the inn, once again ready for adventure!`n"); + } elseif ($op=="fleedragon") { + output("You pelt into the inn as if the Devil himself is at your heels. Slowly you catch your breath and look around.`n"); + output("%s`0 catches your eye and then looks away in disgust at your cowardice!`n`n",$partner); + output("You `\$lose`0 a charm point.`n`n"); + if ($session['user']['charm'] > 0) $session['user']['charm']--; + } else { + output("You duck into a dim tavern that you know well."); + output("The pungent aroma of pipe tobacco fills the air.`n"); + } + + output("You wave to several patrons that you know."); + if ($session['user']['sex']) { + output("You give a special wave and wink to %s`0 who is tuning his harp by the fire.",$partner); + } else { + output("You give a special wave and wink to %s`0 who is serving drinks to some locals.",$partner); + } + output("%s`0 the innkeep stands behind his counter, chatting with someone.",$barkeep); + + $chats = array( + translate_inline("dragons"), + translate_inline(getsetting("bard", "`^Seth")), + translate_inline(getsetting("barmaid", "`%Violet")), + translate_inline("`#MightyE"), + translate_inline("fine drinks"), + $partner, + ); + $chats = modulehook("innchatter", $chats); + $talk = $chats[e_rand(0, count($chats)-1)]; + output("You can't quite make out what he is saying, but it's something about %s`0.`n`n", $talk); + output("The clock on the mantle reads `6%s`0.`n", getgametime()); + modulehook("inn-desc", array()); +} +modulehook("inn", array()); +module_display_events("inn", "inn.php"); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/inn/inn_room.php b/lotgd-web/lotgd/lib/inn/inn_room.php new file mode 100755 index 0000000..b53fda3 --- /dev/null +++ b/lotgd-web/lotgd/lib/inn/inn_room.php @@ -0,0 +1,74 @@ +=$expense || + $session['user']['boughtroomtoday']){ + if ($session['user']['loggedin']){ + if (!$session['user']['boughtroomtoday']) { + if ($pay == 2) { + $fee = getsetting("innfee", "5%"); + if (strpos($fee, "%")) + $expense += round($expense * $fee / 100,0); + else + $expense += $fee; + $session['user']['goldinbank']-=$expense; + } else { + $session['user']['gold']-=$expense; + } + $session['user']['boughtroomtoday']=1; + debuglog("spent $expense gold on an inn room"); + } + $session['user']['location']=$iname; + $session['user']['loggedin']=0; + $session['user']['restorepage']="inn.php?op=strolldown"; + saveuser(); + } + $session=array(); + redirect("index.php"); + }else{ + output("\"Aah, so that's how it is,\" %s`0 says as he puts the key he had retrieved back on to its hook behind his counter.",$barkeep); + output("Perhaps you'd like to get sufficient funds before you attempt to engage in local commerce."); + } +}else{ + if ($session['user']['boughtroomtoday']){ + output("You already paid for a room for the day."); + addnav("Go to room","inn.php?op=room&pay=1"); + }else{ + modulehook("innrooms"); + output("You stroll over to the bartender and request a room."); + output("He eyes you up and says, \"It will cost `\$%s`0 gold for the night in a standard room.", $expense); + $fee = getsetting("innfee", "5%"); + if (strpos($fee, "%")) { + $bankexpense = $expense + round($expense * $fee / 100,0); + } else { + $bankexpense = $expense + $fee; + } + if ($session['user']['goldinbank'] >= $bankexpense && $bankexpense != $expense) { + output("And since you are such a fine person, I'll even offer you a rate of `\$%s`0 gold if you pay direct from the bank.", $bankexpense); + if (strpos($fee, "%")) { + output("That includes a %s transaction fee.", $fee); + } else { + output("That includes a transaction fee of %s gold.", + $fee); + } + } + $bodyguards = array("Butch","Bruce","Alfonozo","Guido","Bruno","Bubba","Al","Chuck","Brutus","Nunzio","Terrance","Mitch","Rocco","Spike","Gregor","Sven","Draco"); + output("`n`n\"Also, let me tell you about our new 'Bodyguard Assistance Program' — BAP. You see, you hire one of my guards here, and they'll protect you should anyone happen to, er, pick the locks of your room,\" he says as he gestures to a series of men sitting at one of the inn's tables drinking ale.", true); + output("They range in size from a skinny shifty-eyed fellow who appears barely able to lift his stein to a great bear of a fellow."); + output("This bruiser has a tattoo of a heart with \"Mom\" written across it on his huge bicep, and goes to take a sip from his ale, but instead crushes his stein, squirting it all over the skinny fellow who doesn't voice any objection for obvious reasons."); + output("\"We call it the BAP program because when someone tries to sneak into your room, BAP BAP BAP, our guys go to work."); + output("There's only two conditions: you pay your fee up front, and the guard you choose gets to keep a portion of the rewards from any fights.\""); + output("`n`nNot wanting to part with your money when the fields offer a place to sleep, you debate the issue."); + output("You realize, however, that the inn is a considerably safer place to sleep."); + output("It is far harder for vagabonds to get you in your room while you sleep."); + output("Also, those bodyguards sound pretty safe to you."); + //output("`n`bNote, bodyguard levels not yet implemented`b`n"); + addnav(array("Give him %s gold", $expense),"inn.php?op=room&pay=1"); + if ($session['user']['goldinbank'] >= $bankexpense) { + addnav(array("Pay %s gold from bank", $bankexpense),"inn.php?op=room&pay=2"); + } + } +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/installer/installer_default_settings.php b/lotgd-web/lotgd/lib/installer/installer_default_settings.php new file mode 100755 index 0000000..ac92a31 --- /dev/null +++ b/lotgd-web/lotgd/lib/installer/installer_default_settings.php @@ -0,0 +1,149 @@ +25, + "maxtransferout"=>25, + "charset"=>"iso-8859-1", + "transferreceive"=>3, + "borrowperlevel"=>20, + "allowgoldtransfer"=>0, + "mintransferlev"=>3, + "instantexp"=>false, + "allowclans"=>false, + "LOGINTIMEOUT"=>900, + "goldtostartclan"=>10000, + "gemstostartclan"=>15, + "beta"=>0, + "betaperplayer"=>1, + "villagename"=>LOCATION_FIELDS, + "gameoffsetseconds"=>0, + "daysperday"=>4, + "serverlanguages"=>"en,English,fr,FranÃais,dk,Danish,de,Deutsch,es,EspaÃ’ol,it,Italian", + "expiretrashacct"=>1, + "expirenewacct"=>10, + "expireoldacct"=>45, + "gameadminemail"=>"postmaster@localhost.com", + "allowcreation"=>1, + "spaceinname"=>0, + "blockdupeemail"=>0, + "requireemail"=>0, + "requirevalidemail"=>0, + "defaultsuperuser"=>0, + "newplayerstartgold"=>50, + "maxrestartgold"=>300, + "maxrestartgems"=>10, + "forestchance"=>15, + "multifightdk"=>10, + "multichance"=>25, + "multibasemin"=>2, + "multibasemax"=>3, + "multislummin"=>0, + "multislummax"=>1, + "multithrillmin"=>1, + "multithrillmax"=>2, + "multisuimin"=>2, + "multisuimax"=>4, + "allowpackofmonsters"=>true, + "gardenchance"=>0, + "deathoverlord"=>'`$Ramius', + "homecurtime"=>1, + "homenewdaytime"=>1, + "homenewestplayer"=>1, + "newestplayer"=>"", + "OnlineCountLast"=>0, + "OnlineCount"=>0, + "maxonline"=>0, + "loginbanner"=>"*BETA* This is a BETA of this website, things are likely to change now and again, as it is under active development *BETA*", + "homeskinselect"=>1, + "defaultskin"=>"jade.htm", + "innname"=>LOCATION_INN, + "barkeep"=>"`tCedrik", + "impressum"=>"", + "companionsallowed"=>1, + "soap"=>1, + "clanregistrar"=>"`%Karissa", + "maxcolors"=>10, + "postinglimit"=>1, + "game_epoch"=>gmdate("Y-m-d 00:00:00 O",strtotime("-30 days")), + "usedatacache"=>0, + "show_notices"=>0, + "notify_on_warn"=>0, + "notify_on_error"=>0, + "notify_address"=>"", + "notify_every"=>30, + "last_char_expire"=>"0000-00-00 00:00:00", + "maxattacks"=>4, + "autofight"=>0, + "autofightfull"=>0, + "suicide"=>0, + "suicidedk"=>10, + "dropmingold"=>0, + "forestgemchance"=>25, + "instantexp"=>false, + "addexp"=>5, + "forestexploss"=>10, + "disablebonuses"=>1, + "gravechance"=>0, + "pvp"=>1, + "allowspecialswitch"=>true, + "innchance"=>0, + "bard"=>"`^Seth", + "barmaid"=>"`%Violet", + "innfee"=>"5%", + "inboxlimit"=>50, + "oldmail"=>14, + "onlyunreadmails"=>true, + "mailsizelimit"=>1024, + "expirecontent"=>180, + "lastdboptimize"=>date("y-m-d h:i:s"), + "paypalcurrency"=>"USD", + "logdnet"=>0, + "serverurl"=>"http://".$_SERVER['SERVER_NAME'].($_SERVER['SERVER_PORT'] == 80?"":":".$_SERVER['SERVER_PORT']).dirname($_SERVER['REQUEST_URI']), + "defaultlanguage"=>"en", + "serverdesc"=>"Another LoGD Server", + "logdnetserver"=>"http://logdnet.logd.com/", + "paypalemail"=>"", + "paypaltext"=>"legend of the green dragon site donation from", + "paypalcountry-code"=>"us", + "emailpetitions"=>0, + "multimaster"=>1, + "pvpimmunity"=>5, + "pvpminexp"=>1500, + "pvpdeflose"=>5, + "pvpattgain"=>10, + "pvpattlose"=>10, + "pvpdefgain"=>10, + "curltimeout"=>5, + "pvptimeout"=>600, + "allowoddadminrenames"=>0, + "dictionary"=>"/usr/share/dict/words", + "enabletranslation"=>true, + "collecttexts"=>false, + "cachetranslations"=>0, + "tl_maxallowed"=>0, + "permacollect"=>0, + "maxlistsize"=>100, + "refereraward"=>25, + "referminlevel"=>4, + "superuseryommessage"=>"Asking an admin for gems, gold, weapons, armor, or anything else which you have not earned will not be honored. If you are experiencing problems with the game, please use the 'Petition for Help' link instead of contacting an admin directly.", + "officermoderate"=>0, + "motditems"=>5, + "turns"=>10, + "maxinterest"=>10, + "mininterest"=>1, + "pvpday"=>3, + "fightsforinterest"=>4, + "maxgoldforinterest"=>100000, + "resurrectionturns"=>-6, + "gravefightsperday"=>10, + "newdaycron"=>0, + "newdaySemaphore"=>"0000-00-00 00:00:00", + "selfdelete"=>0, + "allowfeed"=>0, + "displaymasternews"=>1, + "companionslevelup"=>1, + "edittitles"=>1, + "automaster"=>1, + "villagechance"=>0, + "enablecompanions"=>true, +); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/installer/installer_functions.php b/lotgd-web/lotgd/lib/installer/installer_functions.php new file mode 100755 index 0000000..dd37277 --- /dev/null +++ b/lotgd-web/lotgd/lib/installer/installer_functions.php @@ -0,0 +1,60 @@ +the LotGD.net forums."); + } + }else{ + output("`\$It seems I was not successful.`2 "); + output("The error returned by the database server was:"); + rawoutput("
$error
"); + } + +} + +$tipid=0; +function tip(){ + global $tipid; + $tip = translate_inline("Tip"); + output_notl("
`i[ `b{$tip}`b ]`i",true); + rawoutput("
"); + $args = func_get_args(); + call_user_func_array("output",$args); + rawoutput("
"); + rawoutput(""); + $tipid++; +} + +function descriptors($prefix=""){ + require_once("lib/all_tables.php"); + $array = get_all_tables(); + $out = array(); + while (list($key,$val)=each($array)){ + $out[$prefix.$key]=$val; + } + return $out; +} + +//This function is borrowed from the php manual. +function return_bytes($val) { + $val = trim($val); + $last = strtolower($val{strlen($val)-1}); + switch($last) { + // The 'G' modifier is available since PHP 5.1.0 + case 'g': + $val *= 1024; + case 'm': + $val *= 1024; + case 'k': + $val *= 1024; + } + return $val; +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/installer/installer_sqlstatements.php b/lotgd-web/lotgd/lib/installer/installer_sqlstatements.php new file mode 100755 index 0000000..3450d4b --- /dev/null +++ b/lotgd-web/lotgd/lib/installer/installer_sqlstatements.php @@ -0,0 +1,877 @@ +array(), //needed just as a placeholder for new installs. +"0.9"=>array( + +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (1, 'Thieving Kender', 1, 'Whirling Hoopak', 'You only wish you could pickpocket your money back from the thief.', NULL, 36, 14, 10, 1, 1, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (2, 'Rude Student', 1, 'Worn Textbook', 'You have sent this student to permanent detention.', '', 36, 14, 10, 1, 1, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (3, 'Baby Unicorn', 1, 'Blunt Horn', 'You feel like a real jerk killing something so pretty.', '', 36, 14, 10, 1, 1, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (4, 'Small Purple Mouse', 1, 'Lashing pink tail', 'It is written in black and white: this strange technicolor mouse is no more.', '', 36, 14, 10, 1, 1, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (5, 'Grunting Piggy', 1, 'Wiggly Snout', 'Mmm...Bacon', NULL, 36, 14, 10, 1, 1, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (6, 'Dumb Old Eyesore', 2, 'Nagging complaints', 'All she ever did was nag...nag...nag...', NULL, 97, 24, 21, 3, 3, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (7, 'Pygmy Marmoset', 2, 'Pieces of treebark', 'The strange little monkey falls from the trees and lies still.', NULL, 97, 24, 21, 3, 3, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (8, 'Burly Man', 15, 'Amazing Absorbency', 'Fantasize, fantasize about Burly ...Eeeh, Eeeh, Eeeh!', NULL, 531, 189, 155, 29, 21, NULL, 'Bluspring', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (9, 'Screaming Banshee', 2, 'Hauntingly Beautiful Voice', 'You plunge your weapon into her breast, silencing her song.', '', 97, 24, 21, 3, 3, '', 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (10, 'Ursa Minor', 2, 'Twinkling Lights', 'After an astronomical battle, Ursa Minor is the one seeing stars', NULL, 97, 24, 21, 3, 3, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (11, 'Stone Troll', 2, 'Gaping Maw', 'That troll is stone cold ugly.', NULL, 97, 24, 21, 3, 3, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (12, 'Slithering Asp', 2, 'Hypnotic eyes', 'You break the deadly gaze of the snake to save your own life.', '', 97, 24, 21, 3, 3, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (13, 'Windan The Barbarian', 2, 'Feathered Spear', 'He really was just a feather-weight', NULL, 97, 24, 21, 3, 3, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (14, 'Studious Young Sorceror', 2, 'Newly memorized spells', 'Perhaps she should have studied harder.', '', 97, 24, 21, 3, 3, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (15, 'Four and Twenty Blackbirds', 3, 'Freshly Baked Pies', 'Now isn''t this a dainty dish to set before a king?', NULL, 148, 34, 32, 5, 4, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (16, 'Amazon', 3, 'Bow and Arrow', 'The beautiful warrior lass has lost a battle for the first time.', NULL, 148, 34, 32, 5, 4, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (17, 'Overbearing Mother', 3, '9pm Curfew', 'With one fell swoop you save your social life!', '', 148, 34, 32, 5, 4, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (18, 'Huge Bald Programmer', 3, 'Shining Forehead', 'You feel as if you have seen this man before in the village.', '', 148, 34, 32, 5, 4, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (19, 'Someone''s Grandfather', 3, 'Stories that go nowhere', 'This reminds you of the time you needed a new heel for your shoe.', '', 148, 34, 32, 5, 4, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (20, 'Juvenile Delinquent', 3, 'Poor Attitude', 'With a satisfying thump, you knock the smirk right off his face.', '', 148, 34, 32, 5, 4, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (21, 'Beautiful Woodland Sprite', 3, 'Kindness and tranquility', 'You really cut that wood sprite down to size.', '', 148, 34, 32, 5, 4, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (22, 'Society Belle', 3, 'Southern Charm', 'Now she will never be on time for the ball!', NULL, 148, 34, 32, 5, 4, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (23, 'Giant Goldfish Cracker', 3, 'Annoying Commercial Jingles', 'Now *there* is a fish that smiled till you bit his head off.', NULL, 148, 34, 32, 5, 4, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (24, 'Angry Mob', 4, 'Torches', 'There is no justice for an angry mob.', '', 162, 45, 43, 7, 6, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (25, 'Polar Bear', 4, 'Terrible claws', 'That bear really needed an attitude adjustment.', '', 162, 45, 43, 7, 6, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (26, 'Decaying Skeleton', 4, 'Rusty Sword', 'His leg ought to make a good toy for your dog.', NULL, 162, 45, 43, 7, 6, NULL, 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (27, 'Willie the Wonder Hampster', 4, 'Nuclear Sunflower Seeds', 'You smile a grim smile at Willie and quietly munch on some seeds.', '', 162, 45, 43, 7, 6, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (28, 'Winged Demon Of Death', 4, 'Red Glare', 'You cut off the Demon''s head, to be sure of its death.', NULL, 162, 45, 43, 7, 6, NULL, 'foilwench', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (29, 'Small Dragon', 4, 'Hot air', 'For one moment you thought THIS was the Green Dragon, but alas not.', NULL, 162, 45, 43, 7, 6, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (30, 'Monstrous Dustbunny', 4, 'Sneezing fits', 'You sweep the poor bunny under the rug when no one is looking.', '', 162, 45, 43, 7, 6, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (31, 'Small Rabbit', 4, 'Sharp Pointy Teeth', 'To think you almost ran away!', NULL, 162, 45, 43, 7, 6, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (32, 'Mature Unicorn', 5, 'Powerful Horn', 'A unicorn is a thing of beauty, even in death.', '', 198, 55, 53, 9, 7, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (33, 'Gnome Necromancer', 5, 'Skeleton Familiar', 'Once you killed its familiar that Gnome was really weak.', NULL, 198, 55, 53, 9, 7, NULL, 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (34, 'Purple Dinosaur', 5, 'Helpful Nature', 'There seems to be a person inside that strange dino. You wonder why.', NULL, 198, 55, 53, 9, 7, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (35, 'Orc Emmisary', 5, 'Diplomacy', 'You never were the diplomatic type.', NULL, 198, 55, 53, 9, 7, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (36, 'Dark Spiritling', 5, 'Dark Magic', 'The spiritling gasps a final breath as you end its pitiful life.', '', 198, 55, 53, 9, 7, '', 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (37, 'Enchanted Toilet', 5, 'Ninja Flushing Action', 'That was just weird.', '', 198, 55, 53, 9, 7, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (38, 'Giant Water Elemental', 5, 'Torrential Downpours', 'The giant creature is reduced a meager spring shower.', '', 198, 55, 53, 9, 7, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (39, 'Violins', 5, 'Off-Key notes', 'Won''t someone PLEASE stop the violins?', NULL, 198, 55, 53, 9, 7, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (40, 'Whirled Peas', 5, 'Green Slime', 'We should all pray for whirled peas.', NULL, 198, 55, 53, 9, 7, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (41, 'Magic Mushroom', 6, 'Swirling Colors', 'Guess you don''t need to go ask Alice now.', '', 234, 66, 64, 11, 8, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (42, 'Invisible Man', 6, 'Something Invisible and Sharp', 'You really aren''t sure if it is dead, or just hiding...after all it is invisible.', '', 234, 66, 64, 11, 8, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (43, 'Clown of Death', 6, 'Balloon Animals from Beyond', 'You give the clown''s nose a honk just for fun before you leave.', '', 234, 66, 64, 11, 8, '', 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (44, 'Heart of Stone', 6, 'Unromantic Thoughts', 'Aww, now look, you broke its heart!', NULL, 234, 66, 64, 11, 8, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (45, 'Troll Warrior', 6, 'Steel Broadsword', 'Wow, he smelled bad enough alive, can you imagine how he''ll smell tomorrow?', NULL, 234, 66, 64, 11, 8, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (46, 'Bettie the Amazing Kung-Fu Butterfly', 6, 'Stupendous Kung-Fu Wings', 'You survived a battle to the death with a butterfly. You must be so proud.', NULL, 234, 66, 64, 11, 8, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (47, 'Golden Goose', 6, '14 Karat Gold Eggs', 'You have slain the goose but it is too heavy to take back to town. All that wealth wasted.', NULL, 234, 66, 64, 11, 8, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (48, 'Black Tiger', 6, 'Claws', 'You ponder the tiger''s body thinking what a good rug it might make.', '', 234, 66, 64, 11, 8, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (49, 'Lambert the Sheepish Lion', 6, 'Timid Growling', 'You marched in like a lion and he died like a lamb.', '', 234, 66, 64, 11, 8, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (50, 'Marsha of the Jungle', 7, 'Trained Monkeys', 'Poor Marsha, she thought those monkeys were better trained.', '', 268, 77, 74, 13, 10, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (51, 'Moe', 7, 'Two Knives', 'Maybe those knives weren''t so great.', '', 268, 77, 74, 13, 10, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (52, 'Coffin', 7, 'Terrifying Premonitions', 'Best way to get rid of the coffin is Robitussin.', NULL, 268, 77, 74, 13, 10, NULL, 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (53, 'Green Alligator', 7, 'Crushing Jaws', 'Crikey! That thing could have killed you!', NULL, 268, 77, 74, 13, 10, NULL, 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (54, 'Lindsey, Daughter of Erin the Ninja Squirrel', 7, 'A Peanut Shooter', 'All these squirrels are nuts.', '', 268, 77, 74, 13, 10, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (55, 'Wizarding School Senior Student', 7, 'Memory Charm', 'Drat! He took your memory before you killed him. Who are you anyway?', NULL, 268, 77, 74, 13, 10, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (56, 'Enchanted Laundry Basket', 7, 'Stinky Socks of Terror', 'So that''s what happens to lost socks!', NULL, 268, 77, 74, 13, 10, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (57, 'Carrot Top', 7, 'Phone Company Slogans', 'That has got to be the most satisfying kill you ever made.', NULL, 268, 77, 74, 13, 10, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (58, 'Macintosh Computer', 7, 'Amazingly Bright Colors', 'So THAT''S what happens when you right-click a Mac.', NULL, 268, 77, 74, 13, 10, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (59, 'Interior Designer', 8, 'Color-coordinating Sword and Shield', 'You didn''t like his style.', '', 302, 89, 84, 15, 11, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (60, 'Daughter of the Devil', 8, 'Sinfully Good Looks', 'She is the girl your mom always warned you about.', NULL, 302, 89, 84, 15, 11, NULL, 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (61, 'Wild Horses', 8, 'Dragging', 'I guess the saying is true, wild horses can''t drag you away.', '', 302, 89, 84, 15, 11, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (62, 'Steam Elemental', 8, 'Scalding jets of air', 'There was just enough steam left to make an espresso.', '', 302, 89, 84, 15, 11, '', 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (63, 'Gordon the Cheese Eater', 8, 'Odiferous Nature', 'You sure cut that cheese....eater.', '', 302, 89, 84, 15, 11, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (64, 'Narcoleptic', 8, 'Drowsiness', 'This narcoleptic won''t be waking up anytime soon.', '', 302, 89, 84, 15, 11, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (65, 'Swarm of Bees', 8, 'Stinging', 'You feel like a pincushion, but you are alive.', '', 302, 89, 84, 15, 11, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (66, 'Halfling Mage', 8, 'Painful Spells', 'That fight wasn''t half as difficult as you thought it would be.', '', 302, 89, 84, 15, 11, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (67, 'Citizen of Eythgim Village', 9, 'Slurs', 'Geeze, what did you ever do to him?', NULL, 336, 101, 94, 17, 13, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (68, 'Old Hag', 9, 'Red Red Rose', 'It is her turn to sleep an enchanted sleep.', '', 336, 101, 94, 17, 13, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (69, 'Charging Buffalo', 9, 'Stampeding Hoofs', 'Do you know how to stop a charging buffalo? Take away his credit card!', NULL, 336, 101, 94, 17, 13, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (70, 'Pawn', 9, 'Simple Tactics', 'Well, that was a bad move.', '', 336, 101, 94, 17, 13, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (71, 'Romulan', 9, 'Wrong-Genre Confusion', 'You think to yourself they look tougher on TV.', '', 336, 101, 94, 17, 13, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (72, 'Large Griffon', 9, 'Beak and Claws', 'The mythical creature is no more.', '', 336, 101, 94, 17, 13, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (73, 'Cliche Bond Movie Villain', 9, 'Cell-phone of Death', 'Well, really, who throws a cell phone? I mean, that really, really hurt!', '', 336, 101, 94, 17, 13, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (74, 'Fuzzy Ferret', 9, 'Disarming Cuteness', 'Who knew ferrets were so violent!', NULL, 336, 101, 94, 17, 13, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (75, 'Starving Artist', 9, 'Pointy Paintbrushes', 'This guy really painted himself into a corner.', '', 336, 101, 94, 17, 13, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (76, 'Guard from Eythgim Village', 10, 'Rapier', 'The people from that village seem angry!', NULL, 369, 114, 105, 19, 14, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (77, 'Garden Gnome', 10, 'Painful Tackiness', 'Stupid garden gnomes. What are they doing in the forest anyway?', '', 369, 114, 105, 19, 14, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (78, 'Chicken', 10, 'Squawking', 'Good fortune smiles upon you - you will eat well tonight.', '', 369, 114, 105, 19, 14, '', 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (79, 'Marksman', 10, 'Deadly Aim', 'He took so long to aim, you just walked up and kicked him.', '', 369, 114, 105, 19, 14, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (80, 'Enchanted Tissue Box', 10, 'Cold Germs', 'You pick up the box and put it in your pocket. You never know when a tissue might come in handy.', '', 369, 114, 105, 19, 14, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (81, 'Ghostly Woodsman', 10, 'Phantom Axe', 'You aren''t sure how you did it, but you killed something that was already dead. Good for you.', NULL, 369, 114, 105, 19, 14, NULL, 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (82, 'Zombie', 10, 'Rotting Flesh', 'He really went to pieces, didn''t he?', NULL, 369, 114, 105, 19, 14, NULL, 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (83, 'Fortula the Plains Cat', 10, 'Claws and Teeth', 'That plains cat is now plain dead.', '', 369, 114, 105, 19, 14, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (84, 'Erin the Ninja Squirrel', 10, 'Acorn Tossing Madness', 'That squirrel was a little crazy.', '', 369, 114, 105, 19, 14, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (85, 'Bluebird of Happiness', 11, 'Uplifting Melody', 'Happiness is over-rated anyway.', '', 402, 127, 115, 21, 15, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (86, 'Potato Newscaster', 11, 'Personal Opinions', 'It''s ok, he was just a common ''tater.', '', 402, 127, 115, 21, 15, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (87, 'Pygmy Dragon', 11, 'Fire Breath', 'You hope he wasn''t a relative of the Green Dragon.', '', 402, 127, 115, 21, 15, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (88, 'Zealous Photographer', 11, 'Flashing Lights', 'The things beautiful people have to put up with.', NULL, 402, 127, 115, 21, 15, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (89, 'Gary Larson', 11, 'Strange Cartoons', 'You still don''t get it.', NULL, 402, 127, 115, 21, 15, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (90, 'Soldier from Eythgim Village', 11, 'Battle Cry', 'Eythgim seems to be waging a personal war with you.', '', 402, 127, 115, 21, 15, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (91, '80''s Glam Rocker', 11, 'Blinding Makeup', 'You know your motto, Live and let die.', NULL, 402, 127, 115, 21, 15, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (92, 'Vigilante', 11, 'Sack of Doorknobs', 'This carnage disgusts you.', '', 402, 127, 115, 21, 15, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (93, 'The Devil', 11, 'Eternal Damnation', 'For being the Devil, he really wasn''t so hot.', NULL, 402, 127, 115, 21, 15, NULL, 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (94, 'Mercenary', 12, 'Blood-chilling Stare', 'You could use an ale.', '', 435, 141, 125, 23, 17, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (95, 'Magic Mirror', 12, 'Flattering Remarks', 'Mirror, Mirror, on the Ground, it is your death that you have found.', NULL, 435, 141, 125, 23, 17, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (96, 'Broadway Extra', 12, 'Memorable Showtunes', 'This extra is really on her own now.', '', 435, 141, 125, 23, 17, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (97, 'Butter the Sprite', 12, 'Magic Pixie Dust', 'Butter? What kind of a name is Butter?', NULL, 435, 141, 125, 23, 17, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (98, 'Father Time', 12, 'Old Age', 'Your victory is not comforting. You know he will still catch up to you.', '', 435, 141, 125, 23, 17, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (99, 'Eythgim Village Archers', 12, 'Flaming Arrows', 'The tree is burning, you''d better try to put it out.', NULL, 435, 141, 125, 23, 17, NULL, 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (100, 'Animate Stormcloud', 12, 'Lightning', 'The storm is no more. You can see the light of day peeking through the last of the clouds.', '', 435, 141, 125, 23, 17, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (101, 'Three Toed Sloth', 12, 'Slow Responses', 'Your swift moves were too fast for this sloth.', '', 435, 141, 125, 23, 17, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (102, 'Death', 12, 'Cold Grasp', 'There it is! Death!!!!!', NULL, 435, 141, 125, 23, 17, NULL, 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (103, 'Cerberus', 13, 'Three Drooling Maws', 'Each one''s breath was worse than the last.', '', 467, 156, 135, 25, 18, '', 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (104, 'Man from deep, deep, dark, dark, deep, dark woods', 13, 'Snarling and Biting', 'The creature from the deep, deep, dark, dark, deep, dark woods is finally dead.', '', 467, 156, 135, 25, 18, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (105, 'Devil in a Blue Dress', 13, 'Alluring Promises', 'You really prefer black dresses anyway.', '', 467, 156, 135, 25, 18, '', 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (106, 'Giant', 13, 'Smashing Club', 'Geeze, he almost fell on you!', NULL, 467, 156, 135, 25, 18, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (107, 'Commander of the Eythgim Army', 13, 'Winning Tactics', 'You have bested their army by killing its master.', NULL, 467, 156, 135, 25, 18, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (108, 'Ice Dragon', 13, 'Frost Breath', 'You defeated him, but caught a cold.', NULL, 467, 156, 135, 25, 18, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (109, 'Pushmi Pullyew', 13, 'Conflictory Arguments', 'That strange creature couldn''t tell if it was coming or going.', NULL, 467, 156, 135, 25, 18, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (110, 'Whale', 13, 'Tail', 'You know Violet isn''t going to believe a Whale attacked you in the forest.', '', 467, 156, 135, 25, 18, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (111, 'Gorma The Leper', 13, 'Contagious Disease', 'It looks like the leper''s fighting strategy has fallen apart...', NULL, 467, 156, 135, 25, 18, NULL, 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (112, 'Samurai Master', 14, 'Daisho', 'You bow to the fallen master before you walk away.', '', 499, 172, 145, 27, 20, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (113, 'Bartender', 14, 'Duck', 'That''s not a Duck! It''s a Chicken!', NULL, 499, 172, 145, 27, 20, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (114, 'Prince of Eythgim Village', 14, 'Bribes of Gold', 'You are not easily bribed, and he was a mortal enemy.', '', 499, 172, 145, 27, 20, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (115, 'Loch Ness Monster', 14, 'Shocking Appearance', 'Why in the world would that monster be in this forest. You must have been dreaming!', '', 499, 172, 145, 27, 20, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (116, 'Fuzzie Wuzzie', 14, 'Male Pattern Baldness', 'Fuzzie Wuzzie wasn''t very fuzzie, was he?', NULL, 499, 172, 145, 27, 20, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (117, 'Princess of Eythgim Village', 15, 'Beguiling Words', 'She tried to tempt you, but you resisted.', NULL, 531, 189, 155, 29, 21, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (118, 'Ugly Harpy', 14, 'Poisonous Breath', 'Her breath was worse than her bite.', '', 499, 172, 145, 27, 20, '', 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (119, 'Field Mouse', 14, 'Chewing', 'That was some powerful mouse!', NULL, 499, 172, 145, 27, 20, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (120, 'Monarch of Eythgim Village', 16, 'Royal Commands', 'I guess this makes you king of their Village.', NULL, 563, 207, 166, 31, 22, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (121, 'Cyclops Warrior', 15, 'Fire Eye', 'The dead Cyclops'' one eye stares at you blankly.', NULL, 531, 189, 155, 29, 21, NULL, 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (122, 'Cupid', 15, 'Pink Arrows of Love', 'You have slain Cupid. You shall never find true love.', '', 531, 189, 155, 29, 21, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (123, 'Tabloid Writer', 15, 'Far-fetched Stories', 'If you ask me, SHE was the six-armed alien who gave birth to the world''s largest infant Elvis impersonator.', '', 531, 189, 155, 29, 21, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (124, 'Evil Wizard', 15, 'Tormented Souls', 'You have set the tortured souls free.', '', 531, 189, 155, 29, 21, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (125, 'Artemis, Goddess of the Hunt', 15, 'Winged Stags', 'The moon itself shall weep for the slain Artemis.', '', 531, 189, 155, 29, 21, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (126, 'Centaur Archer', 15, 'Deadly Marksmanship', 'The twisted man-beast lies still.', '', 531, 189, 155, 29, 21, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (127, 'Mime', 15, 'Something Imaginary', 'His death is a rather sad charade.', '', 531, 189, 155, 29, 21, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (128, 'Chili Chef', 15, 'Insanity Peppers', 'Man, that''s good chili!', '', 531, 189, 155, 29, 21, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (129, 'Brownie', 16, 'Miniscule weapons', 'The tiny warrior dies with a faint squeal.', '', 563, 207, 166, 31, 22, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (130, 'Darkness', 16, 'Self-induced Terror', 'You are afraid of the dark no longer.', '', 563, 207, 166, 31, 22, '', 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (131, 'Mountain King', 16, 'God-like Fury', 'The King has died, long live the King!', '', 563, 207, 166, 31, 22, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (134, 'Loneliness', 17, 'Silence', 'What is the sound of one hand clapping?', 'What is the sound of one hand clapping?', 36, 0, 1, 0, 0, NULL, NULL, 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (135, 'Loneliness', 18, 'Silence', 'What is the sound of one hand clapping?', 'What is the sound of one hand clapping?', 0, 0, 1, 0, 25, NULL, NULL, 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (136, 'Le Chat dans le chapeau', 15, 'Rhyming Nonsense', 'In spanish, El Gato en el sombrero.', '', 531, 189, 155, 29, 21, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (138, 'Whopper With Cheese', 8, 'Abundant Cholesterol', 'This is one whopper that won''t show up on your hips tomorrow.', NULL, 302, 89, 84, 15, 11, NULL, 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (139, 'Swarming Ladybugs', 3, 'Stinking Residue', 'Those Ladybugs weren''t very ladylike.', NULL, 148, 34, 32, 5, 4, NULL, 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (140, 'Football Fan', 6, 'Raucous Cheers', 'This fan doesn''t have much to cheer about.', NULL, 234, 66, 64, 11, 8, NULL, 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (141, 'King Agrippa', 13, 'Flaming Wingnuts', 'As you stare at his smoking corpse, you marvel at the ineffectiveness of flaming wingnuts.', NULL, 467, 156, 135, 25, 18, NULL, 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (142, 'Cherubically Charming Child', 1, 'Curious Questions', 'You think it was the alliteration that did him in.', NULL, 36, 14, 10, 1, 1, NULL, 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (143, 'Haberdasher', 5, 'Heavy Hat', 'Hats have gone out of style anyway.', NULL, 198, 55, 53, 9, 7, NULL, 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (144, 'Rush Hour Driver', 11, 'Road Rage', 'It was a no-win situation, speeding on these forest paths. The driver had it coming.', NULL, 402, 127, 115, 21, 15, NULL, 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (145, 'Sorority Girl in Nightie', 7, 'Pillow Fighting Action', 'It''s too bad she''s dead... you liked her action.', '', 268, 77, 74, 13, 10, '', 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (146, 'Ulysses Wulfgang', 14, 'Ridiculous Lies', 'Death to lies! Death to Ulysses Wulfgang!', '', 499, 172, 145, 27, 20, '', 'Joe', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (147, 'Crazy Audrey', 9, 'Ravenous Kittens', 'With a well placed stomp, Audrey and the kittens are no more.', NULL, 336, 101, 94, 17, 13, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (148, 'Shining Happy People', 5, 'Hand Holding Terror', 'They just wanted to be your friend. You meanie.', NULL, 198, 55, 53, 9, 7, NULL, 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (149, 'Elsabutt', 8, 'Gravitational Pull', 'This is indeed a grave situation.', '', 302, 89, 84, 15, 11, '', 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (150, 'Mr. Bear', 2, 'Overwhelming Sleepiness', 'Mr. Bear was too tired to finish playing with you and went back to napping.', '', 97, 24, 21, 3, 3, '', 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (151, 'Everquest Junkie', 12, '1337 Sp34k', 'D00d U pwned that guy!', NULL, 435, 141, 125, 23, 17, NULL, 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (152, 'Little Cocobean', 4, 'Her Special Roast', 'She really made your heart race and pound, but now she has crumbled to the ground', NULL, 162, 45, 43, 7, 6, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (153, 'Humongous Hairball', 5, 'Incredible Drain-Clogging Power', 'The hairball and all its accompanying gook have been washed out to sea!', NULL, 198, 55, 53, 9, 7, NULL, 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (154, 'Iron Chef', 4, 'Sizzling Eel Flambe!', 'You have rendered the Chef Ironless! He''s now simply a copper/tin alloy!', NULL, 162, 45, 43, 7, 6, NULL, 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (155, 'The Government', 7, 'Taxes', 'That''s a tax return you''ll be taking to the bank!', NULL, 268, 77, 74, 13, 10, NULL, 'Bluspring', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (156, 'Bar Fly', 1, 'Alcoholism', 'Good thing you got him before cirrhosis did!', NULL, 36, 14, 10, 1, 1, NULL, 'Bluspring', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (157, 'Methane Man', 7, 'Unfriendly Gasses', 'Must have been that bean he ate!', NULL, 268, 77, 74, 13, 10, NULL, 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (158, 'Wooly Mammoth', 8, 'Wildebeest Sidekick', 'You climb atop the Mammoth''s remains and declare yourself king (or queen) for a day!', NULL, 302, 89, 84, 15, 11, NULL, 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (159, 'Nasty Nevin', 10, 'Bossy Mom', 'Wrecked\\'em? Darn near killed \\'em!', NULL, 369, 114, 105, 19, 14, NULL, 'Joe', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (160, 'The Gar Man', 3, 'Jar of Cotton Balls', 'There is but one Gar Man! And now he''s just fluff!', '', 148, 34, 32, 5, 4, '', 'foilwench', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (161, 'Hiker', 1, 'Walking Stick', 'His last words were \"...I must protect the dragon.\"', '', 36, 14, 10, 1, 1, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (162, 'Camper', 2, 'Marshmallow-roasting Stick', 'With her dying breath she gasps \"...and I never saw the dragon.\"', NULL, 97, 24, 21, 3, 3, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (163, 'Forest Ranger', 3, 'Hunting Rifle', 'In his pack you find a copy of \"Dragon Seeking for Dummies.\"', '', 148, 34, 32, 5, 4, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (164, 'Tree-Hugger', 4, 'Propaganda Leaflets', 'The leaflet reads \"Who Will Protect The Helpless Dragon?\"', '', 162, 45, 43, 7, 6, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (165, 'Forest Dwelling Hermit', 5, 'Hand-Made Sling', 'He speaks only these words as he dies: \"You must leave the Dragon''s Forest.\"', NULL, 198, 55, 53, 9, 7, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (166, 'Member of Dragon Lovers Anonymous', 6, 'Stuffed Dragon Toy', 'When one wears a pin saying \"Dragon Lovers Anonymous\" they really are not as anonymous as they might think.', '', 234, 66, 64, 11, 8, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (167, 'Initiate Dragon Watcher', 7, 'Binoculars', 'All he could say was \"Shhh, you are scaring the dragons!\"', NULL, 268, 77, 74, 13, 10, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (168, 'Dragon Watcher, Junior Class', 8, 'Annoyance', 'You find a dragon-watching textbook in his backpack.', NULL, 302, 89, 84, 15, 11, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (169, 'Dragon-watcher Senior Class', 9, 'Spelunking Equipment', 'You find a copy of \"Cave-Dwelling Dragons, and Where to Find Them\" in his pack.', '', 336, 101, 94, 17, 13, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (170, 'Master Dragon Watcher', 10, 'Stealth', 'You wonder who watches the watchers.', '', 369, 114, 105, 19, 14, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (171, 'Initiate Dragon Tamer', 11, '10-foot dragon pole', 'Good thing for you that pole only works on 10-foot dragons!', NULL, 402, 127, 115, 21, 15, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (172, 'Junior Dragon Tamer', 12, 'Large Whip', 'If he cannot tell the difference between you and a dragon, he has much work to do.', '', 435, 141, 125, 23, 17, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (173, 'Senior Dragon Tamer', 13, 'Very Large Hoop', 'You regret killing him. You wanted to see him make a dragon jump through that hoop.', '', 467, 156, 135, 25, 18, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (174, 'Master Dragon Tamer', 14, 'Tame Dragon', 'Once you killed the master, the dragon ran away', NULL, 499, 172, 145, 27, 20, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (175, 'Dragon Rider in Training', 15, 'Mechanical Bull', 'They learn to ride dragons using a mechanical bull?', NULL, 531, 189, 155, 29, 21, NULL, 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (176, 'Dragon Rider', 16, 'Flying Dragon', 'A well-aimed strike grounds the flying dragon and his rider.', '', 563, 207, 166, 31, 22, '', 'Appleshiner', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (177, 'Batling', 1, 'Tiny flapping wings', 'Silly batling!', '', 36, 14, 10, 1, 1, '', 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (178, 'Small Bat', 2, 'Slightly venomous fangs', 'The small mammal falls to the ground lifeless.', '', 97, 24, 21, 3, 3, '', 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (179, 'Medium Sized Bat', 3, 'Screeching Cries', 'You killed it just to shut it up.', NULL, 148, 34, 32, 5, 4, NULL, 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (180, 'Large Bat', 4, 'Guano', 'You feel the need to take a bath.', '', 162, 45, 43, 7, 6, '', 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (181, 'Giant Bat', 5, 'Clinging and Biting', 'Why do movie bats always fly at people''s hair?', NULL, 198, 55, 53, 9, 7, NULL, 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (182, 'Vampire Batling', 6, 'Pricking teeth', 'He resembled a mosquito more than a vampire bat.', '', 234, 66, 64, 11, 8, '', 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (183, 'Small Vampire Bat', 7, 'Deadly Fangs', 'You kick at the annoying pest as it lies on the ground.', '', 268, 77, 74, 13, 10, '', 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (184, 'Medium Sized Vampire Bat', 8, 'Echoing Sounds', 'Who decides that this bat is a \"Medium\"? Maybe he is a giant bat who hasn''t bloomed yet.', NULL, 302, 89, 84, 15, 11, NULL, 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (185, 'Huge Vampire Bat', 9, 'Blood-Sucking', 'You gave more blood to the Red Cross.', '', 336, 101, 94, 17, 13, '', 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (186, 'Vampire in Bat Form', 10, 'Bad Romanian Accent', '\"I vant to suk your blooood!\"', NULL, 369, 114, 105, 19, 14, NULL, 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (187, 'Vampire-Bat Prince', 11, 'Death Grip', 'You thought bats were Republicans.', '', 402, 127, 115, 21, 15, '', 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (188, 'Vampire Bat King', 12, 'Red Eyes', 'You decide to leave before the rest of the bats come to find their king.', '', 435, 141, 125, 23, 17, '', 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (189, 'Sorcerous Vampire', 13, 'Petrifying Spells', 'A cold shiver goes down your spine. You would rather be with Violet.', '', 467, 156, 135, 25, 18, '', 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (219, 'Seductive Vampiress', 14, 'Sultry Moves', 'It was a shame to kill her.', NULL, 499, 172, 145, 27, 20, NULL, 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("masters") . " VALUES (1,'Mireraband',1,'Small Dagger','Well done %w`&, I should have guessed you\\'d grown some.','As I thought, %w`^, your skills are no match for my own!',NULL,NULL,12,2,2)", +"INSERT INTO " . db_prefix("masters") . " VALUES (2,'Fie',2,'Short Sword','Well done %w`&, you really know how to use your %x.','You should have known you were no match for my %X',NULL,NULL,22,4,4)", +"INSERT INTO " . db_prefix("masters") . " VALUES (3,'Glynyc',3,'Hugely Spiked Mace','Aah, defeated by the likes of you! Next thing you know, Mireraband will be hunting me down!','Haha, maybe you should go back to Mireraband\\'s class.',NULL,NULL,33,6,6)", +"INSERT INTO " . db_prefix("masters") . " VALUES (4,'Guth',4,'Spiked Club','Ha! Hahaha, excellent fight %w`&! Haven\\'t had a battle like that since I was in the RAF!','Back in the RAF, we\\'d have eaten the likes of you alive! Go work on your skills some old boy!',NULL,NULL,44,8,8)", +"INSERT INTO " . db_prefix("masters") . " VALUES (5,'Un�lith',5,'Thought Control','Your mind is greater than mine. I concede defeat.','Your mental powers are lacking. Meditate on this failure and perhaps some day you will defeat me.',NULL,NULL,55,10,10)", +"INSERT INTO " . db_prefix("masters") . " VALUES (6,'Adwares',6,'Dwarven Battle Axe','Ach! Y\\' do hold yer %x with skeel!','Har! Y\\' do be needin moore praktise y\\' wee cub!',NULL,NULL,66,12,12)", +"INSERT INTO " . db_prefix("masters") . " VALUES (7,'Gerrard',7,'Battle Bow','Hmm, mayhaps I underestimated you.','As I thought.',NULL,NULL,77,14,14)", +"INSERT INTO " . db_prefix("masters") . " VALUES (8,'Ceiloth',8,'Orkos Broadsword','Well done %w`&, I can see that great things lie in the future for you!','You are becoming powerful, but not yet that powerful.',NULL,NULL,88,16,16)", +"INSERT INTO " . db_prefix("masters") . " VALUES (9,'Dwiredan',9,'Twin Swords','Perhaps I should have considered your %x...','Perhaps you\\'ll reconsider my twin swords before you try that again?',NULL,NULL,99,18,18)", +"INSERT INTO " . db_prefix("masters") . " VALUES (10,'Sensei Noetha',10,'Martial Arts Skills','Your style was superior, your form greater. I bow to you.','Learn to adapt your style, and you shal prevail.',NULL,NULL,110,20,20)", +"INSERT INTO " . db_prefix("masters") . " VALUES (11,'Celith',11,'Throwing Halos','Wow, how did you dodge all those halos?','Watch out for that last halo, it\\'s coming back this way!',NULL,NULL,121,22,22)", +"INSERT INTO " . db_prefix("masters") . " VALUES (12,'Gadriel the Elven Ranger',12,'Elven Long Bow','I can accept that you defeated me, because after all elves are immortal while you are not, so the victory will be mine.','Do not forget that elves are immortal. Mortals will likely never defeat one of the fey.',NULL,NULL,132,24,24)", +"INSERT INTO " . db_prefix("masters") . " VALUES (13,'Adoawyr',13,'Gargantuan Broad Sword','If I could have picked up this sword, I probably would have done better!','Haha, I couldn\\'t even pick the sword UP and I still won!',NULL,NULL,143,26,26)", +"INSERT INTO " . db_prefix("masters") . " VALUES (14,'Yoresh',14,'Death Touch','Well, you evaded my touch. I salute you!','Watch out for my touch next time!',NULL,NULL,154,28,28)", + +"INSERT INTO " . db_prefix("news") . " VALUES (1,'`^A strange awakening takes place in the world.`0',now(), 0, '', '')", +), +"0.9.1"=>array( +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6Just wait for my revenge, `4%W`6. It will be swift!`5\" %w declares.','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6I\\'m really going to enjoy this new `4%x`6 that %w`6 had,`5\" exclaimed %W.','joe')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6Aah, so `bthat\\'s`b what `4%X`6 is for!`5\" exclaimed %W','joe')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6Oh man! I didn\\'t think you had it in you, `5%W`6,`5\" %w exclaims.','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5%W was overheard saying, \"`6%p `4%x`6 was no match for my `4%X`6!`5\"','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6You know, you really shouldn\\'t have a `4%x`6 unless you know how to use it,`5\" suggested %W.','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6`bARRRGGGGGGG`b!!`5\" %w screams in frustration.','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6How could I be so feeble?`5\" %w laments.','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6I must not be as sturdy as I thought...!`5\" %w concedes.','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6Watch your back, `4%W`6, I am coming for you!`5\" %w warns.','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6This both sucks and blows!`5\" wails %w.','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6I see London, I see France, I see `4%w\\'s`6 underpants!`5\" reveals %W.','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6The Healer\\'s Hut can\\'t help you now, `4%w`6!`5\" chides %W.','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5%W smiles. \"`6You are too slow. You are too weak.`5\"','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5%w bangs %p head against a stone...\"`6Stupid, stupid, stupid!`5\" %o was heard to say.','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6My ego can\\'t take much more of this bruising!`5\" exclaims %w.','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6Why didn\\'t I become a successful doctor like my father suggested?`5\" wonders %w aloud.','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6Maybe `bnext`b time you won\\'t be so cocky!`5\" laughs %W','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6A baby could wield a `4%x `6better than that!`5\" %W proclaims.','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6You should have just stayed in bed,`5\" %W suggests.','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6Well isn\\'t that a kick in the crotch?!`5\" %w observes.','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6Come back when you learn how to fight,`5\" %W scoffs.','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6Next time, eat your Wheaties,`5\" %W suggests.','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5 \"`6You are dishonorable, `4%W`6!`5\" %w cries.','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`4%w`6, your lack of posture is a disgrace,`5\" %W states. ','Bluspring')", +"INSERT INTO " . db_prefix("taunts") . " VALUES (0,'`5\"`6You know, `4%w`6 really had it coming to %s after all those things `bI`b said about `b%p`b mom`5,\" commented %W.','Joe')", + +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Rake',48,1,0)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Trowel',225,2,0)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Spade',585,3,0)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Adze',990,4,0)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Gardening Hoe',1575,5,0)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Torch',2250,6,0)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Pitchfork',2790,7,0)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Shovel',3420,8,0)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Hedge Trimmers',4230,9,0)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Hatchet',5040,10,0)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Carving Knife',5850,11,0)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Rusty Iron Wood-Chopping Axe',6840,12,0)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Dull Steel Wood-chopping Axe',8010,13,0)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Sharp Steel Wood-chopping Axe',9000,14,0)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Woodsman\\'s Axe',10350,15,0)", + +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Fuzzy Slippers',48,1,0)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Flannel Pajamas',225,2,0)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Homespun Longjohns',585,3,0)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Homespun Undershirt',990,4,0)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Knitted Socks',1575,5,0)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Knitted Gloves',2250,6,0)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Old Leather Boots',2790,7,0)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Homespun Pants',3420,8,0)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Homespun Tunic',4230,9,0)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Gypsy Cape',5040,10,0)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Old Leather Cap',5850,11,0)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Old Leather Bracers',6840,12,0)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Traveller\\'s Shield',8010,13,0)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Old Leather Pants',9000,14,0)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Old Leather Tunic',10350,15,0)", + +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Pebbles',48,1,1)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Stones',225,2,1)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Rocks',585,3,1)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Small Treebranch',990,4,1)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Large Treebranch',1575,5,1)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Thickly Padded Sparring Pole',2250,6,1)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Thinly Padded Sparring Pole',2790,7,1)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Wooden Stave',3420,8,1)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Wooden Practice Sword',4230,9,1)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Blunt Bronze Short Sword',5040,10,1)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Well Crafted Bronze Short Sword',5850,11,1)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Rusty Steel Short Sword',6840,12,1)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Dull Steel Short Sword',8010,13,1)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Sharp Steel Short Sword',9000,14,1)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Pages\\'s Short Sword',10350,15,1)", + +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Flip-Flops',48,1,1)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Swimsuit and Towel',225,2,1)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Cotton Undershirt',585,3,1)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Wool Socks',990,4,1)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Wool Gloves',1575,5,1)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Leather Boots',2250,6,1)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Leather Cap',2790,7,1)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Leather Bracers',3420,8,1)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Leather Leggings',4230,9,1)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Leather Tunic',5040,10,1)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Hooded Leather Cape',5850,11,1)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Deerskin Leggings',6840,12,1)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Deerskin Belt',8010,13,1)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Deerskin Tunic',9000,14,1)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Small Rawhide Shield',10350,15,1)", + +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Dull Bronze Sword',48,1,2)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Bronze Sword',225,2,2)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Well Crafted Bronze Sword',585,3,2)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Dull Iron Sword',990,4,2)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Iron Sword',1575,5,2)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Enchanted Sword',9000,14,2)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Well Crafted Iron Sword',2250,6,2)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Rusty Steel Sword',2790,7,2)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Dull Steel Sword',3420,8,2)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Well Crafted Steel Sword',4230,9,2)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Engraved Steel Sword',5040,10,2)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Steel Sword with Jeweled Hilt',5850,11,2)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Golden Hilted Sword',6840,12,2)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Platinum Hilted Sword',8010,13,2)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Adept\\'s Sword',10350,15,2)", + +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Workboots',48,1,2)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Overalls',225,2,2)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Sturdy Leather Gloves',585,3,2)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Sturdy Leather Bracers',990,4,2)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Sturdy Leather Boots',1575,5,2)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Sturdy Leather Helm',2250,6,2)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Sturdy Leather Pants',2790,7,2)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Sturdy Leather Tunic',3420,8,2)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Sturdy Leather Cloak',4230,9,2)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Woodsman\\'s Helm',5040,10,2)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Woodsman\\'s Gauntlets',5850,11,2)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Woodsman\\'s Bracers',6840,12,2)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Woodsman\\'s Greaves',8010,13,2)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Woodsman\\'s Tunic',9000,14,2)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Woodsman\\'s Kite Shield',10350,15,2)", + +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Steel Longsword',48,1,3)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Etched Steel Longsword',585,3,3)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Polished Steel Longsword',225,2,3)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Well Balanced Steel Longsword',990,4,3)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Perfectly Balanced Steel Longsword',1575,5,3)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Engraved Steel Longsword',2250,6,3)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Longsword with Silver-plated Hilt',2790,7,3)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Longsword with Gold-plated Hilt',3420,8,3)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Longsword with Solid Gold Hilt',4230,9,3)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Longsword with Solid Platinum Hilt',5040,10,3)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Moonsilver Longsword',5850,11,3)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Autumngold Longsword',6840,12,3)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Elfsilver Longsword',8010,13,3)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Enchanted Longsword',9000,14,3)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Wolfmaster\\'s Longsword',10350,15,3)", + +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Showercap and Towel',48,1,3)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Bathrobe',225,2,3)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Wolfskin Gloves',585,3,3)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Wolfskin-lined Boots',990,4,3)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Wolfskin Bracers',1575,5,3)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Wolfskin Pants',2250,6,3)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Wolfskin Tunic',2790,7,3)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Hooded Wolfskin Cape',3420,8,3)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Wolfmaster\\'s Bracers',4230,9,3)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Wolfmaster\\'s Gauntlets',5040,10,3)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Wolfmasters Helm',5850,11,3)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Wolfmaster\\'s Leggings',6840,12,3)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Wolfmaster\\'s Belted Jerkin',8010,13,3)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Wolfhide Cape',9000,14,3)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Shield of the Wolf Master',10350,15,3)", + +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Poorly Balanced Bastard Sword',48,1,4)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Tarnished Bastard Sword',225,2,4)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Iron Bastard Sword',585,3,4)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Steel Bastard Sword',990,4,4)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Well Balanced Steel Bastard Sword',1575,5,4)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Perfectly Balanced Bastard Sword',2250,6,4)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Rune-etched Bastard Sword',2790,7,4)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Bronze-inlay Bastard Sword',3420,8,4)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Silver-inlay Bastard Sword',4230,9,4)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Gold-inlay Bastard Sword',5040,10,4)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Nightsilver Bastard Sword',5850,11,4)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Morning-gold Bastard Sword',6840,12,4)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Truesplendor Bastard Sword',8010,13,4)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Enchanted Elfgold Bastard Sword',9000,14,4)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Noble\\'s Bastard Sword',10350,15,4)", + +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Sweat Pants',48,1,4)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Sweat Shirt',225,2,4)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Studded Leather Helm',585,3,4)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Studded Leather Gauntlets',990,4,4)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Hardened Leather Boots',1575,5,4)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Studded Leather Leggings',2250,6,4)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Studded Leather Tunic',2790,7,4)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Tanner\\'s Cape',3420,8,4)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Rusty Chainmail Helm',4230,9,4)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Rusty Chainmail Gauntlets',5040,10,4)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Rusty Chainmail Bracers',5850,11,4)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Rusty Chainmail Boots',6840,12,4)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Rusty Chainmail Greaves',8010,13,4)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Rusty Chainmail Tunic',9000,14,4)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Large Iron Buckler',10350,15,4)", + +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Tarnished Iron Claymore',48,1,5)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Polished Iron Claymore',225,2,5)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Rusty Steel Claymore',585,3,5)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Steel Claymore',990,4,5)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Finely Crafted Steel Claymore',1575,5,5)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Scottish Broadsword',2250,6,5)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Viking War Sword',2790,7,5)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Barbarian\\'s Sword',3420,8,5)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Scottish Basket-Hilt Claymore',4230,9,5)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Agincourt Steel Sword',5040,10,5)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Celtic Combat Sword',5850,11,5)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Norseman\\'s Sword',6840,12,5)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Knight\\'s Sword',8010,13,5)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Heraldic Lion Claymore',9000,14,5)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Dragon Soldier\\'s Claymore',10350,15,5)", + +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Bunny Slippers',48,1,5)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Feety Pajamas',225,2,5)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Comfortable Leather Undergarments',585,3,5)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Heavy Chainmail Helm',990,4,5)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Heavy Chainmail Gauntlets',1575,5,5)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Heavy Chainmail Bracers',2250,6,5)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Heavy Chainmail Boots',2790,7,5)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Heavy Chainmail Greaves',3420,8,5)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Heavy Chainmail Tunic',4230,9,5)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Soldier\\'s Bracers',5040,10,5)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Soldier\\'s Gauntlets',5850,11,5)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Soldier\\'s Boots',6840,12,5)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Soldier\\'s Greaves',8010,13,5)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Soldier\\'s Chestplate',9000,14,5)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Soldier\\'s Shield',10350,15,5)", + +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Two Broken Short Swords',48,1,6)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Two Short Swords',225,2,6)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Iron Scimitars',585,3,6)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Balanced Scimitars',990,4,6)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Tarnished Steel Scimitars',1575,5,6)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Rusty Steel Scimitars',2250,6,6)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Steel Scimitars',2790,7,6)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Bronze Hilted Steel Scimitars',3420,8,6)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Gold Hilted Steel Scimitars',4230,9,6)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Platinum Hilted Steel Scimitars',5040,10,6)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Well Crafted Adamantite Scimitars',5850,11,6)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Perfectly Crafted Adamantite Scimitars',6840,12,6)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Enchanted Scimitars',8010,13,6)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Drow Crafted Scimitars',9000,14,6)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Unicorn Blood-Forged Scimitars',10350,15,6)", + +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Bluejeans',48,1,6)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Flannel Shirt',225,2,6)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Well Crafted Bronze Helm',585,3,6)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Well Crafted Bronze Gauntlets',990,4,6)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Well Crafted Bronze Bracers',1575,5,6)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Well Crafted Bronze Boots',2250,6,6)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Well Crafted Bronze Greaves',2790,7,6)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Well Crafted Bronze Chestplate',3420,8,6)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Enchanted Bronze Helm',4230,9,6)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Enchanted Bronze Gauntlets',5040,10,6)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Enchanted Bronze Bracers',5850,11,6)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Enchanted Bronze Boots',6840,12,6)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Enchanted Bronze Greaves',8010,13,6)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Enchanted Bronze Chestplate',9000,14,6)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Hooded Unicorn Skin Cloak',10350,15,6)", + +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Chipped Iron Axe',48,1,7)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Iron Axe',225,2,7)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Rusty Steel Axe',585,3,7)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Fine Steel Axe',990,4,7)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Lumberjack\\'s Axe',1575,5,7)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Low Quality Battle Axe',2250,6,7)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Medium Quality Battle Axe',2790,7,7)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'High Quality Battle Axe',3420,8,7)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Double Bladed Axe',4230,9,7)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Double Bladed Battle Axe',5040,10,7)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Gold Plated Battle Axe',5850,11,7)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Platinum Hilted Battle Axe',6840,12,7)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Enchanted Battle Axe',8010,13,7)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Dwarf Smith\\'s Battle Axe',9000,14,7)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Dwarf Warrior\\'s Battle Axe',10350,15,7)", + +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Barrel',48,1,7)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Lampshade',225,2,7)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Perfectly Crafted Steel Helm',585,3,7)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Perfectly Crafted Steel Gauntlets',990,4,7)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Perfectly Crafted Steel Boots',1575,5,7)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Perfectly Crafted Steel Bracers',2250,6,7)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Perfectly Crafted Steel Greaves',2790,7,7)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Perfectly Crafted Steel Chestplate',3420,8,7)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Griffon-Feather Cloak',4230,9,7)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dwarven Chainmail Helm',5040,10,7)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dwarven Chainmail Gauntlets',5850,11,7)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dwarven Chainmail Boots',6840,12,7)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dwarven Chainmail Bracers',8010,13,7)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dwarven Chainmail Greaves',9000,14,7)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dwarven Chainmail Chestplate',10350,15,7)", + +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Broken Iron Mace',48,1,8)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Tarnished Iron Mace',225,2,8)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Polished Iron Mace',585,3,8)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Well Crafted Iron Mace',990,4,8)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Polished Steel Mace',1575,5,8)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Well Crafted Steel Mace',2250,6,8)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Poorly Balanced Double Mace',2790,7,8)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Well Balanced Double Mace',3420,8,8)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Battle Mace',4230,9,8)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'War Chieftain\\'s Battle Mace',5040,10,8)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'War Chieftain\\'s Morning Star',5850,11,8)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Adamantite Morning Star',6840,12,8)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Dwarf Crafted Morning Star',8010,13,8)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Dwarf Warlord\\'s Morning Star',9000,14,8)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Enchanted Morning Star',10350,15,8)", + +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Fig Leaf',48,1,8)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Kilt',225,2,8)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Majestic Gold Helm',585,3,8)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Majestic Gold Gauntlets',990,4,8)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Majestic Gold Boots',1575,5,8)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Bracers',2250,6,8)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Majestic Gold Greaves',2790,7,8)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Majestic Gold Chestplate',3420,8,8)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Majestic Gold Shield',4230,9,8)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Gold-Threaded Cloak',5040,10,8)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Enchanted Ruby Ring',5850,11,8)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Enchanted Sapphire Ring',6840,12,8)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Enchanted Jade Ring',8010,13,8)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Enchanted Amethyst Ring',9000,14,8)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Enchanted Diamond Ring',10350,15,8)", + +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Boot Knife',48,1,9)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Target Knife',225,2,9)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Blackjack',585,3,9)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Throwing Star',990,4,9)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Hira-Shuriken',1575,5,9)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Throwing Spike',2250,6,9)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Atlatl',2790,7,9)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Qilamitautit Bolo',3420,8,9)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'War Quoait',4230,9,9)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Cha Kran',5040,10,9)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Fei Piau',5850,11,9)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Jen Piau',6840,12,9)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Gau dim Piau',8010,13,9)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Enchanted Throwing Axe',9000,14,9)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Teksolo\\'s Ninja Stars',10350,15,9)", + +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Button',48,1,9)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Elven Silk Nightclothes',225,2,9)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Elven Silk Gloves',585,3,9)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Elven Silk Slippers',990,4,9)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Elven Silk Wristband',1575,5,9)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Leggings',2250,6,9)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Elven Silk Tunic',2790,7,9)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Elven Silk Cloak',3420,8,9)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Ring of Night',4230,9,9)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Ring of Day',5040,10,9)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Ring of Solitude',5850,11,9)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Ring of Peace',6840,12,9)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Ring of Courage',8010,13,9)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Ring of Virtue',9000,14,9)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Ring of Life',10350,15,9)", + +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Farmer\\'s Bow & Wooden Arrows',48,1,10)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Farmer\\'s Bow & Stone Tipped Arrows',225,2,10)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Farmer\\'s Bow & Steel Tipped Arrows',585,3,10)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Hunter\\'s Bow & Wooden Arrows',990,4,10)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Hunter\\'s Bow & Stone Tipped Arrows',1575,5,10)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Hunter\\'s Bow & Steel Tipped Arrows',2250,6,10)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Ranger\\'s Bow & Wooden Arrows',2790,7,10)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Ranger\\'s Bow & Stone Tipped Arrows',3420,8,10)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Ranger\\'s Bow & Steel Tipped Arrows',4230,9,10)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Longbow',5040,10,10)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Crossbow',5850,11,10)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Elvish Longbow',6840,12,10)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Elvish Longbow & Flame Tipped Arrows',8010,13,10)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Elvish Longbow & Enchanted Arrows',9000,14,10)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Longbow of the Elf King',10350,15,10)", + +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Pegasus\\' Hooded Cloak',5040,10,10)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Pegasus\\' Chestplate',4230,9,10)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Pegasus\\' Greaves',3420,8,10)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Pegasus\\' Boots',2790,7,10)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Pegasus\\' Gorget',2250,6,10)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Pegasus\\' Bracers',1575,5,10)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Pegasus\\' Gauntlets',990,4,10)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Pegasus\\' Helm',585,3,10)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Platform Shoes',225,2,10)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Leisure Suit',48,1,10)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Pegasus Feather Pendant',5850,11,10)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Pegasus Feather Belt',6840,12,10)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Pegasus\\' Emblazoned Shield',8010,13,10)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Pegasus\\' Emblazoned Ring',9000,14,10)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Pegasus\\' Emblazoned Crown',10350,15,10)", + +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'MightyE\\'s Long Sword',225,2,11)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'MightyE\\'s Short Sword',48,1,11)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'MightyE\\'s Bastard Sword',585,3,11)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'MightyE\\'s Scimitars',990,4,11)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'MightyE\\'s Battle Axe',1575,5,11)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'MightyE\\'s Throwing Hammer',2250,6,11)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'MightyE\\'s Morning Star',2790,7,11)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'MightyE\\'s Compound Bow',3420,8,11)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'MightyE\\'s Rapier',4230,9,11)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'MightyE\\'s Sabre',5040,10,11)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'MightyE\\'s Light Sabre',5850,11,11)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'MightyE\\'s Wakizashi',6840,12,11)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'MightyE\\'s 2-Handed War Sword',8010,13,11)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'MightyE\\'s 2-handed War Axe',9000,14,11)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'MightyE\\'s Claymore',10350,15,11)", + +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'New Clothes',48,1,11)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Chicken Suit',225,2,11)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Gauntlets of Grace',585,3,11)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Bracer of Beauty',990,4,11)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Helm of Health',1575,5,11)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Greaves of Good Fortune',2250,6,11)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Boots of Bravery',2790,7,11)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Tunic of Tolerance',3420,8,11)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Cloak of Confidence',4230,9,11)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Ring of Righteousness',5040,10,11)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Necklace of Narcissism',5850,11,11)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Pendant of Power',6840,12,11)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Breastplate of Benevolence',8010,13,11)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Shield of Superiority',9000,14,11)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Scepter of Strength',10350,15,11)", + +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Spell of Fire',48,1,12)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Spell of Earthquake',225,2,12)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Spell of Flood',585,3,12)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Spell of Hurricane',990,4,12)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Spell of Mind Control',1575,5,12)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Spell of Lightning',2250,6,12)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Spell of Weakness',2790,7,12)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Spell of Fear',3420,8,12)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Spell of Poison',4230,9,12)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Spell of Spirit Possession',5040,10,12)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Spell of Despair',5850,11,12)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Spell of Bat Summoning',6840,12,12)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Spell of Wolf Summoning',8010,13,12)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Spell of Unicorn Summoning',9000,14,12)", +"INSERT INTO " . db_prefix("weapons") . " VALUES (0,'Spell of Dragon Summoning',10350,15,12)", + +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Skin Leather Helm',48,1,12)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Skin Leather Gauntlets',225,2,12)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Skin Leather Boots',585,3,12)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Skin Leather Bracers',990,4,12)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Skin Leather Leggings',1575,5,12)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Skin Leather Tunic',2250,6,12)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Skin Leather Cloak',2790,7,12)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Scale Helm',3420,8,12)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Scale Gauntlets',4230,9,12)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Scale Boots',5040,10,12)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Scale Bracers',5850,11,12)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Scale Greaves',6840,12,12)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Scale Chestplate',8010,13,12)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Scale Cloak',9000,14,12)", +"INSERT INTO " . db_prefix("armor") . " VALUES (0,'Dragon Talon Shield',10350,15,12)", +), +"0.9.2"=>array( +), +"0.9.3"=>array(), +"0.9.4"=>array(), +"0.9.5"=>array(), +"0.9.6"=>array( +), +"0.9.7"=>array( +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (220, 'Frenzied vampire bats', 15, 'Numerous attacks', 'Why are there so many darn bats in this forest?', NULL, 531, 189, 155, 29, 21, NULL, 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (221, 'Vampirus,the Bat God', 16, 'Godly Power', 'You are even more god-like then he!', '', 563, 207, 166, 31, 22, '', 'Appleshiner', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (222, 'Old Man Winter', 9, 'Bitter Cold', 'You shake your fist over his dead, pathetic corpse.', NULL, 336, 101, 94, 17, 13, NULL, NULL, 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (223, 'Deranged Gnome', 1, 'A Cloth Draped Mirror', 'What happens when I do THIS?', NULL, 36, 14, 10, 1, 1, NULL, NULL, 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (224, 'Water Sprite', 1, 'Burst of Water', 'That was refreshing.', NULL, 36, 14, 10, 1, 1, NULL, NULL, 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (225, 'Water Nymph', 3, 'A torrent of water', 'I didn''t need a bath, thank you.', NULL, 148, 34, 32, 5, 4, NULL, NULL, 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (226, 'Lady of the Lake', 10, 'Excalibur', 'Take that, you watery tart!', NULL, 369, 114, 105, 19, 14, NULL, NULL, 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (227, 'Cunning Sapling', 1, 'Arrrr!', 'Ah Ha! A toothpick!', NULL, 36, 14, 10, 1, 1, NULL, NULL, 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (228, 'Pirate Tree', 5, 'A loud ARRRRR!', 'Arrrrrr! indeed.', NULL, 198, 55, 53, 9, 7, NULL, NULL, 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (229, 'Undead Centurion', 5, 'Bronze Spear', 'Hmm Not too good at combat the second time around, either.', NULL, 198, 55, 53, 9, 7, NULL, NULL, 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (230, 'Insane Bard', 2, 'Iambic Pentameter', 'Slings and Arrows of outrageous fortune? Nope. Just the can o'' Whoopass.', NULL, 97, 24, 21, 3, 3, NULL, NULL, 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (231, 'Twig Man', 1, 'Brambles and Briars', 'I snapped him like a.. well, twig.', NULL, 36, 14, 10, 1, 1, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (232, 'Rabid Mouse', 1, 'Little Bitty Teeth', 'Those little teeth HURT!', NULL, 36, 14, 10, 1, 1, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (233, 'Stray Cat', 1, 'A Midnight Serenade', 'Finally! Peace in the night!', NULL, 36, 14, 10, 1, 1, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (234, 'Big Hairy Spider', 1, 'Sticky stringy webs', 'I *HATE* spiders!', NULL, 36, 14, 10, 1, 1, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (235, 'Goblin Lackey', 1, 'Dull Knife', 'Who knew goblins had lackeys?', NULL, 36, 14, 10, 1, 1, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (236, 'Crazy Chihuahua', 1, 'Fast food cravings', 'Here taco, taco, taco.', '', 36, 14, 10, 1, 1, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (237, 'Looney Rabbit', 1, 'Wisecracks', 'Th- Th- That''s all folks!', NULL, 36, 14, 10, 1, 1, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (238, 'Undead Oarsman', 1, 'Rotten Oar', 'Funny... I didn''t see any water around here.', '', 36, 14, 10, 1, 1, '', 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (239, 'Lost Ghostling', 2, 'Sad Weeping', 'Well, I''m sure that helped him on his way...', '', 97, 24, 21, 3, 3, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (240, 'Angry Titmouse', 2, 'Incessant Chattering', 'You swat the little bird out of the air with little effort.', '', 97, 24, 21, 3, 3, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (241, 'Fabianist Youth Member', 2, 'Marxist Doctrine', 'Socialize THAT.', NULL, 97, 24, 21, 3, 3, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (242, 'Little Bogeyman', 2, 'Noises in the Dark', 'Hmm, not so scary when you have grown up...', '', 97, 24, 21, 3, 3, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (243, 'Big Bogeyman', 3, 'Fingers poking you as you sleep.', 'Ok... that was weird. But not scary... Nope not at all... I think I''ll leave the light on at the inn tonight though.', '', 148, 34, 32, 5, 4, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (244, 'Coblynau', 2, 'Ill tempered tricks', 'Maybe I better leave him part of my lunch next time.', '', 97, 24, 21, 3, 3, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (245, 'Jack O''Lantern', 2, 'Eternal Wandering', 'The light has gone out of his life.', NULL, 97, 24, 21, 3, 3, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (246, 'Fresh Ghoul', 2, 'Long Pointed Nails', 'You leave him to the mercies of the other ghouls.', '', 97, 24, 21, 3, 3, '', 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (247, 'Dry Skeleton', 2, 'a Rusty Dagger', 'The skeleton crumbles into a pile of dust.', NULL, 97, 24, 21, 3, 3, NULL, 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (248, 'Newly Dead Zombie', 2, 'Fists', 'Maybe now it can rest in peace.', NULL, 97, 24, 21, 3, 3, NULL, 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (249, 'Faerie hound', 2, 'Glowing Eyes', 'The embers in the eye sockets dim and sputter out.', NULL, 97, 24, 21, 3, 3, NULL, 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (250, 'Apprentice Necromancer', 3, 'Life Draining Spells', 'He gasps a final breath and melts into a tarry liquid.', NULL, 148, 34, 32, 5, 4, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (251, 'Doppleganger', 3, 'Shape changing', 'You kill the doppleganger and he returns to his true form.', NULL, 148, 34, 32, 5, 4, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (252, 'Forest Thief', 3, 'Poisoned Short Sword', 'His pockets were almost empty. I guess he wasn''t much of a thief.', '', 148, 34, 32, 5, 4, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (253, 'Mouldy Skeleton', 3, 'Rotten Fists', 'Heeeeey, didn''t you see him in town last week?', NULL, 148, 34, 32, 5, 4, NULL, 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (254, 'Angry Fairy', 3, 'Furious Fairy Dust', 'He disappears in a cloud of fairy dust.', NULL, 148, 34, 32, 5, 4, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (255, 'Goblin Hunter', 3, 'a Shortbow', 'Only one? Don''t they usually travel in packs?', NULL, 148, 34, 32, 5, 4, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (256, 'Bobcat Cub', 3, 'Sharp Claws', 'Even the cute fuzzy kittens are evil in this place.', NULL, 148, 34, 32, 5, 4, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (257, 'Animate Junkheap', 3, 'Stench of 1000 rotten potatoes', 'Just call you the De-Animator!', NULL, 148, 34, 32, 5, 4, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (258, 'Necromancer', 4, 'Strength Draining Touch', 'In a cloud of black smoke, his body wafts away on the breeze.', '', 162, 45, 43, 7, 6, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (259, 'Reed Golem', 4, 'Fists of Thorns', 'The only thing left was a tiny bale of hay.', NULL, 162, 45, 43, 7, 6, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (260, 'Goblin Shaman', 4, 'Primitive Magic', '\"Oooga Booga,\" indeed.', NULL, 162, 45, 43, 7, 6, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (261, 'Steam Spirit', 4, 'Scalding Steam', 'Not so hot now, eh?', NULL, 162, 45, 43, 7, 6, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (262, 'Restless Zombie', 4, 'Broken Longsword', 'Finally he is at peace.', NULL, 162, 45, 43, 7, 6, NULL, 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (263, 'Zombie Soldier', 4, 'Rusted Spear', 'His final orders were to march to hell.', '', 162, 45, 43, 7, 6, '', 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (264, 'Dark Imp', 4, 'Nagging Doubts', 'The imp implodes in a ball of flame.', NULL, 162, 45, 43, 7, 6, NULL, 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (265, 'Giant Spider', 4, 'Fangs that glisten with poison', 'I really, really hate spiders.', '', 162, 45, 43, 7, 6, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (266, 'Undead Kitten', 4, 'Mews of Doom', 'Another evil cat sent to hell C.O.D.', NULL, 162, 45, 43, 7, 6, NULL, 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (267, 'Flying Dagger', 4, 'Sharpened Steel Point', 'The dagger shatters when it hits the ground.', NULL, 162, 45, 43, 7, 6, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (268, 'Goblin Warrior', 5, 'Bent Short Sword', 'Gone... and forgotten.', '', 198, 55, 53, 9, 7, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (269, 'Experienced Necromancer', 5, 'a small group of Zombies', 'The necromancer turns into a pile of black sand and blows away.', NULL, 198, 55, 53, 9, 7, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (270, 'Flame Sprite', 5, 'Searing Flame', 'You cooled him off in a hurry...', NULL, 198, 55, 53, 9, 7, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (271, 'Mud Man', 5, 'Enchanted Mud', 'Defeated, the Mud Man dries up in the warm sun.', NULL, 198, 55, 53, 9, 7, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (272, 'Lupe the Hypnotic Chihuahua', 5, 'The stare of doom', 'You manage to break free of those deep hypnotic eyes...', NULL, 198, 55, 53, 9, 7, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (273, 'Ghoul', 5, 'Hunger for Flesh', 'The ghoul falls to the ground, a bit of flesh between his teeth.', NULL, 198, 55, 53, 9, 7, NULL, 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (274, 'Seedy Cutthroat', 5, 'Sharpened Daggers', 'One more bandit removed from this forest.', NULL, 198, 55, 53, 9, 7, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (275, 'Ogre', 5, 'Broken treebranch', 'Boy, thats a face not even a mother could love.', NULL, 198, 55, 53, 9, 7, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (276, 'Crazy Woodsman', 5, 'Dull axe', 'Chopped him down to size...', NULL, 198, 55, 53, 9, 7, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (277, 'Flying Drakeling', 5, 'a Lashing Tail', 'You swat the small, majestic beast out of the air.', NULL, 198, 55, 53, 9, 7, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (278, 'Forest Cat', 6, 'Menacing Claws', 'Here kitty, kitty, kitty.', '', 234, 66, 64, 11, 8, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (279, 'Journeyman Necromancer', 6, 'An Undead Giant', 'The necromancer drifts away on a cloud of black smoke.', '', 234, 66, 64, 11, 8, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (280, 'Frigid Skeleton', 6, 'The Cold of the Grave', 'I''ll bet one of these guys could cool ale at the inn.', '', 234, 66, 64, 11, 8, '', 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (281, 'Frost Spirit', 6, 'Bone Chilling Cold', 'Puttin down another cold one.', '', 234, 66, 64, 11, 8, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (282, 'Dragon Slayer''s ghost', 6, 'Warnings of Doom', 'Everybody wondered what happened to him.', NULL, 234, 66, 64, 11, 8, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (283, 'Ettin Mage', 6, 'Double threat spells', 'Two heads are not better than one in this case. Just more to lop off.', '', 234, 66, 64, 11, 8, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (284, 'Insane Brownie', 6, 'Faerie spells', 'This one''s nuts!', NULL, 234, 66, 64, 11, 8, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (285, 'Ghostly Wolfpack', 6, 'Ghostly Howls', 'Quiet settles in around you. Finally.', NULL, 234, 66, 64, 11, 8, NULL, 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (286, 'Wood Golem', 6, 'Oaken Fists', 'The truth gave you life and the truth set you free.', '', 234, 66, 64, 11, 8, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (287, 'Diseased Ent', 6, 'Twisted Branches', 'There must be fifty ways to cut your lumber. (Groan)', '', 234, 66, 64, 11, 8, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (288, 'Dark Druid', 7, 'Corrupted Nature', 'He lost me at the corrupt it to save it part.', NULL, 268, 77, 74, 13, 10, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (289, 'Lizard Man Scout', 7, 'Marginal Archery', 'I know where I can get him made into a nice pair of boots.', '', 268, 77, 74, 13, 10, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (290, 'Diabolic Footman', 7, 'A Demon Forged Mace', 'His armor sizzles and he melts as he crumples to the ground.', NULL, 268, 77, 74, 13, 10, NULL, 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (291, 'Gargantuan Tree Spider', 7, 'Projectile Webbing', 'After you lop him in half, you realize he''s not so big.', NULL, 268, 77, 74, 13, 10, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (292, 'Flaming Zombie', 7, 'Fists covered in Flame', 'You extinguish the flame of life and the zombie falls to the ground, smoking.', NULL, 268, 77, 74, 13, 10, NULL, 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (293, 'Eldritch Wizard', 7, 'Spells of Darkness', 'You slice him in two only to watch his body disappear, leaving an empty robe behind.', NULL, 268, 77, 74, 13, 10, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (294, 'Master Necromancer', 7, 'An Army of the Dead', 'You kill the necromancer and his minions disintegrate before your eyes.', NULL, 268, 77, 74, 13, 10, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (295, 'Animate Darkness', 7, 'The Darkness of a Thousand Nights', 'Light Slowly returns to this part of the forest.', '', 268, 77, 74, 13, 10, '', 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (296, 'Temple Guardian Statue', 7, 'Marble Fists', 'So, where''s the temple?', NULL, 268, 77, 74, 13, 10, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (297, 'Owlbear', 7, 'Claws and a bearhug', 'I don''t even want to know how they breed these.', '', 268, 77, 74, 13, 10, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (298, 'The Man In Black', 8, 'Necromantic Spells', 'Finally, I got my chance to kill him.', '', 302, 89, 84, 15, 11, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (299, 'Gnome Illusionist', 8, 'Fearsome Illusions', 'It was all in his head.', '', 302, 89, 84, 15, 11, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (300, 'Demon Skeleton', 8, 'Diabolic Runes', 'The spirits of its victims drag the skeleton back to hell.', '', 302, 89, 84, 15, 11, '', 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (301, 'Insane Master Druid', 8, 'The land Itself', 'His evil laughter dies with him.', NULL, 302, 89, 84, 15, 11, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (302, 'Water Elementalist', 8, 'Water Based Spells', 'He''s all wet.', NULL, 302, 89, 84, 15, 11, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (303, 'Earth Elementalist', 8, 'Earth Based Spells', 'He fought kind of Dirty.', '', 302, 89, 84, 15, 11, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (304, 'Ettin Warrior', 8, 'Two Clubs of Iron', 'They did all right until they hit each other.', NULL, 302, 89, 84, 15, 11, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (305, 'Forest Giant', 8, 'An Uprooted Tree', 'Ho, Ho, Ho that, green man.', NULL, 302, 89, 84, 15, 11, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (306, 'Demoniac Knight', 8, 'A Diabolic Lance', 'Good night, Sir Knight.', '', 302, 89, 84, 15, 11, '', 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (307, 'Giant Zombie', 8, 'Gigantic Fists', 'They DO smell worse when they are bigger!', NULL, 302, 89, 84, 15, 11, NULL, 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (308, 'Frost Spectre', 9, 'The Chill Touch of the Grave', 'As you recover from the fight, the Spectre melts away into the shadows.', NULL, 336, 101, 94, 17, 13, NULL, 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (309, 'Small Forest Dragon', 9, 'Snapping Jaws', 'Dragon? Check. Green? Check. Huge? Nope.', '', 336, 101, 94, 17, 13, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (310, 'A Pack of Carnivorous Lemurs', 9, 'Hoots and Howls', 'What the heck is a Lemur??', NULL, 336, 101, 94, 17, 13, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (311, 'Albino Crypt Bear', 9, 'Foul Stench and Claws', 'You dispatch the bear and wonder if there are more lurking about.', NULL, 336, 101, 94, 17, 13, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (312, 'Black Knight of The Vale', 9, 'Ebony Sword', 'As he dies, he curses you and tells you that you will never defeat the dragon.', NULL, 336, 101, 94, 17, 13, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (313, 'Elmearian Spy', 9, 'Small Dagger', 'He eats his information before he dies, so you learn nothing from him.', NULL, 336, 101, 94, 17, 13, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (314, 'Stalking Shadow', 9, 'Fingers of Darkness', 'You send the ceature back to where it came from.', NULL, 336, 101, 94, 17, 13, NULL, 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (315, 'Necromantic Archmagus', 9, 'Screams of a Thousand Souls', 'With his dying breath he explodes into a pillar of black flame!', NULL, 336, 101, 94, 17, 13, NULL, 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (316, 'Iron Golem', 9, 'Rusted Fists', 'The golem seizes up and you push him over.', '', 336, 101, 94, 17, 13, '', 'Hank', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (317, 'A Hell Hound', 9, 'Fiery Breath', 'He bursts into flames and is sucked into the earth.', NULL, 336, 101, 94, 17, 13, NULL, 'Hank', 1, 1, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (318, 'Corporate Lackey', 7, 'Buzzwords', 'Well, you sure reprioritized his downsizing.', NULL, 268, 77, 74, 13, 10, NULL, 'Moonchilde', 1, 0, NULL)", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields VALUES (319, 'SCO Lawyer', 8, 'Court Papers', 'There''s one lawyer who''ll never trouble you again!', NULL, 302, 89, 84, 15, 11, NULL, 'Moonchilde', 1, 1, NULL)", +'INSERT INTO ' . db_prefix("nastywords") . ' VALUES ("*damn* *dyke *fuck* *nigger* *phuck* *shit* amcik andskota arschloch arse* ass asshole atouche ayir bastard bitch* boiolas bollock* buceta butt* butt-pirate cabron cawk cazzo chink chraa chuj cipa clit cock* cum cunt* dago daygo dego dick* dike dildo dirsa dupa dziwka ejaculate ejackulate ekrem* ekto enculer faen fag* fanculo fanny fatass fcuk feces feg felcher ficken fitta fitte flikker foreskin phuck fuk* fut futkretzn fuxor gay gook guiena hell helvete hoer* honkey honky hor hore huevon hui injun jism jizz kanker* kawk kike klootzak knulle kraut kuk kuksuger kurac kurwa kusi* kyrp�* leitch lesbian lesbo mamhoon masturbat* merd merde mibun monkleigh mouliewop muie mulkku muschi nazis nepesaurio nigga* nigger nutsack orospu paska* pendejo penis perse phuck picka pierdol* pillu* pimmel pimpis piss* pizda poontsee poop porn preteen preud prick pron pula pule pusse pussy puta puto qahbeh queef* queer* qweef rautenberg schaffer scheiss* scheisse schlampe schmuck screw scrotum sharmuta sharmute shemale shipal shiz skribz skurwysyn slut smut sphencter shpincter spic spierdalaj splooge suka teets teez testicle tits titties titty twat twaty vittu votze wank* wetback* whoar whore wichser woose wop yed zabourah", "nasty")', +"INSERT INTO " . db_prefix("mounts") . " VALUES (1, 'Pony', 'This docile beast is young yet.', 'Horses', 'a:5:{s:4:\"name\";s:13:\"`&Pony Attack\";s:8:\"roundmsg\";s:26:\"Your pony fights with you!\";s:6:\"rounds\";s:2:\"20\";s:6:\"atkmod\";s:3:\"1.2\";s:8:\"activate\";s:7:\"offense\";}', 6, 0, 1, 1, 'You strap your {weapon} to your pony\\'s saddle bags, and head out for some adventure!', '`&Remembering that is has been quite some time since you last fed your pony, you decide this is a perfect time to relax and allow it to graze the field a bit. You doze off enjoying this peaceful serenity.`0', '`&You dismount in the field to allow your pony to graze for a moment even though it has recently been fully fed. As you lean back in the grass to watch the clouds, your pony whickers softly and trots off into the underbrush. You search for a while before returning to the fields hoping that it\\'ll return. A short time later, your pony trots back into the clearing holding its head high, looking much more energized and with a very equine grin on its face.`0', 20, 'all', 0)", +"INSERT INTO " . db_prefix("mounts") . " VALUES (2, 'Gelding', 'This powerful beast is fiercely loyal.', 'Horses', 'a:5:{s:4:\"name\";s:16:\"`&Gelding Attack\";s:8:\"roundmsg\";s:29:\"Your gelding fights with you!\";s:6:\"rounds\";s:2:\"40\";s:6:\"atkmod\";s:3:\"1.2\";s:8:\"activate\";s:7:\"offense\";}', 10, 0, 1, 2, 'You strap your {weapon} to your gelding\\'s saddle bags, and head out for some adventure!', '`&Remembering that is has been quite some time since you last fed your gelding, you decide this is a perfect time to relax and allow it to graze the field a bit. You doze off enjoying this peaceful serenity.`0', '`&You dismount in the field to allow your gelding to graze for a moment even though it has recently been fully fed. As you lean back in the grass to watch the clouds, your gelding whickers softly and trots off into the underbrush. You search for a while before returning to the fields hoping that it\\'ll return. A short time later, your gelding trots back into the clearing holding its head high, looking much more energized and with a very equine grin on its face.`n`nAnd here you thought geldings weren\\'t equipped that way any longer!`0', 25, 'all', 0)", +"INSERT INTO " . db_prefix("mounts") . " VALUES (3, 'Stallion', 'This noble beast is huge and powerful!', 'Horses', 'a:5:{s:4:\"name\";s:17:\"`&Stallion Attack\";s:8:\"roundmsg\";s:30:\"Your stallion fights with you!\";s:6:\"rounds\";s:2:\"60\";s:6:\"atkmod\";s:3:\"1.2\";s:8:\"activate\";s:7:\"offense\";}', 16, 0, 1, 3, 'You strap your {weapon} to your stallion\\'s saddle bags, and head out for some adventure!', '`&Remembering that is has been quite some time since you last fed your stallion, you decide this is a perfect time to relax and allow it to graze the field a bit. You doze off enjoying this peaceful serenity.`0', '`&You dismount in the field to allow your stallion to graze for a moment even though it has recently been fully fed. As you lean back in the grass to watch the clouds, your stallion whickers softly and trots off into the underbrush. You search for a while before returning to the fields hoping that it\\'ll return. A short time later, your stallion trots back into the clearing holding its head high, looking much more energized and with a very equine grin on its face.`0', 30, 'all', 0)", +), +"0.9.8-prerelease.1"=>array( +"UPDATE " . db_prefix("petitions") . " SET closedate = date WHERE status=2", +"UPDATE " . db_prefix("masters") . " SET creaturewin='Learn to adapt your style, and you shall prevail.' WHERE creaturename='Sensei Noetha'", +"UPDATE " . db_prefix("logdnet") . " SET lastping=lastupdate", +"UPDATE " . db_prefix("accounts") . " SET attack=attack-1,race=\"Troll\" WHERE race='1'", +"UPDATE " . db_prefix("accounts") . " SET defense=defense-1,race=\"Elf\" WHERE race='2'", +"UPDATE " . db_prefix("accounts") . " SET race=\"Human\" WHERE race='3'", +"UPDATE " . db_prefix("accounts") . " SET race=\"Dwarf\" WHERE race='4'", +"UPDATE " . db_prefix("accounts") . " SET race=\"Horrible Gelatinous Blob\" WHERE race='0'", +"UPDATE " . db_prefix("accounts") . " SET location=\"The Boar's Head Inn\" WHERE location='1'", +"UPDATE " . db_prefix("accounts") . " SET location=\"Degolburg\" WHERE location='0'", +"UPDATE " . db_prefix("accounts") . " SET password=md5(password) WHERE length(password) < 32", +"UPDATE " . db_prefix("accounts") . " SET password=md5(password)", +"UPDATE " . db_prefix("nastywords") . " SET type='nasty'", +), +"0.9.8-prerelease.2"=>array(), +"0.9.8-prerelease.3"=>array(), +"0.9.8-prerelease.4"=>array(), +"0.9.8-prerelease.5"=>array(), +"0.9.8-prerelease.6"=>array( +"REPLACE INTO " . db_prefix("masters") . " VALUES (1,'Mireraband',1,'Small Dagger','Well done %w`&, I should have guessed you\\'d grown some.','As I thought, %w`^, your skills are no match for my own!',NULL,NULL,12,2,2)", +"REPLACE INTO " . db_prefix("masters") . " VALUES (2,'Fie',2,'Short Sword','Well done %w`&, you really know how to use your %x.','You should have known you were no match for my %X',NULL,NULL,22,4,4)", +"REPLACE INTO " . db_prefix("masters") . " VALUES (4,'Guth',4,'Spiked Club','Ha! Hahaha, excellent fight %w`&! Haven\\'t had a battle like that since I was in the RAF!','Back in the RAF, we\\'d have eaten the likes of you alive! Go work on your skills some old boy!',NULL,NULL,44,8,8)", +"REPLACE INTO " . db_prefix("masters") . " VALUES (6,'Adwares',6,'Dwarven Battle Axe','Ach! Y\\' do hold yer %x with skeel!','Har! Y\\' do be needin moore praktise y\\' wee cub!',NULL,NULL,66,12,12)", +"REPLACE INTO " . db_prefix("masters") . " VALUES (8,'Ceiloth',8,'Orkos Broadsword','Well done %w`&, I can see that great things lie in the future for you!','You are becoming powerful, but not yet that powerful.',NULL,NULL,88,16,16)", +"REPLACE INTO " . db_prefix("masters") . " VALUES (9,'Dwiredan',9,'Twin Swords','Perhaps I should have considered your %x...','Perhaps you\\'ll reconsider my twin swords before you try that again?',NULL,NULL,99,18,18)", +), +"0.9.8-prerelease.7"=>array(), +"0.9.8-prerelease.8"=>array(), +"0.9.8-prerelease.9"=>array(), +"0.9.8-prerelease.10"=>array(), +"0.9.8-prerelease.11"=>array( +"UPDATE " . db_prefix("accounts") . " SET specialty='' WHERE specialty='0'", +), +"0.9.8-prerelease.12"=>array( +"1|UPDATE " . db_prefix("creatures") . " SET forest=1", +"1|UPDATE " . db_prefix("creatures") . " SET graveyard=1 where location=1", +), +"0.9.8-prerelease.13"=>array(), +"0.9.8-prerelease.14"=>array(), +"0.9.8-prerelease.14a"=>array( +"INSERT INTO " . db_prefix("titles") . " VALUES (1, 0, '', 'Farmboy', 'Farmgirl')", +"INSERT INTO " . db_prefix("titles") . " VALUES (2, 1, '', 'Page', 'Page')", +"INSERT INTO " . db_prefix("titles") . " VALUES (3, 2, '', 'Squire', 'Squire')", +"INSERT INTO " . db_prefix("titles") . " VALUES (4, 3, '', 'Gladiator', 'Gladiatrix')", +"INSERT INTO " . db_prefix("titles") . " VALUES (5, 4, '', 'Legionnaire', 'Legioness')", +"INSERT INTO " . db_prefix("titles") . " VALUES (6, 5, '', 'Centurion', 'Centurioness')", +"INSERT INTO " . db_prefix("titles") . " VALUES (7, 6, '', 'Sir', 'Madam')", +"INSERT INTO " . db_prefix("titles") . " VALUES (8, 7, '', 'Reeve', 'Reeve')", +"INSERT INTO " . db_prefix("titles") . " VALUES (9, 8, '', 'Steward', 'Steward')", +"INSERT INTO " . db_prefix("titles") . " VALUES (10, 9, '', 'Mayor', 'Mayoress')", +"INSERT INTO " . db_prefix("titles") . " VALUES (11, 10, '', 'Baron', 'Baroness')", +"INSERT INTO " . db_prefix("titles") . " VALUES (12, 11, '', 'Count', 'Countess')", +"INSERT INTO " . db_prefix("titles") . " VALUES (13, 12, '', 'Viscount', 'Viscountess')", +"INSERT INTO " . db_prefix("titles") . " VALUES (14, 13, '', 'Marquis', 'Marchioness')", +"INSERT INTO " . db_prefix("titles") . " VALUES (15, 14, '', 'Chancellor', 'Chancelloress')", +"INSERT INTO " . db_prefix("titles") . " VALUES (16, 15, '', 'Prince', 'Princess')", +"INSERT INTO " . db_prefix("titles") . " VALUES (17, 16, '', 'King', 'Queen')", +"INSERT INTO " . db_prefix("titles") . " VALUES (18, 17, '', 'Emperor', 'Empress')", +"INSERT INTO " . db_prefix("titles") . " VALUES (19, 18, '', 'Angel', 'Angel')", +"INSERT INTO " . db_prefix("titles") . " VALUES (20, 19, '', 'Archangel', 'Archangel')", +"INSERT INTO " . db_prefix("titles") . " VALUES (21, 20, '', 'Principality', 'Principality')", +"INSERT INTO " . db_prefix("titles") . " VALUES (22, 21, '', 'Power', 'Power')", +"INSERT INTO " . db_prefix("titles") . " VALUES (23, 22, '', 'Virtue', 'Virtue')", +"INSERT INTO " . db_prefix("titles") . " VALUES (24, 23, '', 'Dominion', 'Dominion')", +"INSERT INTO " . db_prefix("titles") . " VALUES (25, 24, '', 'Throne', 'Throne')", +"INSERT INTO " . db_prefix("titles") . " VALUES (26, 25, '', 'Cherub', 'Cherub')", +"INSERT INTO " . db_prefix("titles") . " VALUES (27, 26, '', 'Seraph', 'Seraph')", +"INSERT INTO " . db_prefix("titles") . " VALUES (28, 27, '', 'Demigod', 'Demigoddess')", +"INSERT INTO " . db_prefix("titles") . " VALUES (29, 28, '', 'Titan', 'Titaness')", +"INSERT INTO " . db_prefix("titles") . " VALUES (30, 29, '', 'Archtitan', 'Archtitaness')", +"INSERT INTO " . db_prefix("titles") . " VALUES (31, 30, '', 'Undergod', 'Undergoddess')", +"INSERT INTO " . db_prefix("titles") . " VALUES (32, 31, '', 'God', 'Goddess')", +), +"1.0.0"=>array(), +"1.0.1"=>array(), +"1.0.2"=>array(), +"1.0.3"=>array(), +"1.0.4"=>array(), +"1.0.5"=>array(), +"1.0.6"=>array(), +"1.1.0 Dragonprime Edition"=>array( +"UPDATE " . db_prefix("accounts") . " SET clanrank = clanrank * 10", +"INSERT INTO " . db_prefix("settings") . " VALUES ('newdaycron', '0')", +"INSERT INTO " . db_prefix("settings") . " VALUES ('charset', 'ISO-8859-1')", +"INSERT INTO " . db_prefix("settings") . " VALUES ('allowspecialswitch', '1')", +), +"1.1.1 Dragonprime Edition"=>array( +"INSERT INTO " . db_prefix("settings") . " VALUES ('allowclans','1')", +"INSERT INTO " . db_prefix("settings") . " VALUES ('resurrectionturns','-6')", + +"DROP TABLE IF EXISTS " . db_prefix("module_navhooks") . ";", +"DROP TABLE IF EXISTS " . db_prefix("module_pagehooks") . ";", +"DROP TABLE IF EXISTS " . db_prefix("module_settingdesc") . ";", +"DROP TABLE IF EXISTS " . db_prefix("module_prefdesc") . ";", +"DROP TABLE IF EXISTS " . db_prefix("items") . ";", + +"ALTER TABLE " . db_prefix("creatures"). " DROP oldcreatureexp;", + +"INSERT INTO " . db_prefix("settings") . " VALUES ('serverlanguages','en,English,fr,Fran�ais,dk,Danish,de,Deutsch,es,Espa�ol,it,Italian')", +"INSERT INTO " . db_prefix("creatures") . " $creaturefields111 VALUES (320, 'Gypsy Bandit', 14, 'Gemmed Dagger', 'That will put an end to his thieving days.', 'You''re dead, he''s free to take what he will.', 499, 172, 145, 27, 20, 'global \$badguy, \$session;\r\n\r\nif (!isset(\$badguy[\\'spellpoints\\'])) {\r\n \$badguy[\\'spellpoints\\'] = 1;\r\n}\r\n\r\n\$gold = round(\$session[\\'user\\'][\\'gold\\'] * 0.2);\r\nif (e_rand(0,7) == 0 && \$gold > 200 && \$badguy[\\'spellpoints\\'] == 1) {\r\n rawoutput(\"
The pickpocket takes \$gold gold!

\");\r\n \$session[\\'user\\'][\\'gold\\'] -= \$gold;\r\n \$badguy[\\'creaturegold\\'] += \$gold;\r\n \$badguy[\\'spellpoints\\']--;\r\n}', 'Talisman', 1, 0)", + +"INSERT INTO " . db_prefix("companions") . " (`companionid`, `name`, `category`, `description`, `attack`, `attackperlevel`, `defense`, `defenseperlevel`, `maxhitpoints`, `maxhitpointsperlevel`, `abilities`, `cannotdie`, `cannotbehealed`, `companionlocation`, `companionactive`, `companioncostdks`, `companioncostgems`, `companioncostgold`, `jointext`, `dyingtext`, `allowinshades`, `allowinpvp`, `allowintrain`) VALUES (1, 'Mortimer teh javelin man', 'Knight', 'A rough and ready warrior. Beneath his hardened exterior, one can detect a man of strong honour.', 5, 2, 1, 2, 20, 20, 'a:4:{s:5:\"fight\";s:1:\"1\";s:4:\"heal\";s:1:\"0\";s:5:\"magic\";s:1:\"0\";s:6:\"defend\";b:0;}', 0, 0, '".getsetting("villagename", LOCATION_FIELDS)."', 1, 0, 4, 573, '`^Greetings unto thee, my friend. Let us go forth and conquer the evils of this world together!', '`4Argggggh! I am slain! Shuffling off my mortal coil. Fare thee well, my friends.', 1, 0, 0)", +"INSERT INTO " . db_prefix("companions") . " (`companionid`, `name`, `category`, `description`, `attack`, `attackperlevel`, `defense`, `defenseperlevel`, `maxhitpoints`, `maxhitpointsperlevel`, `abilities`, `cannotdie`, `cannotbehealed`, `companionlocation`, `companionactive`, `companioncostdks`, `companioncostgems`, `companioncostgold`, `jointext`, `dyingtext`, `allowinshades`, `allowinpvp`, `allowintrain`) VALUES (2, 'Florenz', 'Healer', 'With a slight build, Florenz is better suited as a healer than a fighter.', 1, 1, 5, 5, 15, 10, 'a:4:{s:4:\"heal\";s:1:\"2\";s:5:\"magic\";s:1:\"0\";s:5:\"fight\";b:0;s:6:\"defend\";b:0;}', 0, 0, '".getsetting("villagename", LOCATION_FIELDS)."', 1, 0, 3, 1000, 'Thank ye for thy faith in my skills. I shall endeavour to keep ye away from Ramius'' claws.', 'O Discordia!', 1, 0, 0)", +), +"1.1.2 Dragonprime Edition"=>array( +), +); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/installer/installer_stage_0.php b/lotgd-web/lotgd/lib/installer/installer_stage_0.php new file mode 100755 index 0000000..e257463 --- /dev/null +++ b/lotgd-web/lotgd/lib/installer/installer_stage_0.php @@ -0,0 +1,86 @@ +""){ + debug(md5(md5(stripslashes(httppost("password")))), true); + $version = getsetting("installer_version","-1"); + if ($version == "-1") { + // Passwords weren't encrypted in these versions + $sql = "SELECT * FROM ".db_prefix("accounts")." WHERE login='".mysql_real_escape_string(httppost("username"))."' AND password='".mysql_real_escape_string(httppost("password"))."' AND superuser & ".SU_MEGAUSER; + }else $sql = "SELECT * FROM ".db_prefix("accounts")." WHERE login='".mysql_real_escape_string(httppost("username"))."' AND password='".md5(md5(stripslashes(httppost("password"))))."' AND superuser & ".SU_MEGAUSER; + $result = db_query($sql); + if (db_num_rows($result) > 0){ + $row = db_fetch_assoc($result); + debug($row['password'], true); + debug(httppost('password'), true); + // Okay, we have a username with megauser, now we need to do + // some hackery with the password. + $needsauthentication=true; + $p = stripslashes(httppost("password")); + $p1 = md5($p); + $p2 = md5($p1); + debug($p2, true); + + if (getsetting("installer_version", "-1") == "-1") { + debug("HERE I AM", true); + // Okay, they are upgrading from 0.9.7 they will have + // either a non-encrypted password, or an encrypted singly + // password. + if (strlen($row['password']) == 32 && + $row['password'] == $p1) { + $needsauthentication = false; + } elseif ($row['password'] == $p) { + $needsauthentication = false; + } + } elseif ($row['password'] == $p2) { + $needsauthentication = false; + } + if ($needsauthentication === false) { + redirect("installer.php?stage=1"); + } + output("`\$That username / password was not found, or is not an account with sufficient privileges to perform the upgrade.`n"); + }else{ + $needsauthentication=true; + output("`\$That username / password was not found, or is not an account with sufficient privileges to perform the upgrade.`n"); + } + }else{ + $sql = "SELECT count(*) AS c FROM ".db_prefix("accounts")." WHERE superuser & ".SU_MEGAUSER; + $result = db_query($sql); + $row = db_fetch_assoc($result); + if ($row['c']>0){ + $needsauthentication=true; + }else{ + $needsauthentication=false; + } + } +}else{ + $needsauthentication=false; +} +//if a user with appropriate privs is already logged in, let's let them past. +if ($session['user']['superuser'] & SU_MEGAUSER) $needsauthentication=false; +if ($needsauthentication){ + $session['stagecompleted']=-1; + rawoutput("
"); + output("`%In order to upgrade this LoGD installation, you will need to provide the username and password of a superuser account with the MEGAUSER privilege`n"); + output("`^Username: `0"); + rawoutput("
"); + output("`^Password: `0"); + rawoutput("
"); + $submit = translate_inline("Submit"); + rawoutput(""); + rawoutput("
"); +}else{ + output("`nPlease continue on to the next page, \"License Agreement.\""); +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/installer/installer_stage_1.php b/lotgd-web/lotgd/lib/installer/installer_stage_1.php new file mode 100755 index 0000000..ae51c44 --- /dev/null +++ b/lotgd-web/lotgd/lib/installer/installer_stage_1.php @@ -0,0 +1,40 @@ +]*>(.*)'",$license,$shortlicense); +$license = $shortlicense[1][0]; +output("`@`c`bLicense Agreement`b`c`0"); +output("`2Before continuing, you must read and understand the following license agreement.`0`n`n"); +if (md5($license)=="484d213db9a69e79321feafb85915ff1"){ + $cdomain = "http://creativecommons.org"; + $license = preg_replace("/(href|src)\=\"([^(http)])(\/)?/", "$1=\"".$cdomain."$2", $license); + rawoutput("
".$license."
"); +}else{ + output("`^Warning, the Creative Commons license has changed, or could not be retrieved from the Creative Commons server."); + output("You should check with the game authors to ensure that the below license agrees with the license under which it was released."); + output("The license may be referenced at the Creative Commons site.",true); +} +$license = join("",file("LICENSE.txt")); +$license = preg_replace("/[^\na-zA-Z0-9!?.,;:'\"\\/\\()@ -\\]\\[]/","",$license); +$licensemd5s = array( +'e281e13a86d4418a166d2ddfcd1e8032'=>true +); +if (isset($licensemd5s[md5($license)])){ + // Reload it so we get the right line breaks, etc. + //$license = file("LICENSE.txt"); + $license = htmlentities($license, ENT_COMPAT, getsetting("charset", "ISO-8859-1")); + $license = nl2br($license); + //$license = preg_replace("/]*>\s+]*>/i","

",$license); + //$license = preg_replace("/]*>/i","",$license); + output("`n`n`b`@Plain Text:`b`n`7"); + rawoutput($license); +}else{ + output("`^The license file (LICENSE.txt) has been modified. Please obtain a new copy of the game's code, this file has been tampered with."); + output("Expected MD5 in (".join(array_keys($licensemd5s),",")."), but got ".md5($license)); + $stage=-1; + $session['stagecompleted']=-1; +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/installer/installer_stage_10.php b/lotgd-web/lotgd/lib/installer/installer_stage_10.php new file mode 100755 index 0000000..fa0c53f --- /dev/null +++ b/lotgd-web/lotgd/lib/installer/installer_stage_10.php @@ -0,0 +1,55 @@ +""){ + $showform=false; + if (httppost("pass1")!=httppost("pass2")){ + output("`\$Oops, your passwords don't match.`2`n"); + $showform=true; + }elseif (strlen(httppost("pass1"))<6){ + output("`\$Whoa, that's a short password, you really should make it longer.`2`n"); + $showform=true; + }else{ + // Give the superuser a decent set of privs so they can + // do everything needed without having to first go into + // the user editor and give themselves privs. + $su = SU_MEGAUSER | SU_EDIT_MOUNTS | SU_EDIT_CREATURES | + SU_EDIT_PETITIONS | SU_EDIT_COMMENTS | SU_EDIT_DONATIONS | + SU_EDIT_USERS | SU_EDIT_CONFIG | SU_INFINITE_DAYS | + SU_EDIT_EQUIPMENT | SU_EDIT_PAYLOG | SU_DEVELOPER | + SU_POST_MOTD | SU_MODERATE_CLANS | SU_EDIT_RIDDLES | + SU_MANAGE_MODULES | SU_AUDIT_MODERATION | SU_RAW_SQL | + SU_VIEW_SOURCE | SU_NEVER_EXPIRE; + $name = httppost("name"); + $pass = md5(md5(stripslashes(httppost("pass1")))); + $sql = "DELETE FROM ".db_prefix("accounts")." WHERE login='$name'"; + db_query($sql); + $sql = "INSERT INTO " .db_prefix("accounts") ." (login,password,superuser,name,ctitle,regdate) VALUES('$name','$pass',$su,'`%Admin `&$name`0','`%Admin', NOW())"; + db_query($sql); + output("`^Your superuser account has been created as `%Admin `&$name`^!"); + savesetting("installer_version",$logd_version); + } + }else{ + $showform=true; + savesetting("installer_version",$logd_version); + } + if ($showform){ + rawoutput("

"); + output("Enter a name for your superuser account:"); + rawoutput(""); + output("`nEnter a password: "); + rawoutput(""); + output("`nConfirm your password: "); + rawoutput(""); + $submit = translate_inline("Create"); + rawoutput("
"); + rawoutput("
"); + } +}else{ + output("`#You already have a superuser account set up on this server."); + savesetting("installer_version",$logd_version); +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/installer/installer_stage_2.php b/lotgd-web/lotgd/lib/installer/installer_stage_2.php new file mode 100755 index 0000000..ac11a7c --- /dev/null +++ b/lotgd-web/lotgd/lib/installer/installer_stage_2.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/installer/installer_stage_3.php b/lotgd-web/lotgd/lib/installer/installer_stage_3.php new file mode 100755 index 0000000..582f87f --- /dev/null +++ b/lotgd-web/lotgd/lib/installer/installer_stage_3.php @@ -0,0 +1,54 @@ +"); +output("`@`c`bDatabase Connection Information`b`c`2"); +output("In order to run Legend of the Green Dragon, your server must have access to a MySQL database."); +output("If you are not sure if you meet this need, talk to server's Internet Service Provider (ISP), and make sure they offer MySQL databases."); +output("If you are running on your own machine or a server under your control, you can download and install MySQL from the MySQL website for free.`n",true); +if (file_exists("dbconnect.php")){ + output("There appears to already be a database setup file (dbconnect.php) in your site root, you can proceed to the next step."); +}else{ + output("`nIt looks like this is a new install of Legend of the Green Dragon."); + output("First, thanks for installing LoGD!"); + output("In order to connect to the database server, I'll need the following information."); + output("`iIf you are unsure of the answer to any of these questions, please check with your server's ISP, or read the documentation on MySQL`i`n"); + + output("`nWhat is the address of your database server?`n"); + rawoutput(""); + tip("If you are running LoGD from the same server as your database, use 'localhost' here. Otherwise, you will have to find out what the address is of your database server. Your server's ISP might be able to provide this information."); + + output("`nWhat is the username you use to connect to the database server?`n"); + rawoutput(""); + tip("This username does not have to be the same one you use to connect to the database server for administrative reasons. However, in order to use this installer, and to install some of the modules, the account you provide here must have the ability to create, modify, and drop tables. If you want the installer to create a new database for LoGD, the account will also have to have the ability to create databases. Finally, to run the game, this account must at a minimum be able to select, insert, update, and delete records, and be able to lock tables. If you're uncertain, grant the account the following privileges: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, and ALTER."); + + output("`nWhat is the password for this username?`n"); + rawoutput(""); + tip("The password is necessary here in order for the game to successfully connect to the database server. This information is not shared with anyone, it is simply used to configure the game."); + + output("`nWhat is the name of the database you wish to install LoGD in?`n"); + rawoutput(""); + tip("Database servers such as MySQL can control many different databases. This is very useful if you have many different programs each needing their own database. Each database has a unique name. Provide the name you wish to use for LoGD in this field."); + + output("`nDo you want to use datacaching (high load optimization)?`n"); + rawoutput(""); + tip("Do you want to use a datacache for the sql queries? Many internal queries produce the same results and can be cached. This feature is *highly* recommended to use as the MySQL server is usually high frequented. When using in an environment where Safe Mode is enabled; this needs to be a path that has the same UID as the web server runs."); + + output("`nIf yes, what is the path to the datacache directory?`n"); + rawoutput(""); + tip("If you have chosen to use the datacache function, you have to enter a path here to where temporary files may be stored. Verify that you have the proper permission (777) set to this folder, else you will have lots of errors. Do NOT end with a slash / ... just enter the dir"); + + /* + $yes = translate_inline("Yes"); + $no = translate_inline("No"); + output("`nShould I attempt to create this database if it does not exist?`n"); + rawoutput(""); + tip("If this database doesn't exist, I'll try to create it for you if you like."); + */ + $submit="Test this connection information."; + output_notl("`n`n",true); +} +rawoutput(""); +?> diff --git a/lotgd-web/lotgd/lib/installer/installer_stage_4.php b/lotgd-web/lotgd/lib/installer/installer_stage_4.php new file mode 100755 index 0000000..7d0268b --- /dev/null +++ b/lotgd-web/lotgd/lib/installer/installer_stage_4.php @@ -0,0 +1,196 @@ +".$error.""); + output("If you believe you provided the correct information, make sure that the database server is running (check documentation for how to determine this)."); + output("Otherwise, you should return to the previous step, \"Database Info\" and double-check that the information provided there is accurate."); + $session['stagecompleted']=3; +}else{ + output("`^Yahoo, I was able to connect to the database server!"); + output("`2This means that the database server address, database username, and database password you provided were probably accurate, and that your database server is running and accepting connections.`n"); + output("`nI'm now going to attempt to connect to the LoGD database you provided.`n"); + if (httpget("op")=="trycreate"){ + require_once 'lib/installer/installer_functions.php'; + create_db($session['dbinfo']['DB_NAME']); + } + if (!db_select_db($session['dbinfo']['DB_NAME'])){ + output("`\$Rats! I was not able to connect to the database."); + $error = db_error(); + if ($error=="Unknown database '{$session['dbinfo']['DB_NAME']}'"){ + output("`2It looks like the database for LoGD hasn't been created yet."); + output("I can attempt to create it for you if you like, but in order for that to work, the account you provided has to have permissions to create a new database."); + output("If you're not sure what this means, it's safe to try to create this database, but you should double check that you've typed the name correctly by returning to the previous stage before you try it.`n"); + output("`nTo try to create the database, click here.`n",true); + }else{ + output("`2This is probably because the username and password you provided doesn't have permission to connect to the database.`n"); + } + output("`nThe exact error returned from the database server was:"); + rawoutput("
$error
"); + $session['stagecompleted']=3; + }else{ + output("`n`^Excellent, I was able to connect to the database!`n"); + define("DB_INSTALLER_STAGE4", true); + output("`n`@Tests`2`n"); + output("I'm now going to run a series of tests to determine what the permissions of this account are.`n"); + $issues = array(); + output("`n`^Test: `#Creating a table`n"); + //try to destroy the table if it's already here. + $sql = "DROP TABLE IF EXISTS logd_environment_test"; + db_query($sql,false); + $sql = "CREATE TABLE logd_environment_test (a int(11) unsigned not null)"; + db_query($sql); + if ($error=db_error()){ + output("`2Result: `\$Fail`n"); + rawoutput("
$error
"); + array_push($issues,"`^Warning:`2 The installer will not be able to create the tables necessary to install LoGD. If these tables already exist, or you have created them manually, then you can ignore this. Also, many modules rely on being able to create tables, so you will not be able to use these modules."); + }else{ + output("`2Result: `@Pass`n"); + } + output("`n`^Test: `#Modifying a table`n"); + $sql = "ALTER TABLE logd_environment_test CHANGE a b varchar(50) not null"; + db_query($sql); + if ($error=db_error()){ + output("`2Result: `\$Fail`n"); + rawoutput("
$error
"); + array_push($issues,"`^Warning:`2 The installer will not be able to modify existing tables (if any) to line up with new configurations. Also, many modules rely on table modification permissions, so you will not be able to use these modules."); + }else{ + output("`2Result: `@Pass`n"); + } + output("`n`^Test: `#Creating an index`n"); + $sql = "ALTER TABLE logd_environment_test ADD INDEX(b)"; + db_query($sql); + if ($error=db_error()){ + output("`2Result: `\$Fail`n"); + rawoutput("
$error
"); + array_push($issues,"`^Warning:`2 The installer will not be able to create indices on your tables. Indices are extremely important for an active server, but can be done without on a small server."); + }else{ + output("`2Result: `@Pass`n"); + } + output("`n`^Test: `#Inserting a row`n"); + $sql = "INSERT INTO logd_environment_test (b) VALUES ('testing')"; + db_query($sql); + if ($error=db_error()){ + output("`2Result: `\$Fail`n"); + rawoutput("
$error
"); + array_push($issues,"`\$Critical:`2 The game will not be able to function with out the ability to insert rows."); + $session['stagecompleted']=3; + }else{ + output("`2Result: `@Pass`n"); + } + output("`n`^Test: `#Selecting a row`n"); + $sql = "SELECT * FROM logd_environment_test"; + db_query($sql); + if ($error=db_error()){ + output("`2Result: `\$Fail`n"); + rawoutput("
$error
"); + array_push($issues,"`\$Critical:`2 The game will not be able to function with out the ability to select rows."); + $session['stagecompleted']=3; + }else{ + output("`2Result: `@Pass`n"); + } + output("`n`^Test: `#Updating a row`n"); + $sql = "UPDATE logd_environment_test SET b='MightyE'"; + db_query($sql); + if ($error=db_error()){ + output("`2Result: `\$Fail`n"); + rawoutput("
$error
"); + array_push($issues,"`\$Critical:`2 The game will not be able to function with out the ability to update rows."); + $session['stagecompleted']=3; + }else{ + output("`2Result: `@Pass`n"); + } + output("`n`^Test: `#Deleting a row`n"); + $sql = "DELETE FROM logd_environment_test"; + db_query($sql); + if ($error=db_error()){ + output("`2Result: `\$Fail`n"); + rawoutput("
$error
"); + array_push($issues,"`\$Critical:`2 The game database will grow very large with out the ability to delete rows."); + $session['stagecompleted']=3; + }else{ + output("`2Result: `@Pass`n"); + } + output("`n`^Test: `#Locking a table`n"); + $sql = "LOCK TABLES logd_environment_test WRITE"; + db_query($sql); + if ($error = db_error()) { + output("`2Result: `\$Fail`n"); + rawoutput("
$error
"); + array_push($issues,"`\$Critical:`2 The game will not run correctly without the ability to lock tables."); + $session['stagecompleted']=3; + } else { + output("`2Result: `@Pass`n"); + } + output("`n`^Test: `#Unlocking a table`n"); + $sql = "UNLOCK TABLES"; + db_query($sql); + if ($error = db_error()) { + output("`2Result: `\$Fail`n"); + rawoutput("
$error
"); + array_push($issues,"`\$Critical:`2 The game will not run correctly without the ability to unlock tables."); + $session['stagecompleted']=3; + } else { + output("`2Result: `@Pass`n"); + } + output("`n`^Test: `#Deleting a table`n"); + $sql = "DROP TABLE logd_environment_test"; + db_query($sql); + if ($error=db_error()){ + output("`2Result: `\$Fail`n"); + rawoutput("
$error
"); + array_push($issues,"`^Warning:`2 The installer will not be able to delete old tables (if any). Also, many modules need to be able to delete the tables they put in place when they are uninstalled. Although the game will function, you may end up with a lot of old data sitting around."); + }else{ + output("`2Result: `@Pass`n"); + } + output("`n`^Test: `#Checking datacache`n"); + if (!$session['dbinfo']['DB_USEDATACACHE']) { + output("-----skipping, not selected-----`n"); + } else { + $fp = @fopen($session['dbinfo']['DB_DATACACHEPATH']."/dummy.php","w+"); + if ($fp){ + if (fwrite($fp, $dbconnect)!==false){ + output("`2Result: `@Pass`n"); + }else{ + output("`2Result: `\$Fail`n"); + rawoutput("
"); + array_push($issues,"`^I was not able to write to your datacache directory!`n"); + } + fclose($fp); + @unlink($session['dbinfo']['DB_DATACACHEPATH']."/dummy.php"); + }else{ + output("`2Result: `\$Fail`n"); + array_push($issues,"`^I was not able to write to your datacache directory! Check your permissions there!`n"); + } + } + output("`n`^Overall results:`2`n"); + if (count($issues)==0){ + output("You've passed all the tests, you're ready for the next stage."); + }else{ + rawoutput("
    "); + output("
  • ".join("
  • \n
  • ",$issues)."
  • ",true); + rawoutput("
"); + output("Even if all of the above issues are merely warnings, you will probably periodically see database errors as a result of them."); + output("It would be a good idea to resolve these permissions issues before attempting to run this game."); + output("For you technical folk, the specific permissions suggested are: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER and LOCK TABLES."); + output("I'm sorry, this is not something I can do for you."); + } + } +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/installer/installer_stage_5.php b/lotgd-web/lotgd/lib/installer/installer_stage_5.php new file mode 100755 index 0000000..138b161 --- /dev/null +++ b/lotgd-web/lotgd/lib/installer/installer_stage_5.php @@ -0,0 +1,72 @@ + ""){ + $session['dbinfo']['DB_PREFIX'] = httppost("DB_PREFIX"); +} +if ($session['dbinfo']['DB_PREFIX'] > "" && substr($session['dbinfo']['DB_PREFIX'],-1)!="_") +$session['dbinfo']['DB_PREFIX'] .= "_"; + +$descriptors = descriptors($session['dbinfo']['DB_PREFIX']); +$unique=0; +$game=0; +$missing=0; +$conflict = array(); + +$link = mysql_connect($session['dbinfo']['DB_HOST'],$session['dbinfo']['DB_USER'],$session['dbinfo']['DB_PASS']); +mysql_select_db($session['dbinfo']['DB_NAME']); +$sql = "SHOW TABLES"; +$result = mysql_query($sql); +while ($row = mysql_fetch_assoc($result)){ + list($key,$val)=each($row); + if (isset($descriptors[$val])){ + $game++; + array_push($conflict,$val); + }else{ + $unique++; + } +} +$missing = count($descriptors)-$game; +if ($missing*10 < $game){ + //looks like an upgrade + $upgrade=true; +}else{ + $upgrade=false; +} +if (httpget("type")=="install") $upgrade=false; +if (httpget("type")=="upgrade") $upgrade=true; +$session['dbinfo']['upgrade']=$upgrade; + if ($upgrade){ + output("`@This looks like a game upgrade."); + output("`^If this is not an upgrade from a previous version of LoGD, click here.",true); + output("`2Otherwise, continue on to the next step."); +}else{ + //looks like a clean install + $upgrade=false; + output("`@This looks like a fresh install."); + output("`2If this is not a fresh install, but rather an upgrade from a previous version of LoGD, chances are that you installed LoGD with a table prefix. If that's the case, enter the prefix below. If you are still getting this message, it's possible that I'm just spooked by how few tables are common to the current version, and in which case, I can try an upgrade if you click here.`n",true); + if (count($conflict)>0){ + output("`n`n`\$There are table conflicts.`2"); + output("If you continue with an install, the following tables will be overwritten with the game's tables. If the listed tables belong to LoGD, they will be upgraded, otherwise all existing data in those tables will be destroyed. Once this is done, this cannot be undone unless you have a backup!`n"); + output("`nThese tables conflict: `^".join(", ",$conflict)."`2`n"); + if (httpget("op")=="confirm_overwrite") $session['sure i want to overwrite the tables']=true; + if (!$session['sure i want to overwrite the tables']){ + $session['stagecompleted']=4; + output("`nIf you are sure that you wish to overwrite these tables, click here.`n",true); + } + } + output("`nYou can avoid table conflicts with other applications in the same database by providing a table name prefix."); + output("This prefix will get put on the name of every table in the database."); +} +rawoutput("
"); +output("`nTo provide a table prefix, enter it here."); +output("If you don't know what this means, you should either leave it blank, or enter an intuitive value such as \"logd\".`n"); +rawoutput("
"); +$submit = translate_inline("Submit your prefix."); +rawoutput(""); +rawoutput("
"); +if (count($conflict)==0){ + output("`^It looks like you can probably safely skip this step if you don't know what it means."); +} +output("`n`n`@Once you have submitted your prefix, you will be returned to this page to select the next step."); +output("If you don't need a prefix, just select the next step now."); +?> diff --git a/lotgd-web/lotgd/lib/installer/installer_stage_6.php b/lotgd-web/lotgd/lib/installer/installer_stage_6.php new file mode 100755 index 0000000..a0717ef --- /dev/null +++ b/lotgd-web/lotgd/lib/installer/installer_stage_6.php @@ -0,0 +1,109 @@ +\n"; + $fp = @fopen("dbconnect.php","w+"); + if ($fp){ + if (fwrite($fp, $dbconnect)!==false){ + output("`n`@Success!`2 I was able to write your dbconnect.php file, you can continue on to the next step."); + }else{ + $failure=true; + } + fclose($fp); + }else{ + $failure=true; + } + if ($failure){ + output("`n`\$Unfortunately, I was not able to write your dbconnect.php file."); + output("`2You will have to create this file yourself, and upload it to your web server."); + output("The contents of this file should be as follows:`3"); + rawoutput("
".htmlentities($dbconnect, ENT_COMPAT, getsetting("charset", "ISO-8859-1"))."
"); + output("`2Create a new file, past the entire contents from above into it (everything from and including `3`2 )."); + output("When you have that done, save the file as 'dbconnect.php' and upload this to the location you have LoGD at."); + output("You can refresh this page to see if you were successful."); + }else{ + $success=true; + } +} +if ($success && !$initial){ + $version = getsetting("installer_version","-1"); + $sub = substr($version, 0, 5); + $sub = (int)str_replace(".", "", $sub); + if ($sub < 110) { + $sql = "SELECT setting, value FROM ".db_prefix("settings")." WHERE setting IN ('usedatacache', 'datacachepath')"; + $result = db_query($sql); + $fp = @fopen("dbconnect.php","r+"); + if ($fp){ + while(!feof($fp)) { + $buffer = fgets($fp, 4096); + if (strpos($buffer, "\$DB") !== false) { + @eval($buffer); + } + } + fclose($fp); + } + while ($row = db_fetch_assoc($result)) { + if ($row['setting'] == 'datacachepath') { + $DB_DATACACHEPATH = $row['value']; + } + if ($row['setting'] == 'usedatacache') { + $DB_USEDATACACHE = $row['value']; + } + } + $dbconnect = + "\n"; + // Check if the file is writeable for us. If yes, we will change the file and notice the admin + // if not, they have to change the file themselves... + $fp = @fopen("dbconnect.php","w+"); + if ($fp){ + if (fwrite($fp, $dbconnect)!==false){ + output("`n`@Success!`2 I was able to write your dbconnect.php file."); + }else{ + $failure=true; + } + fclose($fp); + }else{ + $failure=true; + } + if ($failure) { + output("`2With this new version the settings for datacaching had to be moved to `idbconnect.php`i."); + output("Due to your system settings and privleges for this file, I was not able to perform the changes by myself."); + output("This part involves you: We have to ask you to replace the content of your existing `idbconnect.php`i with the following code:`n`n`&"); + rawoutput("
".htmlentities($dbconnect, ENT_COMPAT, getsetting("charset", "ISO-8859-1"))."
"); + output("`2This will let you use your existing datacaching settings.`n`n"); + output("If you have done this, you are ready for the next step."); + } else { + output("`n`^You are ready for the next step."); + } + } else { + output("`n`^You are ready for the next step."); + } +}else if(!$success) { + $session['stagecompleted']=5; +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/installer/installer_stage_7.php b/lotgd-web/lotgd/lib/installer/installer_stage_7.php new file mode 100755 index 0000000..305bf4c --- /dev/null +++ b/lotgd-web/lotgd/lib/installer/installer_stage_7.php @@ -0,0 +1,45 @@ +""){ + if (httppost("type")=="install") { + $session['fromversion']="-1"; + $session['dbinfo']['upgrade']=false; + }else{ + $session['fromversion']=httppost("version"); + $session['dbinfo']['upgrade']=true; + } +} + +if (!isset($session['fromversion']) || $session['fromversion']==""){ + output("`@`c`bConfirmation`b`c"); + output("`2Please confirm the following:`0`n"); + rawoutput("
"); + rawoutput("
"); + output("`2I should:`0"); + rawoutput(""); + $version = getsetting("installer_version","-1"); + if ($version != "-1") $session['dbinfo']['upgrade']=true; + rawoutput(""); + output(" `2Perform an upgrade from "); + if ($version=="-1") $version="0.9.7"; + reset($sql_upgrade_statements); + rawoutput(""); + rawoutput("
"); + output(" `2Perform a clean install."); + rawoutput("
"); + $submit=translate_inline("Submit"); + rawoutput(""); + rawoutput("
"); + $session['stagecompleted']=$stage - 1; +}else{ + $session['stagecompleted']=$stage; + header("Location: installer.php?stage=".($stage+1)); + exit(); +} +?> diff --git a/lotgd-web/lotgd/lib/installer/installer_stage_8.php b/lotgd-web/lotgd/lib/installer/installer_stage_8.php new file mode 100755 index 0000000..51467a1 --- /dev/null +++ b/lotgd-web/lotgd/lib/installer/installer_stage_8.php @@ -0,0 +1,221 @@ +http://dragonprime.net/.",true); +$phpram = ini_get("memory_limit"); +if (return_bytes($phpram) < 12582912 && $phpram!=-1 && !$session['overridememorylimit'] && !$session['dbinfo']['upgrade']) {// 12 MBytes + // enter this ONLY if it's not an upgrade and if the limit is really too low + output("`n`n`\$Warning: Your PHP memory limit is set to a very low level."); + output("Smaller servers should not be affected by this during normal gameplay but for this installation step you should assign at least 12 Megabytes of RAM for your PHP process."); + output("For now we will skip this step, but before installing any module, make sure to increase you memory limit."); + output("`nYou can proceed at your own risk. Be aware that a blank screen indicates you *must* increase the memory limit."); + output("`n`nTo override click again on \"Set Up Modules\"."); + $session['stagecompleted'] = "8"; + $session['overridememorylimit'] = true; + $session['skipmodules'] = true; +} else { + if (isset($session['overridememorylimit']) && $session['overridememorylimit']) { + output("`4`n`nYou have been warned... you are now working on your own risk.`n`n"); + $session['skipmodules'] = false; + } + $submit = translate_inline("Save Module Settings"); + $install = translate_inline("Select Recommended Modules"); + $reset = translate_inline("Reset Values"); + $all_modules = array(); + $sql = "SELECT * FROM ".db_prefix("modules")." ORDER BY category,active DESC,formalname"; + $result = @db_query($sql); + if ($result!==false){ + while ($row = db_fetch_assoc($result)){ + if (!array_key_exists($row['category'],$all_modules)){ + $all_modules[$row['category']] = array(); + } + $row['installed']=true; + $all_modules[$row['category']][$row['modulename']] = $row; + } + } + $install_status = get_module_install_status(); + $uninstalled = $install_status['uninstalledmodules']; + reset($uninstalled); + $invalidmodule = array( + "version"=>"", + "author"=>"", + "category"=>"Invalid Modules", + "download"=>"", + "description"=>"", + "invalid"=>true, + ); + while (list($key,$modulename) = each($uninstalled)){ + $row = array(); + //test if the file is a valid module or a lib file/whatever that got in, maybe even malcode that does not have module form + $modulenamelower = strtolower($modulename); + $file = strtolower(file_get_contents("modules/$modulename.php")); + if (strpos($file,$modulenamelower."_getmoduleinfo")===false || + //strpos($file,$shortname."_dohook")===false || + //do_hook is not a necessity + strpos($file,$modulenamelower."_install")===false || + strpos($file,$modulenamelower."_uninstall")===false) { + //here the files has neither do_hook nor getinfo, which means it won't execute as a module here --> block it + notify the admin who is the manage modules section + $moduleinfo=array_merge($invalidmodule,array("name"=>$modulename.".php ".appoencode(translate_inline("(`\$Invalid Module! Contact Author or check file!`0)")))); + } else { + $moduleinfo= get_module_info($modulename); + } + //end of testing + $row['installed'] = false; + $row['active'] = false; + $row['category'] = $moduleinfo['category']; + $row['modulename'] = $modulename; + $row['formalname'] = $moduleinfo['name']; + $row['description'] = $moduleinfo['description']; + $row['moduleauthor'] = $moduleinfo['author']; + $row['invalid'] = (isset($moduleinfo['invalid']))?$moduleinfo['invalid']:false; + if (!array_key_exists($row['category'],$all_modules)){ + $all_modules[$row['category']] = array(); + } + $all_modules[$row['category']][$row['modulename']] = $row; + } + if (count($all_modules) == 0) { + $session['skipmodules'] = true; + $session['stagecompleted'] = $stage; + header("Location: installer.php?stage=".($stage+1)); + exit(); + } + output_notl("`0"); + rawoutput("
"); + rawoutput(""); + rawoutput(""); + rawoutput("
"); + rawoutput(""); + ksort($all_modules); + reset($all_modules); + $x=0; + while (list($categoryName,$categoryItems)=each($all_modules)){ + rawoutput(""); + rawoutput(""); + reset($categoryItems); + while (list($modulename,$moduleinfo)=each($categoryItems)){ + $x++; + //if we specified things in a previous hit on this page, let's update the modules array here as we go along. + $moduleinfo['realactive'] = $moduleinfo['active']; + $moduleinfo['realinstalled'] = $moduleinfo['installed']; + if (array_key_exists('moduleoperations',$session) && is_array($session['moduleoperations']) && array_key_exists($modulename,$session['moduleoperations'])){ + $ops = explode(",",$session['moduleoperations'][$modulename]); + reset($ops); + while (list($trash,$op) = each($ops)){ + switch($op){ + case "uninstall": + $moduleinfo['installed'] = false; + $moduleinfo['active'] = false; + break; + case "install": + $moduleinfo['installed'] = true; + $moduleinfo['active'] = false; + break; + case "activate": + $moduleinfo['installed'] = true; + $moduleinfo['active'] = true; + break; + case "deactivate": + $moduleinfo['installed'] = true; + $moduleinfo['active'] = false; + break; + case "donothing": + break; + } + } + } + rawoutput(""); + if ($moduleinfo['realactive']){ + $uninstallop = "uninstall"; + $installop = "deactivate"; + $activateop = "donothing"; + }elseif ($moduleinfo['realinstalled']){ + $uninstallop = "uninstall"; + $installop = "donothing"; + $activateop = "activate"; + }else{ + $uninstallop = "donothing"; + $installop = "install"; + $activateop = "install,activate"; + } + $uninstallcheck = false; + $installcheck = false; + $activatecheck = false; + if ($moduleinfo['active']){ + $activatecheck = true; + }elseif ($moduleinfo['installed']){ + //echo "$modulename is installed but not active.
"; + $installcheck = true; + }else{ + //echo "$modulename is uninstalled.
"; + $uninstallcheck = true; + } + if (isset($moduleinfo['invalid']) && $moduleinfo['invalid'] == true) { + rawoutput(""); + rawoutput(""); + rawoutput(""); + } else { + rawoutput(""); + rawoutput(""); + rawoutput(""); + } + output_notl("",true); + require_once("lib/sanitize.php"); + rawoutput(""); + rawoutput(""); + } + } + rawoutput("
".tl($categoryName)."
".tl("Uninstalled")."".tl("Installed")."".tl("Activated")."".tl("Recommended")."".tl("Module Name")."".tl("Author")."
".(in_array($modulename,$recommended_modules)?tl("`^Yes`0"):tl("`\$No`0")).""); + output_notl("`@"); + if (isset($moduleinfo['invalid']) && $moduleinfo['invalid'] == true) { + rawoutput($moduleinfo['formalname']); + } else { + output($moduleinfo['formalname']); + } + output_notl(" [`%$modulename`@]`0"); + rawoutput(""); + output_notl("`#{$moduleinfo['moduleauthor']}`0", true); + rawoutput("
"); + rawoutput("
"); + rawoutput(""); + rawoutput(""); + rawoutput("
"); + rawoutput(""); +} +?> diff --git a/lotgd-web/lotgd/lib/installer/installer_stage_9.php b/lotgd-web/lotgd/lib/installer/installer_stage_9.php new file mode 100755 index 0000000..2b0dabf --- /dev/null +++ b/lotgd-web/lotgd/lib/installer/installer_stage_9.php @@ -0,0 +1,143 @@ +"); +$descriptors = descriptors($DB_PREFIX); +require_once("lib/tabledescriptor.php"); +reset($descriptors); +while (list($tablename,$descriptor)=each($descriptors)){ + output("`3Synchronizing table `#$tablename`3..`n"); + synctable($tablename,$descriptor,true); + if ($session['dbinfo']['upgrade']==false){ + //on a clean install, destroy all old data. + db_query("TRUNCATE TABLE $tablename"); + } +} +rawoutput(""); +output("`n`2The tables now have new fields and columns added, I'm going to begin importing data now.`n"); +rawoutput("
"); +$dosql = false; +reset($sql_upgrade_statements); +while (list($key,$val)=each($sql_upgrade_statements)){ + if ($dosql){ + output("`3Version `#%s`3: %s SQL statements...`n",$key,count($val)); + if (count($val)>0){ + output("`^Doing: `6"); + reset($val); + $count=0; + while (list($id,$sql)=each($val)){ + $onlyupgrade = 0; + if (substr($sql, 0, 2) == "1|") { + $sql = substr($sql, 2); + $onlyupgrade = 1; + } + // Skip any statements that should only be run during + // upgrades from previous versions. + if (!$session['dbinfo']['upgrade'] && $onlyupgrade) { + continue; + } + $count++; + if ($count%10==0 && $count!=count($val)) + output_notl("`6$count..."); + if (!db_query($sql)) { + output("`n`\$Error: `^'%s'`7 executing `#'%s'`7.`n", + db_error(), $sql); + } + } + output("$count.`n"); + } + } + if ($key == $session['fromversion'] || + $session['dbinfo']['upgrade'] == false) $dosql=true; +} +rawoutput("
"); +output("Now I'm going to insert default settings that you don't have."); +rawoutput("
"); +foreach ($default_settings as $setting_name=>$setting_value) { + if(!isset($settings[$setting_name]) && getsetting($setting_name, $setting_value) == $setting_value) { + if ($setting_value === true) { + $setting_value = "true"; + }elseif ($setting_value === false) { + $setting_value = "false"; + } + output_notl("Setting $setting_name to default value of $setting_value`n"); + } +} +rawoutput("
"); + /* +output("`n`2Now I'll install the recommended modules."); +output("Please note that these modules will be installed, but not activated."); +output("Once installation is complete, you should use the Module Manager found in the superuser grotto to activate those modules you wish to use."); +reset($recommended_modules); +rawoutput("
"); +while (list($key,$modulename)=each($recommended_modules)){ +output("`3Installing `#$modulename`\$`n"); +install_module($modulename, false); +} +rawoutput("
"); +*/ +if (!$session['skipmodules']) { + output("`n`2Now I'll install and configure your modules."); + rawoutput("
"); + foreach($session['moduleoperations'] as $modulename=>$val){ + $ops = explode(",",$val); + reset($ops); + while (list($trash,$op) = each($ops)){ + switch($op){ + case "uninstall": + output("`3Uninstalling `#$modulename`3: "); + if (uninstall_module($modulename)){ + output("`@OK!`0`n"); + }else{ + output("`\$Failed!`0`n"); + } + break; + case "install": + output("`3Installing `#$modulename`3: "); + if (install_module($modulename)){ + output("`@OK!`0`n"); + }else{ + output("`\$Failed!`0`n"); + } + install_module($modulename); + break; + case "activate": + output("`3Activating `#$modulename`3: "); + if (activate_module($modulename)){ + output("`@OK!`0`n"); + }else{ + output("`\$Failed!`0`n"); + } + break; + case "deactivate": + output("`3Deactivating `#$modulename`3: "); + if (deactivate_module($modulename)){ + output("`@OK!`0`n"); + }else{ + output("`\$Failed!`0`n"); + } + break; + case "donothing": + break; + } + } + $session['moduleoperations'][$modulename] = "donothing"; + } + rawoutput("
"); +} +output("`n`2Finally, I'll clean up old data.`n"); +rawoutput("
"); +reset($descriptors); +while (list($tablename,$descriptor)=each($descriptors)){ + output("`3Cleaning up `#$tablename`3...`n"); + synctable($tablename,$descriptor); +} +rawoutput("
"); +output("`n`n`^You're ready for the next step."); +?> diff --git a/lotgd-web/lotgd/lib/installer/installer_stage_default.php b/lotgd-web/lotgd/lib/installer/installer_stage_default.php new file mode 100755 index 0000000..5d6b955 --- /dev/null +++ b/lotgd-web/lotgd/lib/installer/installer_stage_default.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/is_email.php b/lotgd-web/lotgd/lib/is_email.php new file mode 100755 index 0000000..25b56a8 --- /dev/null +++ b/lotgd-web/lotgd/lib/is_email.php @@ -0,0 +1,8 @@ + diff --git a/lotgd-web/lotgd/lib/local_config.php b/lotgd-web/lotgd/lib/local_config.php new file mode 100755 index 0000000..6b6cce9 --- /dev/null +++ b/lotgd-web/lotgd/lib/local_config.php @@ -0,0 +1,14 @@ + diff --git a/lotgd-web/lotgd/lib/lookup_user.php b/lotgd-web/lotgd/lib/lookup_user.php new file mode 100755 index 0000000..9e8e09f --- /dev/null +++ b/lotgd-web/lotgd/lib/lookup_user.php @@ -0,0 +1,43 @@ +100){ + $err = "`\$Too many results found, narrow your search please.`0"; + }else{ + // Everything is good + } + } + return array($searchresult, $err); +} +?> diff --git a/lotgd-web/lotgd/lib/mail.php b/lotgd-web/lotgd/lib/mail.php new file mode 100755 index 0000000..20b40d6 --- /dev/null +++ b/lotgd-web/lotgd/lib/mail.php @@ -0,0 +1,415 @@ + + invalidatedatacache("mail-{$session['user']['acctid']}"); + // + header("Location: mail.php"); + exit(); +}elseif($op=="process"){ + $msg = httppost('msg'); + if (!is_array($msg) || count($msg)<1){ + $session['message'] = "`\$`bYou cannot delete zero messages! What does this mean? You pressed \"Delete Checked\" but there are no messages checked! What sort of world is this that people press buttons that have no meaning?!?`b`0"; + header("Location: mail.php"); + }else{ + $sql = "DELETE FROM " . db_prefix("mail") . " WHERE msgto='".$session['user']['acctid']."' AND messageid IN ('".join("','",$msg)."')"; + db_query($sql); + invalidatedatacache("mail-{$session['user']['acctid']}"); + header("Location: mail.php"); + exit(); + } +}elseif ($op=="unread"){ + $sql = "UPDATE " . db_prefix("mail") . " SET seen=0 WHERE msgto='".$session['user']['acctid']."' AND messageid='$id'"; + db_query($sql); + invalidatedatacache("mail-{$session['user']['acctid']}"); + header("Location: mail.php"); + exit(); +} + +popup_header("Ye Olde Poste Office"); +$inbox = translate_inline("Inbox"); +$write = translate_inline("Write"); + +// Build the initial args array +$args = array(); +array_push($args, array("mail.php", $inbox)); +array_push($args, array("mail.php?op=address",$write)); +// to use this hook, +// just call array_push($args, array("pagename", "functionname"));, +// where "pagename" is the name of the page to forward the user to, +// and "functionname" is the name of the mail function to add +$mailfunctions = modulehook("mailfunctions", $args); + +//output_notl("", true); +rawoutput("
$inbox$write
"); +rawoutput(""); +for($i=0;$i$name"); + // addnav("", $page); + // No need for addnav since mail function pages are (or should + // be) outside the page nav system. + } + } +} +rawoutput("
"); +output_notl("`n`n"); + +if($op=="send"){ + $to = httppost('to'); + $sql = "SELECT acctid FROM " . db_prefix("accounts") . " WHERE login='$to'"; + $result = db_query($sql); + if (db_num_rows($result)>0){ + $row1 = db_fetch_assoc($result); + $sql = "SELECT count(messageid) AS count FROM " . db_prefix("mail") . " WHERE msgto='".$row1['acctid']."' AND seen=0"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + if ($row['count']>=getsetting("inboxlimit",50)) { + output("`\$You cannot send that person mail, their mailbox is full!`0`n`n"); + }else{ + $subject = str_replace("`n","",httppost('subject')); + $body = str_replace("`n","\n",httppost('body')); + $body = str_replace("\r\n","\n",$body); + $body = str_replace("\r","\n",$body); + $body = addslashes(substr(stripslashes($body),0,(int)getsetting("mailsizelimit",1024))); + + systemmail($row1['acctid'],$subject,$body,$session['user']['acctid']); + output("Your message was sent!`n"); + } + }else{ + output("Could not find the recipient, please try again.`n"); + } + if (httppost("returnto")>""){ + $op="read"; + httpset('op','read'); + $id = httppost('returnto'); + httpset('id',$id); + }else{ + $op=""; + httpset('op', ""); + } +} + +if ($op==""){ + output("`b`iMail Box`i`b"); + if (isset($session['message'])) { + output($session['message']); + } + $session['message']=""; + $sql = "SELECT subject,messageid," . db_prefix("accounts") . ".name,msgfrom,seen,sent FROM " . db_prefix("mail") . " LEFT JOIN " . db_prefix("accounts") . " ON " . db_prefix("accounts") . ".acctid=" . db_prefix("mail") . ".msgfrom WHERE msgto=\"".$session['user']['acctid']."\" ORDER BY sent DESC"; + $result = db_query($sql); + if (db_num_rows($result)>0){ + output_notl("
",true); + for ($i=0;$i",true); + output_notl("",true); + output_notl("",true); + output_notl("",true); + } + output_notl("
".($row[",true); + if (trim($row['subject'])=="") + output("`i(No Subject)`i"); + else + output_notl($row['subject']); + output_notl("",true); + output_notl($row['name']); + output_notl("".date("M d, h:i a",strtotime($row['sent']))."
",true); + $checkall = htmlentities(translate_inline("Check All")); + $out=""; + output_notl($out,true); + $delchecked = htmlentities(translate_inline("Delete Checked")); + output_notl("",true); + output_notl("
",true); + }else{ + output("`iAww, you have no mail, how sad.`i"); + } + output("`n`n`iYou currently have %s messages in your inbox.`nYou will no longer be able to receive messages from players if you have more than %s unread messages in your inbox. `nMessages are automatically deleted (read or unread) after %s days.",db_num_rows($result),getsetting('inboxlimit',50),getsetting("oldmail",14)); +}elseif ($op=="read"){ + $sql = "SELECT " . db_prefix("mail") . ".*,". db_prefix("accounts"). ".name FROM " . db_prefix("mail") ." LEFT JOIN " . db_prefix("accounts") . " ON ". db_prefix("accounts") . ".acctid=" . db_prefix("mail"). ".msgfrom WHERE msgto=\"".$session['user']['acctid']."\" AND messageid=\"".$id."\""; + $result = db_query($sql); + if (db_num_rows($result)>0){ + $row = db_fetch_assoc($result); + if ((int)$row['msgfrom']==0){ + $row['name']=translate_inline("`i`^System`0`i"); + // No translation for subject if it's not an array + if (is_array(@unserialize($row['subject']))) { + $row['subject'] = unserialize($row['subject']); + $row['subject'] = + call_user_func_array("sprintf_translate", $row['subject']); + } + // No translation for body if it's not an array + if (is_array(@unserialize($row['body']))) { + $row['body'] = unserialize($row['body']); + $row['body'] = + call_user_func_array("sprintf_translate", $row['body']); + } + } + if (!$row['seen']) output("`b`#NEW`b`n"); + else output("`n"); + output("`b`2From:`b `^%s`n",$row['name']); + output("`b`2Subject:`b `^%s`n",$row['subject']); + output("`b`2Sent:`b `^%s`n",$row['sent']); + output_notl("`n",true); + output_notl(str_replace("\n","`n",$row['body'])); + output_notl("`n`n",true); + + $sql = "UPDATE " . db_prefix("mail") . " SET seen=1 WHERE msgto=\"".$session['user']['acctid']."\" AND messageid=\"".$id."\""; + db_query($sql); + + $reply = translate_inline("Reply"); + $del = translate_inline("Delete"); + $unread = translate_inline("Mark Unread"); + $report = translate_inline("Report to Admin"); + $problem = "Abusive Email Report:\nFrom: {$row['name']}\nSubject: {$row['subject']}\nSent: {$row['sent']}\nID: {$row['messageid']}\nBody:\n{$row['body']}"; + rawoutput(" + + + + "); + // Don't allow reporting of system messages as abuse. + if ((int)$row['msgfrom']!=0) { + rawoutput(""); + } else { + rawoutput(""); + } + rawoutput(""); + $sql = "SELECT messageid FROM ".db_prefix("mail")." WHERE msgto='{$session['user']['acctid']}' AND messageid < '$id' ORDER BY messageid DESC LIMIT 1"; + $result = db_query($sql); + if (db_num_rows($result)>0){ + $row = db_fetch_assoc($result); + $pid = $row['messageid']; + }else{ + $pid = 0; + } + $sql = "SELECT messageid FROM ".db_prefix("mail")." WHERE msgto='{$session['user']['acctid']}' AND messageid > '$id' ORDER BY messageid LIMIT 1"; + $result = db_query($sql); + if (db_num_rows($result)>0){ + $row = db_fetch_assoc($result); + $nid = $row['messageid']; + }else{ + $nid = 0; + } + $prev = translate_inline("< Previous"); + $next = translate_inline("Next >"); + rawoutput(""); + rawoutput("
$reply$del
$unread$report 
"); + if ($pid > 0) rawoutput("".htmlentities($prev).""); + else rawoutput(htmlentities($prev)); + rawoutput(""); + if ($nid > 0) rawoutput("".htmlentities($next).""); + else rawoutput(htmlentities($next)); + rawoutput("
"); + }else{ + output("Eek, no such message was found!"); + } +}elseif($op=="address"){ + output_notl("
",true); + output("`b`2Address:`b`n"); + $to = translate_inline("To: "); + $search = htmlentities(translate_inline("Search")); + output_notl("`2$to
",true); +}elseif($op=="write"){ + $subject=httppost('subject'); + $body=""; + $row = ""; + output_notl("
",true); + $replyto = httpget('replyto'); + if ($replyto!=""){ + $sql = "SELECT ". db_prefix("mail") . ".body," . db_prefix("mail") . ".msgfrom, " . db_prefix("mail") . ".subject,". db_prefix("accounts") . ".login, superuser, " . db_prefix("accounts"). ".name FROM " . db_prefix("mail") . " LEFT JOIN " . db_prefix("accounts") . " ON " . db_prefix("accounts") . ".acctid=" . db_prefix("mail") . ".msgfrom WHERE msgto=\"".$session['user']['acctid']."\" AND messageid=\"".$replyto."\""; + $result = db_query($sql); + if (db_num_rows($result)>0){ + $row = db_fetch_assoc($result); + if ($row['login']=="") { + output("You cannot reply to a system message.`n"); + $row=array(); + } + }else{ + output("Eek, no such message was found!`n"); + } + } + $to = httpget('to'); + if ($to!=""){ + $sql = "SELECT login,name, superuser FROM " . db_prefix("accounts") . " WHERE login=\"$to\""; + $result = db_query($sql); + if (db_num_rows($result)>0){ + $row = db_fetch_assoc($result); + }else{ + output("Could not find that person.`n"); + } + } + if (is_array($row)){ + if (isset($row['subject']) && $row['subject']!=""){ + if ((int)$row['msgfrom']==0){ + $row['name']=translate_inline("`i`^System`0`i"); + // No translation for subject if it's not an array + if (is_array(@unserialize($row['subject']))) { + $row['subject'] = unserialize($row['subject']); + $row['subject'] = + call_user_func_array("sprintf_translate", + $row['subject']); + } + // No translation for body if it's not an array + if (is_array(@unserialize($row['body']))) { + $row['body'] = unserialize($row['body']); + $row['body'] = + call_user_func_array("sprintf_translate", + $row['body']); + } + } + $subject=$row['subject']; + if (substr($subject,0,4)!="RE: ") $subject="RE: $subject"; + } + if (isset($row['body']) && $row['body']!=""){ + $body="\n\n---".translate_inline("Original Message")."---\n".$row['body']; + } + } + rawoutput(""); + $superusers = array(); + if (isset($row['login']) && $row['login']!=""){ + output_notl("",true); + output("`2To: `^%s`n",$row['name']); + if (($row['superuser'] & SU_GIVES_YOM_WARNING) && + !($row['superuser'] & SU_OVERRIDE_YOM_WARNING)) { + array_push($superusers,$row['login']); + } + }else{ + output("`2To: "); + $to = httppost('to'); + $string="%"; + for ($x=0;$x",true); + output_notl("`^{$row['name']}`n"); + if (($row['superuser'] & SU_GIVES_YOM_WARNING) && + !($row['superuser'] & SU_OVERRIDE_YOM_WARNING)) { + array_push($superusers,$row['login']); + } + }elseif (db_num_rows($result)==0){ + output("`@No one was found who matches \"%s\". ",stripslashes($to)); + $try = translate_inline("Please try again"); + output_notl("$try.",true); + popup_footer(); + exit(); + }else{ + output_notl("`n",true); + } + } + rawoutput(""); + output("`2Subject:"); + rawoutput("
"); + rawoutput(""); + output("`2Body:`n"); + rawoutput("
"); + $send = translate_inline("Send"); + rawoutput("
"); + output_notl("",true); + $sizemsg = "`#Max message size is `@%s`#, you have `^XX`# characters left."; + $sizemsg = translate_inline($sizemsg); + $sizemsg = sprintf($sizemsg,getsetting("mailsizelimit",1024)); + $sizemsgover = "`\$Max message size is `@%s`\$, you are over by `^XX`\$ characters!"; + $sizemsgover = translate_inline($sizemsgover); + $sizemsgover = sprintf($sizemsgover,getsetting("mailsizelimit",1024)); + $sizemsg = explode("XX",$sizemsg); + $sizemsgover = explode("XX",$sizemsgover); + $usize1 = addslashes("".appoencode($sizemsg[0]).""); + $usize2 = addslashes("".appoencode($sizemsg[1]).""); + $osize1 = addslashes("".appoencode($sizemsgover[0]).""); + $osize2 = addslashes("".appoencode($sizemsgover[1]).""); + + rawoutput(" + "); +} +popup_footer(); +?> diff --git a/lotgd-web/lotgd/lib/mail/case_address.php b/lotgd-web/lotgd/lib/mail/case_address.php new file mode 100755 index 0000000..32edbbb --- /dev/null +++ b/lotgd-web/lotgd/lib/mail/case_address.php @@ -0,0 +1,15 @@ +",true); +output("`b`2Address:`b`n"); +$to = translate_inline("To: "); +$search = htmlentities(translate_inline("Search"), ENT_COMPAT, getsetting("charset", "ISO-8859-1")); +output_notl("`2$to ",true); +output_notl("", true); +if ($session['user']['superuser'] & SU_IS_GAMEMASTER) { + $from = translate_inline("From: "); + output_notl("`n`2$from `n", true); + output("`7`iLeave empty to send from your account!`i"); +} +rawoutput(""); +rawoutput(""); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/mail/case_default.php b/lotgd-web/lotgd/lib/mail/case_default.php new file mode 100755 index 0000000..894cc38 --- /dev/null +++ b/lotgd-web/lotgd/lib/mail/case_default.php @@ -0,0 +1,60 @@ +0){ + $no_subject = translate_inline("`i(No Subject)`i"); + rawoutput("
"); + while($row = db_fetch_assoc($result)){ + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + } + rawoutput("
"); + rawoutput("".($row["); + if ($row['msgfrom']==0 || !is_numeric($row['msgfrom'])){ + if ($row['msgfrom'] == 0 && is_numeric($row['msgfrom'])) { + $row['name']=translate_inline("`i`^System`0`i"); + } else { + $row['name']=$row['msgfrom']; + } + // Only translate the subject if it's an array, ie, it came from the game. + $row_subject = @unserialize($row['subject']); + if ($row_subject !== false) { + $row['subject'] = call_user_func_array("sprintf_translate", $row_subject); + } else { + $row['subject'] = translate_inline($row['subject']); + } + } + // In one line so the Translator doesn't screw the Html up + output_notl("".((trim($row['subject']))?$row['subject']:$no_subject)."", true); + rawoutput(""); + output_notl($row['name']); + rawoutput("".date("M d, h:i a",strtotime($row['sent']))."
"); + $checkall = htmlentities(translate_inline("Check All"), ENT_COMPAT, getsetting("charset", "ISO-8859-1")); + rawoutput(""); + $delchecked = htmlentities(translate_inline("Delete Checked"), ENT_COMPAT, getsetting("charset", "ISO-8859-1")); + rawoutput(""); + rawoutput("
"); +}else{ + output("`iAww, you have no mail, how sad.`i"); +} +if (db_num_rows($result) == 1) { + output("`n`n`iYou currently have 1 message in your inbox.`nYou will no longer be able to receive messages from players if you have more than %s unread messages in your inbox. `nMessages are automatically deleted (read or unread) after %s days.",getsetting('inboxlimit',50),getsetting("oldmail",14)); +} else { + output("`n`n`iYou currently have %s messages in your inbox.`nYou will no longer be able to receive messages from players if you have more than %s unread messages in your inbox. `nMessages are automatically deleted (read or unread) after %s days.",db_num_rows($result),getsetting('inboxlimit',50),getsetting("oldmail",14)); +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/mail/case_read.php b/lotgd-web/lotgd/lib/mail/case_read.php new file mode 100755 index 0000000..7e741c5 --- /dev/null +++ b/lotgd-web/lotgd/lib/mail/case_read.php @@ -0,0 +1,95 @@ +0){ + $row = db_fetch_assoc($result); + if ($row['msgfrom']==0 || !is_numeric($row['msgfrom'])){ + if ($row['msgfrom'] == 0 && is_numeric($row['msgfrom'])) { + $row['name']=translate_inline("`i`^System`0`i"); + } else { + $row['name']=$row['msgfrom']; + } + // No translation for subject if it's not an array + $row_subject = @unserialize($row['subject']); + if ($row_subject !== false) { + $row['subject'] = call_user_func_array("sprintf_translate", $row_subject); + } + // No translation for body if it's not an array + $row_body = @unserialize($row['body']); + if ($row_body !== false) { + $row['body'] = call_user_func_array("sprintf_translate", $row_body); + } + } + if (!$row['seen']) { + output("`b`#NEW`b`n"); + }else{ + output("`n"); + } + output("`b`2From:`b `^%s`n",$row['name']); + output("`b`2Subject:`b `^%s`n",$row['subject']); + output("`b`2Sent:`b `^%s`n",$row['sent']); + output_notl("`n",true); + output_notl(str_replace("\n","`n",$row['body'])); + output_notl("`n`n",true); + $sql = "UPDATE " . db_prefix("mail") . " SET seen=1 WHERE msgto=\"".$session['user']['acctid']."\" AND messageid=\"".$id."\""; + db_query($sql); + invalidatedatacache("mail-{$session['user']['acctid']}"); + $reply = translate_inline("Reply"); + $del = translate_inline("Delete"); + $unread = translate_inline("Mark Unread"); + $report = translate_inline("Report to Admin"); + $problem = "Abusive Email Report:\nFrom: {$row['name']}\nSubject: {$row['subject']}\nSent: {$row['sent']}\nID: {$row['messageid']}\nBody:\n{$row['body']}"; + rawoutput(""); + if ($row['msgfrom'] > 0 && is_numeric($row['msgfrom'])) { + rawoutput(""); + } else { + rawoutput(""); + } + rawoutput(" + + "); + // Don't allow reporting of system messages as abuse. + if ((int)$row['msgfrom']!=0) { + rawoutput(""); + } else { + rawoutput(""); + } + rawoutput(""); + $sql = "SELECT messageid FROM $mail WHERE msgto='{$session['user']['acctid']}' AND messageid < '$id' ORDER BY messageid DESC LIMIT 1"; + $result = db_query($sql); + if (db_num_rows($result)>0){ + $row = db_fetch_assoc($result); + $pid = $row['messageid']; + }else{ + $pid = 0; + } + $sql = "SELECT messageid FROM $mail WHERE msgto='{$session['user']['acctid']}' AND messageid > '$id' ORDER BY messageid LIMIT 1"; + $result = db_query($sql); + if (db_num_rows($result)>0){ + $row = db_fetch_assoc($result); + $nid = $row['messageid']; + }else{ + $nid = 0; + } + $prev = translate_inline("< Previous"); + $next = translate_inline("Next >"); + rawoutput(""); + rawoutput("
$reply $del
$unread$report 
"); + if ($pid > 0) { + rawoutput("".htmlentities($prev, ENT_COMPAT, getsetting("charset", "ISO-8859-1")).""); + }else{ + rawoutput(htmlentities($prev), ENT_COMPAT, getsetting("charset", "ISO-8859-1")); + } + rawoutput(""); + if ($nid > 0){ + rawoutput("".htmlentities($next, ENT_COMPAT, getsetting("charset", "ISO-8859-1")).""); + }else{ + rawoutput(htmlentities($next), ENT_COMPAT, getsetting("charset", "ISO-8859-1")); + } + rawoutput("
"); +}else{ + output("Eek, no such message was found!"); +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/mail/case_send.php b/lotgd-web/lotgd/lib/mail/case_send.php new file mode 100755 index 0000000..bea3038 --- /dev/null +++ b/lotgd-web/lotgd/lib/mail/case_send.php @@ -0,0 +1,49 @@ +0){ + $row1 = db_fetch_assoc($result); + if (getsetting("onlyunreadmails",true)) { + $maillimitsql = "AND seen=0"; + } else { + $maillimitsql = ""; + } + $sql = "SELECT count(messageid) AS count FROM " . db_prefix("mail") . " WHERE msgto='".$row1['acctid']."' $maillimitsql"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + if ($row['count']>=getsetting("inboxlimit",50)) { + output("`\$You cannot send that person mail, their mailbox is full!`0`n`n"); + }else{ + $subject = str_replace("`n","",httppost('subject')); + $body = str_replace("`n","\n",httppost('body')); + $body = str_replace("\r\n","\n",$body); + $body = str_replace("\r","\n",$body); + $body = addslashes(substr(stripslashes($body),0,(int)getsetting("mailsizelimit",1024))); + require_once("lib/systemmail.php"); + systemmail($row1['acctid'],$subject,$body,$from); + invalidatedatacache("mail-{$row1['acctid']}"); + output("Your message was sent!`n"); + } +}else{ + output("Could not find the recipient, please try again.`n"); +} +if(httppost("returnto")){ + $op="read"; + httpset('op','read'); + $id = httppost('returnto'); + httpset('id',$id); +}else{ + $op=""; + httpset('op', ""); +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/mail/case_write.php b/lotgd-web/lotgd/lib/mail/case_write.php new file mode 100755 index 0000000..686e107 --- /dev/null +++ b/lotgd-web/lotgd/lib/mail/case_write.php @@ -0,0 +1,171 @@ +"); +if ($session['user']['superuser'] & SU_IS_GAMEMASTER) { + rawoutput(""); +} +rawoutput(""); +$superusers = array(); +if (($session['user']['superuser'] & SU_IS_GAMEMASTER) && $from > "") { + output("`2From: `^%s`n", $from); +} +if (isset($row['login']) && $row['login']!=""){ + output_notl("",true); + output("`2To: `^%s`n",$row['name']); + if (($row['superuser'] & SU_GIVES_YOM_WARNING) && !($row['superuser'] & SU_OVERRIDE_YOM_WARNING)) { + array_push($superusers,$row['login']); + } +}else{ + output("`2To: "); + $to = httppost('to'); + $sql = "SELECT login,name,superuser FROM accounts WHERE login = '".addslashes($to)."' AND locked = 0"; + $result = db_query($sql); + $db_num_rows = db_num_rows($result); + if($db_num_rows != 1) { + $string="%"; + $to_len = strlen($to); + for($x=0; $x < $to_len; ++$x) { + $string .= $to{$x}."%"; + } + $sql = "SELECT login,name,superuser FROM " . db_prefix("accounts") . " WHERE name LIKE '".addslashes($string)."' AND locked=0 ORDER by login='$to' DESC, name='$to' DESC, login"; + $result = db_query($sql); + $db_num_rows = db_num_rows($result); + } + if ($db_num_rows==1){ + $row = db_fetch_assoc($result); + output_notl("",true); + output_notl("`^{$row['name']}`n"); + if (($row['superuser'] & SU_GIVES_YOM_WARNING) && !($row['superuser'] & SU_OVERRIDE_YOM_WARNING)) { + array_push($superusers,$row['login']); + } + }elseif ($db_num_rows==0){ + output("`\$No one was found who matches \"%s\".`n",stripslashes($to)); + output("`@Please try again.`n"); + httpset('prepop', $to, true); + rawoutput(""); + require("lib/mail/case_address.php"); + popup_footer(); + }else{ + output_notl("`n",true); + } +} +rawoutput(""); +output("`2Subject:"); +rawoutput("
"); +rawoutput(""); +output("`2Body:`n"); +require_once("lib/forms.php"); +previewfield("body", "`^", false, false, array("type"=>"textarea", "class"=>"input", "cols"=>"60", "rows"=>"9", "onKeyDown"=>"sizeCount(this);"), htmlentities($body, ENT_COMPAT, getsetting("charset", "ISO-8859-1")).htmlentities(stripslashes(httpget('body')), ENT_COMPAT, getsetting("charset", "ISO-8859-1"))); +//rawoutput("
"); +$send = translate_inline("Send"); +rawoutput("
"); +rawoutput(""); +$sizemsg = "`#Max message size is `@%s`#, you have `^XX`# characters left."; +$sizemsg = translate_inline($sizemsg); +$sizemsg = sprintf($sizemsg,getsetting("mailsizelimit",1024)); +$sizemsgover = "`\$Max message size is `@%s`\$, you are over by `^XX`\$ characters!"; +$sizemsgover = translate_inline($sizemsgover); +$sizemsgover = sprintf($sizemsgover,getsetting("mailsizelimit",1024)); +$sizemsg = explode("XX",$sizemsg); +$sizemsgover = explode("XX",$sizemsgover); +$usize1 = addslashes("".appoencode($sizemsg[0]).""); +$usize2 = addslashes("".appoencode($sizemsg[1]).""); +$osize1 = addslashes("".appoencode($sizemsgover[0]).""); +$osize2 = addslashes("".appoencode($sizemsgover[1]).""); +rawoutput(" +"); +?> diff --git a/lotgd-web/lotgd/lib/md5.js b/lotgd-web/lotgd/lib/md5.js new file mode 100755 index 0000000..95a8ae3 --- /dev/null +++ b/lotgd-web/lotgd/lib/md5.js @@ -0,0 +1,261 @@ +/* + * translator ready + * addnews ready + * mail ready + */ +/* + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for more info. + */ + +/* + * Configurable variables. You may need to tweak these to be compatible with + * the server-side, but the defaults work in most cases. + */ +var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */ +var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */ +var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */ + +/* + * These are the functions you'll usually want to call + * They take string arguments and return either hex or base-64 encoded strings + */ +function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));} +function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));} +function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));} +function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); } +function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); } +function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); } + +/* + * Perform a simple self-test to see if the VM is working + */ +function md5_vm_test() +{ + return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"; +} + +/* + * Calculate the MD5 of an array of little-endian words, and a bit length + */ +function core_md5(x, len) +{ + /* append padding */ + x[len >> 5] |= 0x80 << ((len) % 32); + x[(((len + 64) >>> 9) << 4) + 14] = len; + + var a = 1732584193; + var b = -271733879; + var c = -1732584194; + var d = 271733878; + + for(var i = 0; i < x.length; i += 16) + { + var olda = a; + var oldb = b; + var oldc = c; + var oldd = d; + + a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936); + d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586); + c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819); + b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330); + a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897); + d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426); + c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341); + b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983); + a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416); + d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417); + c = md5_ff(c, d, a, b, x[i+10], 17, -42063); + b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162); + a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682); + d = md5_ff(d, a, b, c, x[i+13], 12, -40341101); + c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290); + b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329); + + a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510); + d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632); + c = md5_gg(c, d, a, b, x[i+11], 14, 643717713); + b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302); + a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691); + d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083); + c = md5_gg(c, d, a, b, x[i+15], 14, -660478335); + b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848); + a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438); + d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690); + c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961); + b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501); + a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467); + d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784); + c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473); + b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734); + + a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558); + d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463); + c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562); + b = md5_hh(b, c, d, a, x[i+14], 23, -35309556); + a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060); + d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353); + c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632); + b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640); + a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174); + d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222); + c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979); + b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189); + a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487); + d = md5_hh(d, a, b, c, x[i+12], 11, -421815835); + c = md5_hh(c, d, a, b, x[i+15], 16, 530742520); + b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651); + + a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844); + d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415); + c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905); + b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055); + a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571); + d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606); + c = md5_ii(c, d, a, b, x[i+10], 15, -1051523); + b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799); + a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359); + d = md5_ii(d, a, b, c, x[i+15], 10, -30611744); + c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380); + b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649); + a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070); + d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379); + c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259); + b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551); + + a = safe_add(a, olda); + b = safe_add(b, oldb); + c = safe_add(c, oldc); + d = safe_add(d, oldd); + } + return Array(a, b, c, d); + +} + +/* + * These functions implement the four basic operations the algorithm uses. + */ +function md5_cmn(q, a, b, x, s, t) +{ + return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b); +} +function md5_ff(a, b, c, d, x, s, t) +{ + return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); +} +function md5_gg(a, b, c, d, x, s, t) +{ + return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); +} +function md5_hh(a, b, c, d, x, s, t) +{ + return md5_cmn(b ^ c ^ d, a, b, x, s, t); +} +function md5_ii(a, b, c, d, x, s, t) +{ + return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); +} + +/* + * Calculate the HMAC-MD5, of a key and some data + */ +function core_hmac_md5(key, data) +{ + var bkey = str2binl(key); + if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz); + + var ipad = Array(16), opad = Array(16); + for(var i = 0; i < 16; i++) + { + ipad[i] = bkey[i] ^ 0x36363636; + opad[i] = bkey[i] ^ 0x5C5C5C5C; + } + + var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz); + return core_md5(opad.concat(hash), 512 + 128); +} + +/* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ +function safe_add(x, y) +{ + var lsw = (x & 0xFFFF) + (y & 0xFFFF); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); +} + +/* + * Bitwise rotate a 32-bit number to the left. + */ +function bit_rol(num, cnt) +{ + return (num << cnt) | (num >>> (32 - cnt)); +} + +/* + * Convert a string to an array of little-endian words + * If chrsz is ASCII, characters >255 have their hi-byte silently ignored. + */ +function str2binl(str) +{ + var bin = Array(); + var mask = (1 << chrsz) - 1; + for(var i = 0; i < str.length * chrsz; i += chrsz) + bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32); + return bin; +} + +/* + * Convert an array of little-endian words to a string + */ +function binl2str(bin) +{ + var str = ""; + var mask = (1 << chrsz) - 1; + for(var i = 0; i < bin.length * 32; i += chrsz) + str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask); + return str; +} + +/* + * Convert an array of little-endian words to a hex string. + */ +function binl2hex(binarray) +{ + var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; + var str = ""; + for(var i = 0; i < binarray.length * 4; i++) + { + str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) + + hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF); + } + return str; +} + +/* + * Convert an array of little-endian words to a base-64 string + */ +function binl2b64(binarray) +{ + var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + var str = ""; + for(var i = 0; i < binarray.length * 4; i += 3) + { + var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16) + | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 ) + | ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF); + for(var j = 0; j < 4; j++) + { + if(i * 8 + j * 6 > binarray.length * 32) str += b64pad; + else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F); + } + } + return str; +} diff --git a/lotgd-web/lotgd/lib/modules.php b/lotgd-web/lotgd/lib/modules.php new file mode 100755 index 0000000..b7c1b3f --- /dev/null +++ b/lotgd-web/lotgd/lib/modules.php @@ -0,0 +1,1459 @@ +array(),0=>array()); + +function injectmodule($modulename,$force=false){ + global $mostrecentmodule,$injected_modules; + //try to circumvent the array_key_exists() problem we've been having. + if ($force) $force = 1; else $force = 0; + + //early escape if we already called injectmodule this hit with the + //same args. + if (isset($injected_modules[$force][$modulename])) { + $mostrecentmodule=$modulename; + return $injected_modules[$force][$modulename]; + } + + $modulename = modulename_sanitize($modulename); + $modulefilename = "modules/{$modulename}.php"; + if (file_exists($modulefilename)){ + tlschema("module-{$modulename}"); + $sql = "SELECT active,filemoddate,infokeys,version FROM " . db_prefix("modules") . " WHERE modulename='$modulename'"; + $result = db_query_cached($sql, "inject-$modulename", 3600); + if (!$force) { + //our chance to abort if this module isn't currently installed + //or doesn't meet the prerequisites. + if (db_num_rows($result)==0) { + tlschema(); + output_notl("`n`3Module `#%s`3 is not installed, but was attempted to be injected.`n",$modulename); + $injected_modules[$force][$modulename]=false; + return false; + } + $row = db_fetch_assoc($result); + if ($row['active']){ } else { + tlschema(); + output("`n`3Module `#%s`3 is not active, but was attempted to be injected.`n",$modulename); + $injected_modules[$force][$modulename]=false; + return false; + } + } + require_once($modulefilename); + $mostrecentmodule = $modulename; + $info = ""; + if (!$force){ + //avoid calling the function if we're forcing the module + $fname = $modulename."_getmoduleinfo"; + $info = $fname(); + if (!isset($info['requires'])) $info['requires'] = array(); + if (!is_array($info['requires'])) $info['requires'] = array(); + if (!isset($info['download'])) $info['download']=""; + if (!isset($info['description'])) $info['description']=""; + if (!module_check_requirements($info['requires'])) { + $injected_modules[$force][$modulename]=false; + tlschema(); + output("`n`3Module `#%s`3 does not meet its prerequisites.`n",$modulename); + return false; + } + } + //check to see if the module needs to be upgraded. + if (db_num_rows($result)>0){ + if (!isset($row)) $row = db_fetch_assoc($result); + $filemoddate = date("Y-m-d H:i:s",filemtime($modulefilename)); + if ($row['filemoddate']!=$filemoddate || $row['infokeys']=="" || + $row['infokeys'][0] != '|' || $row['version']==''){ + //The file has recently been modified, lock tables and + //check again (knowing we're the only one who can do this + //at one shot) + $sql = "LOCK TABLES " . db_prefix("modules") . " WRITE"; + db_query($sql); + //check again after the table has been locked. + $sql = "SELECT filemoddate FROM " . db_prefix("modules") . " WHERE modulename='$modulename'"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + if ($row['filemoddate']!=$filemoddate || + !isset($row['infokeys']) || $row['infokeys']=="" || $row['infokeys'][0] != '|' || + $row['version']==''){ + //the file mod time is still different from that + //recorded in the database, time to update the database + //and upgrade the module. + debug("The module $modulename was found to have updated, upgrading the module now."); + if (!is_array($info)){ + //we might have gotten this info above, if not, + //we need it now. + $fname = $modulename."_getmoduleinfo"; + $info = $fname(); + if (!isset($info['download'])) + $info['download']=""; + if (!isset($info['version'])) + $info['version']="0.0"; + if (!isset($info['description'])) + $info['description'] = ''; + } + //Everyone else will block at the initial lock tables, + //we'll update, and on their second check, they'll fail. + //Only we will update the table. + + $keys = "|".join(array_keys($info), "|")."|"; + + $sql = "UPDATE ". db_prefix("modules") . " SET moduleauthor='".addslashes($info['author'])."', category='".addslashes($info['category'])."', formalname='".addslashes($info['name'])."', description='".addslashes($info['description'])."', filemoddate='$filemoddate', infokeys='$keys',version='".addslashes($info['version'])."',download='".addslashes($info['download'])."' WHERE modulename='$modulename'"; + db_query($sql); + debug($sql); + $sql = "UNLOCK TABLES"; + db_query($sql); + // Remove any old hooks (install will reset them) + module_wipehooks(); + $fname = $modulename."_install"; + if ($fname() === false) { + return false; + } + invalidatedatacache("inject-$modulename"); + + }else{ + $sql = "UNLOCK TABLES"; + db_query($sql); + } + } + } + tlschema(); + $injected_modules[$force][$modulename]=true; + return true; + }else{ + output("`n`\$Module `^%s`\$ was not found in the modules directory.`n",$modulename); + $injected_modules[$force][$modulename]=false; + return false; + } +} + +/* + * Returns the status of a module as a bitfield + * + * @param string $modulename The module name + * @param string $version The version to check for (false for don't care) + * @return int The status codes for the module + */ +function module_status($modulename, $version=false) { + global $injected_modules; + + $modulename = modulename_sanitize($modulename); + $modulefilename = "modules/$modulename.php"; + $status = MODULE_NO_INFO; + if (file_exists($modulefilename)) { + $sql = "SELECT active,filemoddate,infokeys,version FROM " . db_prefix("modules") . " WHERE modulename='$modulename'"; + $result = db_query_cached($sql, "inject-$modulename", 3600); + if (db_num_rows($result) > 0) { + // The module is installed + $status = MODULE_INSTALLED; + $row = db_fetch_assoc($result); + if ($row['active']) { + // Module is here and active + $status |= MODULE_ACTIVE; + // In this case, the module could have been force injected or + // not. We still want to mark it either way. + if (array_key_exists($modulename, $injected_modules[0]) && + $injected_modules[0][$modulename]) + $status |= MODULE_INJECTED; + if (array_key_exists($modulename, $injected_modules[1]) && + $injected_modules[1][$modulename]) + $status |= MODULE_INJECTED; + } else { + // Force-injected modules can be injected but not active. + if (array_key_exists($modulename, $injected_modules[1]) && + $injected_modules[1][$modulename]) + $status |= MODULE_INJECTED; + } + // Check the version number + if ($version===false) { + $status |= MODULE_VERSION_OK; + } else { + if (module_compare_versions($row['version'], $version) < 0) { + $status |= MODULE_VERSION_TOO_LOW; + } else { + $status |= MODULE_VERSION_OK; + } + } + } else { + // The module isn't installed + $status = MODULE_NOT_INSTALLED; + } + } else { + // The module file doesn't exist. + $status = MODULE_FILE_NOT_PRESENT; + } + return $status; +} + + +/** + * Determines if a module is activated + * + * @param string $modulename The module name + * @return bool If the module is active or not + */ +function is_module_active($modulename){ + return (module_status($modulename) & MODULE_ACTIVE); +} + +/** + * Determines if a module is installed + * + * @param string $modulename The module name + * @param string $version The version to check for + * @return bool If the module is installed + */ +function is_module_installed($modulename,$version=false){ + // Status will say the version is okay if we don't care about the + // version or if the version is actually correct + return (module_status($modulename, $version) & + (MODULE_INSTALLED|MODULE_VERSION_OK)); +} + +/** + * Checks if the module requirements are satisfied. Should a module require + * other modules to be installed and active, then optionally makes them so + * + * @param array $reqs Requirements of a module from _getmoduleinfo() + * @return bool If successful or not + */ +function module_check_requirements($reqs, $forceinject=false){ + // Since we can inject here, we need to save off the module we're on + global $mostrecentmodule; + + $oldmodule = $mostrecentmodule; + $result = true; + + if (!is_array($reqs)) return false; + + // Check the requirements. + reset($reqs); + while (list($key,$val)=each($reqs)){ + $info = explode("|",$val); + if (!is_module_installed($key,$info[0])) { + return false; + } + // This is actually cheap since we cache the result + $status = module_status($key); + // If it's not injected and we should force it, do so. + if (!($status & MODULE_INJECTED) && $forceinject) { + $result = $result && injectmodule($key); + } + } + + $mostrecentmodule = $oldmodule; + return $result; +} + +/** + * Blocks a module from being able to hook for the rest of the page hit. + * Please note, any hooks already executed by the blocked module will + * not be undone, so this function is pretty flaky all around. + * + * The only way to use this safely would be to block/unblock modules from + * the everyhit hook and make sure to shortcircuit for any page other than + * the one you care about. + * + * @param mixed $modulename The name of the module you wish to block or true if you want to block all modules. + * @return void + */ +$block_all_modules = false; +$blocked_modules = array(); +function blockmodule($modulename) { + global $blocked_modules, $block_all_modules, $currenthook; + + if ($modulename === true) { + $block_all_modules = true; + return; + } + $blocked_modules[$modulename]=1; +} + +/** + * Unblocks a module from being able to hook for the rest of the page hit. + * Please note, any hooks already blocked for the module being unblocked + * have been lost, so this function is pretty flaky all around. + * + * The only way to use this safely would be to block/unblock modules from + * the everyhit hook and make sure to shortcircuit for any page other than + * the one you care about. + * + * @param mixed $modulename The name of the module you wish to unblock or true if you want to unblock all modules. + * @return void + */ +$unblocked_modules = array(); +function unblockmodule($modulename) { + global $unblocked_modules, $block_all_modules; + + if ($modulename === true) { + $block_all_modules = false; + return; + } + $unblocked_modules[$modulename]=1; +} + +$module_preload = array(); +/** + * Preloads data for multiple modules in one shot rather than + * having to make SQL calls for each hook, when many of the hooks + * are found on every page. + * @param array $hooknames Names of hooks whose attached modules should be preloaded. + * @return bool Success + */ +function mass_module_prepare($hooknames){ + sort($hooknames); + $Pmodules = db_prefix("modules"); + $Pmodule_hooks = db_prefix("module_hooks"); + $Pmodule_settings = db_prefix("module_settings"); + $Pmodule_userprefs = db_prefix("module_userprefs"); + + global $modulehook_queries; + global $module_preload; + global $module_settings; + global $module_prefs; + global $session; + + //collect the modules who attach to these hooks. + $sql = + "SELECT + $Pmodule_hooks.modulename, + $Pmodule_hooks.location, + $Pmodule_hooks.function, + $Pmodule_hooks.whenactive + FROM + $Pmodule_hooks + INNER JOIN + $Pmodules + ON $Pmodules.modulename = $Pmodule_hooks.modulename + WHERE + active = 1 + AND location IN ('".join("', '",$hooknames)."') + ORDER BY + $Pmodule_hooks.location, + $Pmodule_hooks.priority, + $Pmodule_hooks.modulename"; + $result = db_query_cached($sql,"moduleprepare-".md5(join($hooknames))); + $modulenames = array(); + while ($row = db_fetch_assoc($result)){ + $modulenames[$row['modulename']] = $row['modulename']; + if (!isset($module_preload[$row['location']])) { + $module_preload[$row['location']] = array(); + $modulehook_queries[$row['location']] = array(); + } + //a little black magic trickery: formatting entries in + //$modulehook_queries the same way that db_query_cached + //returns query results. + array_push($modulehook_queries[$row['location']],$row); + $module_preload[$row['location']][$row['modulename']] = $row['function']; + } + //SQL IN() syntax for the modules involved here. + $modulelist = "'".join("', '",$modulenames)."'"; + + //Load the settings for the modules on these hooks. + $sql = + "SELECT + modulename, + setting, + value + FROM + $Pmodule_settings + WHERE + modulename IN ($modulelist)"; + $result = db_query($sql); + while ($row = db_fetch_assoc($result)){ + $module_settings[$row['modulename']][$row['setting']] = $row['value']; + } + + //Load the current user's prefs for the modules on these hooks. + $sql = + "SELECT + modulename, + setting, + userid, + value + FROM + $Pmodule_userprefs + WHERE + modulename IN ($modulelist) + AND userid = ".(int)$session['user']['acctid']; + $result = db_query($sql); + while ($row = db_fetch_assoc($result)){ + $module_prefs[$row['userid']][$row['modulename']][$row['setting']] = $row['value']; + } + return true; +} + +/** + * An event that should be triggered + * + * @param string $hookname The name of the event to raise + * @param array $args Arguments that should be passed to the event handler + * @param bool $allowinactive Allow inactive modules + * @param bool $only Only this module? + * @return array The args modified by the event handlers + */ +$currenthook = ""; +function modulehook($hookname, $args=false, $allowinactive=false, $only=false){ + global $navsection, $mostrecentmodule; + global $blocked_modules, $block_all_modules, $unblocked_modules; + global $output, $session, $modulehook_queries; + global $currenthook; + $lasthook = $currenthook; + $currenthook = $hookname; + static $hookcomment = array(); + if ($args===false) $args = array(); + $active = ""; + if (!$allowinactive) $active = " ". db_prefix("modules") .".active=1 AND"; + if (!is_array($args)){ + $where = $mostrecentmodule; + if (!$where) { + global $SCRIPT_NAME; + $where = $SCRIPT_NAME; + } + debug("Args parameter to modulehook $hookname from $where is not an array."); + } + if ($session['user']['superuser'] & SU_DEBUG_OUTPUT && !isset($hookcomment[$hookname])){ + rawoutput(""); + $hookcomment[$hookname]=true; + } + if (isset($modulehook_queries[$hookname]) //This data was pre fetched in mass_module_prepare + && $allowinactive == false //We only ever prefetch for active modules, if we're doing inactive, do the regular query. + ){ + $result = $modulehook_queries[$hookname]; + }else{ + $sql = + "SELECT + " . db_prefix("module_hooks") . ".modulename, + " . db_prefix("module_hooks") . ".location, + " . db_prefix("module_hooks") . ".function, + " . db_prefix("module_hooks") . ".whenactive + FROM + " . db_prefix("module_hooks") . " + INNER JOIN + " . db_prefix("modules") . " + ON " . db_prefix("modules") . ".modulename = " . db_prefix("module_hooks") . ".modulename + WHERE + $active + " . db_prefix("module_hooks") . ".location='$hookname' + ORDER BY + " . db_prefix("module_hooks") . ".priority, + " . db_prefix("module_hooks") . ".modulename"; + $result = db_query_cached($sql,"hook-".$hookname); + } + // $args is an array passed by value and we take the output and pass it + // back through + // Try at least and fix up a bogus arg so it doesn't cause additional + // problems later. + if (!is_array($args)) { + $args = array('bogus_args'=>$args); + } + + // Save off the mostrecent module since having that change can change + // behaviour especially if a module calls modulehooks itself or calls + // library functions which cause them to be called. + $mod = $mostrecentmodule; + + while ($row = db_fetch_assoc($result)){ + // If we are only running hooks for a specific module, skip all + // others. + if ($only !== false && $row['modulename']!=$only) continue; + // Skip any module invocations which should be blocked. + + if (!array_key_exists($row['modulename'],$blocked_modules)){ + $blocked_modules[$row['modulename']] = false; + } + if (!array_key_exists($row['modulename'],$unblocked_modules)){ + $unblocked_modules[$row['modulename']] = false; + } + if (($block_all_modules || $blocked_modules[$row['modulename']]) && + !$unblocked_modules[$row['modulename']]) { + continue; + } + + if (injectmodule($row['modulename'], $allowinactive)) { + $oldnavsection = $navsection; + tlschema("module-{$row['modulename']}"); + // Pass the args into the function and reassign them to the + // result of the function. + // Note: each module gets the previous module's modified return + // value if more than one hook here. + // Order of operations could become an issue, modules are called + // in alphabetical order by their module name (not display name). + + // Test the condition code + if (!array_key_exists('whenactive',$row)) $row['whenactive'] = ''; + $cond = trim($row['whenactive']); + if ($cond == "" || module_condition($cond) == true) { + // call the module's hook code + $outputbeforehook = $output; + $output=""; +/*******************************************************/ + $starttime = getmicrotime(); +/*******************************************************/ + if (function_exists($row['function'])) { + $res = $row['function']($hookname, $args); + } else { + trigger_error("Unknown function {$row['function']} for hoookname $hookname in module {$row['module']}.", E_USER_WARNING); + } +/*******************************************************/ + $endtime = getmicrotime(); + if (($endtime - $starttime >= 1.00 && ($session['user']['superuser'] & SU_DEBUG_OUTPUT))){ + debug("Slow Hook (".round($endtime-$starttime,2)."s): $hookname - {$row['modulename']}`n"); + } +/*******************************************************/ + $outputafterhook = $output; + $output=$outputbeforehook; + // test to see if we had any output and if the module allows + // us to collapse it + $testout = trim(sanitize_html($outputafterhook)); + if (!is_array($res)) { + trigger_error("{$row['function']} did not return an array in the module {$row['modulename']} for hook $hookname.",E_USER_WARNING); + $res = $args; + } + if ($testout >"" && + $hookname!="collapse{" && + $hookname!="}collapse" && + $hookname!="collapse-nav{" && + $hookname!="}collapse-nav" && + !array_key_exists('nocollapse',$res)) { + //restore the original output's reference + modulehook("collapse{", + array("name"=>'a-'.$row['modulename'])); + $output .= $outputafterhook; + modulehook("}collapse"); + } else { + $output .= $outputafterhook; + } + // Clear the collapse flag + unset($res['nocollapse']); + //handle return arguments. + if (is_array($res)) $args = $res; + } + + //revert the translation namespace + tlschema(); + //revert nav section after we're done here. + $navsection = $oldnavsection; + } + } + + $mostrecentmodule=$mod; + $currenthook = $lasthook; + + // And hand them back so they can be used. + return $args; +} + +$module_settings = array(); +function get_all_module_settings($module=false){ + //returns an associative array of all the settings for the given module + global $module_settings,$mostrecentmodule; + if ($module === false) $module = $mostrecentmodule; + + load_module_settings($module); + return $module_settings[$module]; +} + +function get_module_setting($name,$module=false){ + global $module_settings,$mostrecentmodule; + if ($module === false) $module = $mostrecentmodule; + + load_module_settings($module); + if (isset($module_settings[$module][$name])) { + return $module_settings[$module][$name]; + }else{ + $info = get_module_info($module); + if (isset($info['settings'][$name])){ + if (is_array($info['settings'][$name])) { + $v = $info['settings'][$name][0]; + $x = explode("|", $v); + } else { + $x = explode("|",$info['settings'][$name]); + } + if (isset($x[1])){ + return $x[1]; + } + } + return NULL; + } +} + +function set_module_setting($name,$value,$module=false){ + if ($name == "showFormTabIndex") return true; + global $module_settings,$mostrecentmodule; + if ($module === false) $module = $mostrecentmodule; + load_module_settings($module); + if (isset($module_settings[$module][$name])){ + $sql = "UPDATE " . db_prefix("module_settings") . " SET value='".addslashes($value)."' WHERE modulename='$module' AND setting='".addslashes($name)."'"; + db_query($sql); + }else{ + $sql = "INSERT INTO " . db_prefix("module_settings") . " (modulename,setting,value) VALUES ('$module','".addslashes($name)."','".addslashes($value)."')"; + db_query($sql); + } + invalidatedatacache("modulesettings-$module"); + $module_settings[$module][$name] = $value; +} + +function increment_module_setting($name, $value=1, $module=false){ + global $module_settings,$mostrecentmodule; + $value = (float)$value; + if ($module === false) $module = $mostrecentmodule; + load_module_settings($module); + if (isset($module_settings[$module][$name])){ + $sql = "UPDATE " . db_prefix("module_settings") . " SET value=value+$value WHERE modulename='$module' AND setting='".addslashes($name)."'"; + db_query($sql); + }else{ + $sql = "INSERT INTO " . db_prefix("module_settings") . " (modulename,setting,value) VALUES ('$module','".addslashes($name)."','".addslashes($value)."')"; + db_query($sql); + } + invalidatedatacache("modulesettings-$module"); + $module_settings[$module][$name] += $value; +} + +function clear_module_settings($module=false){ + global $module_settings,$mostrecentmodule; + if ($module === false) $module = $mostrecentmodule; + if (isset($module_settings[$module])){ + debug("Deleted module settings cache for $module."); + unset($module_settings[$module]); + invalidatedatacache("modulesettings-$module"); + } +} + +function load_module_settings($module){ + global $module_settings; + if (!isset($module_settings[$module])){ + $module_settings[$module] = array(); + $sql = "SELECT * FROM " . db_prefix("module_settings") . " WHERE modulename='$module'"; + $result = db_query_cached($sql,"modulesettings-$module"); + while ($row = db_fetch_assoc($result)){ + $module_settings[$module][$row['setting']] = $row['value']; + }//end while + }//end if +}//end function + + +function module_delete_objprefs($objtype, $objid) +{ + $sql = "DELETE FROM " . db_prefix("module_objprefs") . " WHERE objtype='$objtype' AND objid='$objid'"; + db_query($sql); + massinvalidate("objpref-$objtype-$objid"); +} + +function get_module_objpref($type, $objid, $name, $module=false){ + global $mostrecentmodule; + if ($module === false) $module = $mostrecentmodule; + $sql = "SELECT value FROM ".db_prefix("module_objprefs")." WHERE modulename='$module' AND objtype='$type' AND setting='".addslashes($name)."' AND objid='$objid' "; + $result = db_query_cached($sql, "objpref-$type-$objid-$name-$module", 86400); + if (db_num_rows($result)>0){ + $row = db_fetch_assoc($result); + return $row['value']; + } + //we couldn't find this elsewhere, load the default value if it exists. + $info = get_module_info($module); + if (isset($info['prefs-'.$type][$name])){ + if (is_array($info['prefs-'.$type][$name])) { + $v = $info['prefs-'.$type][$name][0]; + $x = explode("|", $v); + } else { + $x = explode("|",$info['prefs-'.$type][$name]); + } + if (isset($x[1])){ + set_module_objpref($type,$objid,$name,$x[1],$module); + return $x[1]; + } + } + return NULL; +} + +function set_module_objpref($objtype,$objid,$name,$value,$module=false){ + global $mostrecentmodule; + if ($module === false) $module = $mostrecentmodule; + // Delete the old version and insert the new + $sql = "REPLACE INTO " . db_prefix("module_objprefs") . "(modulename,objtype,setting,objid,value) VALUES ('$module', '$objtype', '$name', '$objid', '".addslashes($value)."')"; + db_query($sql); + invalidatedatacache("objpref-$objtype-$objid-$name-$module"); +} + +function increment_module_objpref($objtype,$objid,$name,$value=1,$module=false) { + global $mostrecentmodule; + $value = (float)$value; + if ($module === false) $module = $mostrecentmodule; + $sql = "UPDATE " . db_prefix("module_objprefs") . " SET value=value+$value WHERE modulename='$module' AND setting='".addslashes($name)."' AND objtype='".addslashes($objtype)."' AND objid=$objid;"; + $result= db_query($sql); + if (db_affected_rows($result)==0){ + //if the update did not do anything, insert the row + $sql = "INSERT INTO " . db_prefix("module_objprefs") . "(modulename,objtype,setting,objid,value) VALUES ('$module', '$objtype', '$name', '$objid', '".addslashes($value)."')"; + db_query($sql); + } + invalidatedatacache("objpref-$objtype-$objid-$name-$module"); +} + + +function module_delete_userprefs($user){ + $sql = "DELETE FROM " . db_prefix("module_userprefs") . " WHERE userid='$user'"; + db_query($sql); +} + +$module_prefs=array(); +function get_all_module_prefs($module=false,$user=false){ + global $module_prefs,$mostrecentmodule,$session; + if ($module === false) $module = $mostrecentmodule; + if ($user === false) $user = $session['user']['acctid']; + load_module_prefs($module,$user); + + return $module_prefs[$user][$module]; +} + +function get_module_pref($name,$module=false,$user=false){ + global $module_prefs,$mostrecentmodule,$session; + if ($module === false) $module = $mostrecentmodule; + if ($user===false) { + if(isset($session['user']['loggedin']) && $session['user']['loggedin']) $user = $session['user']['acctid']; + else $user = 0; + } + + if (isset($module_prefs[$user][$module][$name])) { + return $module_prefs[$user][$module][$name]; + } + + //load here, not before + load_module_prefs($module,$user); + //check if *now* it's loaded + if (isset($module_prefs[$user][$module][$name])) { + return $module_prefs[$user][$module][$name]; + } + + if (!is_module_active($module)) return NULL; + + //we couldn't find this elsewhere, load the default value if it exists. + $info = get_module_info($module); + if (isset($info['prefs'][$name])){ + if (is_array($info['prefs'][$name])) { + $v = $info['prefs'][$name][0]; + $x = explode("|", $v); + } else { + $x = explode("|",$info['prefs'][$name]); + } + if (isset($x[1])){ + set_module_pref($name,$x[1],$module,$user); + return $x[1]; + } + } + return NULL; +} + +function set_module_pref($name,$value,$module=false,$user=false){ + global $module_prefs,$mostrecentmodule,$session; + if ($module === false) $module = $mostrecentmodule; + if ($user === false) $uid=$session['user']['acctid']; + else $uid = $user; + load_module_prefs($module, $uid); + + //don't write to the DB if the user isn't logged in. + if (!$session['user']['loggedin'] && !$user) { + // We do need to save to the loaded copy here however + $module_prefs[$uid][$module][$name] = $value; + return; + } + + if (isset($module_prefs[$uid][$module][$name])){ + $sql = "UPDATE " . db_prefix("module_userprefs") . " SET value='".addslashes($value)."' WHERE modulename='$module' AND setting='$name' AND userid='$uid'"; + db_query($sql); + }else{ + $sql = "INSERT INTO " . db_prefix("module_userprefs"). " (modulename,setting,userid,value) VALUES ('$module','$name','$uid','".addslashes($value)."')"; + db_query($sql); + } + $module_prefs[$uid][$module][$name] = $value; +} + +function increment_module_pref($name,$value=1,$module=false,$user=false){ + global $module_prefs,$mostrecentmodule,$session; + $value = (float)$value; + if ($module === false) $module = $mostrecentmodule; + if ($user === false) $uid=$session['user']['acctid']; + else $uid = $user; + load_module_prefs($module, $uid); + + //don't write to the DB if the user isn't logged in. + if (!$session['user']['loggedin'] && !$user) { + // We do need to save to the loaded copy here however + $module_prefs[$uid][$module][$name] += $value; + return; + } + + if (isset($module_prefs[$uid][$module][$name])){ + $sql = "UPDATE " . db_prefix("module_userprefs") . " SET value=value+$value WHERE modulename='$module' AND setting='$name' AND userid='$uid'"; + db_query($sql); + $module_prefs[$uid][$module][$name] += $value; + }else{ + $sql = "INSERT INTO " . db_prefix("module_userprefs"). " (modulename,setting,userid,value) VALUES ('$module','$name','$uid','".addslashes($value)."')"; + db_query($sql); + $module_prefs[$uid][$module][$name] = $value; + } +} + +function clear_module_pref($name,$module=false,$user=false){ + global $module_prefs,$mostrecentmodule,$session; + if ($module === false) $module = $mostrecentmodule; + if ($user === false) $uid=$session['user']['acctid']; + else $uid = $user; + load_module_prefs($module, $uid); + + //don't write to the DB if the user isn't logged in. + if (!$session['user']['loggedin'] && !$user) { + // We do need to trash the loaded copy here however + unset($module_prefs[$uid][$module][$name]); + return; + } + + if (isset($module_prefs[$uid][$module][$name])){ + $sql = "DELETE FROM " . db_prefix("module_userprefs") . " WHERE modulename='$module' AND setting='$name' AND userid='$uid'"; + db_query($sql); + } + unset($module_prefs[$uid][$module][$name]); +} + +function load_module_prefs($module, $user=false){ + global $module_prefs,$session; + if ($user===false) $user = $session['user']['acctid']; + if (!isset($module_prefs[$user])) $module_prefs[$user] = array(); + if (!isset($module_prefs[$user][$module])){ + $module_prefs[$user][$module] = array(); + $sql = "SELECT setting,value FROM " . db_prefix("module_userprefs") . " WHERE modulename='$module' AND userid='$user'"; + $result = db_query($sql); + while ($row = db_fetch_assoc($result)){ + $module_prefs[$user][$module][$row['setting']] = $row['value']; + }//end while + }//end if +}//end function + +function get_module_info($shortname){ + global $mostrecentmodule; + + $moduleinfo = array(); + + // Save off the mostrecent module. + $mod = $mostrecentmodule; + + if(injectmodule($shortname,true)) { + $fname = $shortname."_getmoduleinfo"; + if (function_exists($fname)){ + tlschema("module-$shortname"); + $moduleinfo = $fname(); + tlschema(); + // Don't pick up this text unless we need it. + if (!isset($moduleinfo['name']) || + !isset($moduleinfo['category']) || + !isset($moduleinfo['author']) || + !isset($moduleinfo['version'])) { + $ns = translate_inline("Not specified","common"); + } + if (!isset($moduleinfo['name'])) + $moduleinfo['name']="$ns ($shortname)"; + if (!isset($moduleinfo['category'])) + $moduleinfo['category']="$ns ($shortname)"; + if (!isset($moduleinfo['author'])) + $moduleinfo['author']="$ns ($shortname)"; + if (!isset($moduleinfo['version'])) + $moduleinfo['version']="0.0"; + if (!isset($moduleinfo['download'])) + $moduleinfo['download'] = ""; + if (!isset($moduleinfo['description'])) + $moduleinfo['description'] = ""; + } + if (!is_array($moduleinfo) || count($moduleinfo)<2){ + $mf = translate_inline("Missing function","common"); + $moduleinfo = array( + "name"=>"$mf ({$shortname}_getmoduleinfo)", + "version"=>"0.0", + "author"=>"$mf ({$shortname}_getmoduleinfo)", + "category"=>"$mf ({$shortname}_getmoduleinfo)", + "download"=>"", + ); + } + } else { + // This module couldn't be injected at all. + return array(); + } + $mostrecentmodule = $mod; + if (!isset($moduleinfo['requires'])) + $moduleinfo['requires'] = array(); + return $moduleinfo; +} + +function module_wipehooks() { + global $mostrecentmodule; + //lock the module hooks table. + $sql = "LOCK TABLES ".db_prefix("module_hooks")." WRITE"; + db_query($sql); + + //invalidate data caches for module hooks associated with this module. + $sql = "SELECT location FROM ".db_prefix("module_hooks")." WHERE modulename='$mostrecentmodule'"; + $result = db_query($sql); + while ($row = db_fetch_assoc($result)){ + invalidatedatacache("hook-".$row['location']); + } + invalidatedatacache("moduleprepare"); + + debug("Removing all hooks for $mostrecentmodule"); + $sql = "DELETE FROM " . db_prefix("module_hooks"). " WHERE modulename='$mostrecentmodule'"; + db_query($sql); + //unlock the module hooks table. + $sql = "UNLOCK TABLES"; + db_query($sql); + + $sql = "DELETE FROM " . db_prefix("module_event_hooks") . " WHERE modulename='$mostrecentmodule'"; + db_query($sql); + +} + +function module_addeventhook($type, $chance){ + global $mostrecentmodule; + debug("Adding an event hook on $type events for $mostrecentmodule"); + $sql = "DELETE FROM " . db_prefix("module_event_hooks") . " WHERE modulename='$mostrecentmodule' AND event_type='$type'"; + db_query($sql); + $sql = "INSERT INTO " . db_prefix("module_event_hooks") . " (event_type,modulename,event_chance) VALUES ('$type', '$mostrecentmodule','".addslashes($chance)."')"; + db_query($sql); + invalidatedatacache("event-".$type); +} + +function module_drophook($hookname,$functioncall=false){ + global $mostrecentmodule; + if ($functioncall===false) + $functioncall=$mostrecentmodule."_dohook"; + $sql = "DELETE FROM " . db_prefix("module_hooks") . " WHERE modulename='$mostrecentmodule' AND location='".addslashes($hookname)."' AND function='".addslashes($functioncall)."'"; + db_query($sql); + invalidatedatacache("hook-".$hookname); + invalidatedatacache("moduleprepare"); +} + +/** + * Called by modules to register themselves for a game module hook point, with default priority. + * Modules with identical priorities will execute alphabetically. Modules can only have one hook on a given hook name, + * even if they call this function multiple times, unless they specify different values for the functioncall argument. + * + * @param string $hookname The hook to receive a notification for + * @param string $functioncall The function that should be called, if not specified, use {modulename}_dohook() as the function + * @param string $whenactive An expression that should be evaluated before triggering the event, if not specified, none. + */ +function module_addhook($hookname,$functioncall=false,$whenactive=false){ + module_addhook_priority($hookname,50,$functioncall,$whenactive); +} + +/** + * Called by modules to register themselves for a game module hook point, with a given priority -- lower numbers execute first. + * Modules with identical priorities will execute alphabetically. Modules can only have one hook on a given hook name, + * even if they call this function multiple times, unless they specify different values for the functioncall argument. + * + * @param string $hookname The hook to receive a notification for + * @param integer $priority The priority for this hooking -- lower numbers execute first. < 50 means earlier-than-normal execution, > 50 means later than normal execution. Priority only affects execution order compared to other events registered on the same hook, all events on a given hook will execute before the game resumes execution. + * @param string $functioncall The function that should be called, if not specified, use {modulename}_dohook() as the function + * @param string $whenactive An expression that should be evaluated before triggering the event, if not specified, none. + */ +function module_addhook_priority($hookname,$priority=50,$functioncall=false,$whenactive=false){ + global $mostrecentmodule; + module_drophook($hookname,$functioncall); + + if ($functioncall===false) $functioncall=$mostrecentmodule."_dohook"; + if ($whenactive === false) $whenactive = ''; + + debug("Adding a hook at $hookname for $mostrecentmodule to $functioncall which is active on condition '$whenactive'"); + //we want to do a replace in case there's any garbage left in this table which might block new clean data from going in. + //normally that won't be the case, and so this doesn't have any performance implications. + $sql = "REPLACE INTO " . db_prefix("module_hooks") . " (modulename,location,function,whenactive,priority) VALUES ('$mostrecentmodule','".addslashes($hookname)."','".addslashes($functioncall)."','".addslashes($whenactive)."','".addslashes($priority)."')"; + db_query($sql); + invalidatedatacache("hook-".$hookname); + invalidatedatacache("moduleprepare"); +} + +function module_sem_acquire(){ + //DANGER DANGER WILL ROBINSON + //use of this function can be EXTREMELY DANGEROUS + //If there is ANY WAY you can avoid using it, I strongly recommend you + //do so. That said, I recognize that at times you need to acquire a + //semaphore so I'll provide a function to accomplish it. + + //PLEASE make sure you call module_sem_release() AS SOON AS YOU CAN. + + //Since Semaphore support in PHP is a compile time option that is off + //by default, I'll rely on MySQL's semaphore on table lock. Note this + //is NOT as efficient as the PHP semaphore because it blocks other + //things too. + //If someone is feeling industrious, a smart function that uses the PHP + //semaphore when available, and otherwise call the MySQL LOCK TABLES + //code would be sincerely appreciated. + $sql = "LOCK TABLES " . db_prefix("module_settings") . " WRITE"; + db_query($sql); +} + +function module_sem_release(){ + //please see warnings in module_sem_acquire() + $sql = "UNLOCK TABLES"; + db_query($sql); +} + +function module_collect_events($type, $allowinactive=false) +{ + global $session, $playermount; + global $blocked_modules, $block_all_modules, $unblocked_modules; + $active = ""; + $events = array(); + if (!$allowinactive) $active = " active=1 AND"; + + $sql = "SELECT " . db_prefix("module_event_hooks") . ".* FROM " . db_prefix("module_event_hooks") . " INNER JOIN " . db_prefix("modules") . " ON ". db_prefix("modules") . ".modulename = " . db_prefix("module_event_hooks") . ".modulename WHERE $active event_type='$type' ORDER BY RAND(".e_rand().")"; + $result = db_query_cached($sql,"event-".$type); + while ($row = db_fetch_assoc($result)){ + // The event_chance bit needs to return a value, but it can do that + // in any way it wants, and can have if/then or other logical + // structures, so we cannot just force the 'return' syntax unlike + // with buffs. + ob_start(); + $chance = eval($row['event_chance'].";"); + $err = ob_get_contents(); + ob_end_clean(); + if ($err > ""){ + debug(array("error"=>$err,"Eval code"=>$row['event_chance'])); + } + if ($chance < 0) $chance = 0; + if ($chance > 100) $chance = 100; + if (($block_all_modules || array_key_exists($row['modulename'],$blocked_modules) && $blocked_modules[$row['modulename']]) && + (!array_key_exists($row['modulename'],$unblocked_modules) || !$unblocked_modules[$row['modulename']])) { + $chance = 0; + } + $events[] = array('modulename'=>$row['modulename'], + 'rawchance' => $chance); + } + + // Now, normalize all of the event chances + $sum = 0; + reset($events); + foreach($events as $event) { + $sum += $event['rawchance']; + } + reset($events); + foreach($events as $index=>$event) { + if ($sum == 0) { + $events[$index]['normchance'] = 0; + } else { + $events[$index]['normchance'] = + round($event['rawchance']/$sum*100,3); + // If an event requests 1% chance, don't give them more! + if ($events[$index]['normchance'] > $event['rawchance']) + $events[$index]['normchance'] = $event['rawchance']; + } + } + return modulehook("collect-events", $events); +} + +function module_events($eventtype, $basechance, $baseLink = false) { + if ($baseLink === false){ + global $PHP_SELF; + $baseLink = substr($PHP_SELF,strrpos($PHP_SELF,"/")+1)."?"; + }else{ + //debug("Base link was specified as $baseLink"); + //debug(debug_backtrace()); + } + if (e_rand(1, 100) <= $basechance) { + global $PHP_SELF; + $events = module_collect_events($eventtype); + $chance = r_rand(1, 100); + reset($events); + $sum = 0; + foreach($events as $event) { + if ($event['rawchance'] == 0) { + continue; + } + if ($chance > $sum && $chance <= $sum + $event['normchance']) { + $_POST['i_am_a_hack'] = 'true'; + tlschema("events"); + output("`^`c`bSomething Special!`c`b`0"); + tlschema(); + $op = httpget('op'); + httpset('op', ""); + module_do_event($eventtype, $event['modulename'], false, $baseLink); + httpset('op', $op); + return 1; + } + $sum += $event['normchance']; + } + } + return 0; +} + +function module_do_event($type, $module, $allowinactive=false, $baseLink=false) +{ + global $navsection; + + if ($baseLink === false){ + global $PHP_SELF; + $baseLink = substr($PHP_SELF,strrpos($PHP_SELF,"/")+1)."?"; + }else{ + //debug("Base link was specified as $baseLink"); + //debug(debug_backtrace()); + } + // Save off the mostrecent module since having that change can change + // behaviour especially if a module calls modulehooks itself or calls + // library functions which cause them to be called. + if (!isset($mostrecentmodule)) $mostrecentmodule = ""; + $mod = $mostrecentmodule; + $_POST['i_am_a_hack'] = 'true'; + if(injectmodule($module, $allowinactive)) { + $oldnavsection = $navsection; + tlschema("module-$module"); + $fname = $module."_runevent"; + $fname($type,$baseLink); + tlschema(); + //hook into the running event, but only in *this* running event, not in all + modulehook("runevent_$module", array("type"=>$type, "baselink"=>$baseLink, "get"=>httpallget(), "post"=>httpallpost())); + //revert nav section after we're done here. + $navsection = $oldnavsection; + } + $mostrecentmodule=$mod; +} + +function event_sort($a, $b) +{ + return strcmp($a['modulename'], $b['modulename']); +} + +function module_display_events($eventtype, $forcescript=false) { + global $PHP_SELF, $session; + if (!($session['user']['superuser'] & SU_DEVELOPER)) return; + if ($forcescript === false) + $script = substr($PHP_SELF,strrpos($PHP_SELF,"/")+1); + else + $script = $forcescript; + $events = module_collect_events($eventtype,true); + + if (!is_array($events) || count($events) == 0) return; + + usort($events, "event_sort"); + + tlschema("events"); + output("`n`nSpecial event triggers:`n"); + $name = translate_inline("Name"); + $rchance = translate_inline("Raw Chance"); + $nchance = translate_inline("Normalized Chance"); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + $i = 0; + foreach($events as $event) { + // Each event is an associative array of 'modulename', + // 'rawchance' and 'normchance' + rawoutput(""); + $i++; + if ($event['modulename']) { + $link = "module-{$event['modulename']}"; + $name = $event['modulename']; + } + $rlink = "$script?eventhandler=$link"; + $rlink = str_replace("?&","?",$rlink); + $first = strpos($rlink, "?"); + $rl1 = substr($rlink, 0, $first+1); + $rl2 = substr($rlink, $first+1); + $rl2 = str_replace("?", "&", $rl2); + $rlink = $rl1 . $rl2; + rawoutput(""); + addnav("", "$rlink"); + rawoutput(""); + rawoutput(""); + rawoutput(""); + } + rawoutput("
$name$rchancenchance
$name{$event['rawchance']}{$event['normchance']}
"); +} + +function module_editor_navs($like, $linkprefix) +{ + $sql = "SELECT formalname,modulename,active,category FROM " . db_prefix("modules") . " WHERE infokeys LIKE '%|$like|%' ORDER BY category,formalname"; + $result = db_query($sql); + $curcat = ""; + while($row = db_fetch_assoc($result)) { + if ($curcat != $row['category']) { + $curcat = $row['category']; + addnav(array("%s Modules",$curcat)); + } + //I really think we should give keyboard shortcuts even if they're + //susceptible to change (which only happens here when the admin changes + //modules around). This annoys me every single time I come in to this page. + addnav_notl(($row['active'] ? "" : "`)") . $row['formalname']."`0", + $linkprefix . $row['modulename']); + } +} + +function module_objpref_edit($type, $module, $id) +{ + $info = get_module_info($module); + if (count($info['prefs-'.$type]) > 0) { + $data = array(); + $msettings = array(); + while(list($key, $val) = each($info['prefs-'.$type])) { + if (is_array($val)) { + $v = $val[0]; + $x = explode("|", $v); + $val[0] = $x[0]; + $x[0] = $val; + } else { + $x = explode("|", $val); + } + $msettings[$key]=$x[0]; + // Set up default + if (isset($x[1])) $data[$key]=$x[1]; + } + $sql = "SELECT setting, value FROM " . db_prefix("module_objprefs") . " WHERE modulename='$module' AND objtype='$type' AND objid='$id'"; + $result = db_query($sql); + while($row = db_fetch_assoc($result)) { + $data[$row['setting']] = $row['value']; + } + tlschema("module-$module"); + showform($msettings, $data); + tlschema(); + } +} + +function module_compare_versions($a,$b){ + //this function returns -1 when $a < $b, 1 when $a > $b, and 0 when $a == $b + //insert alternate version detection and comparison algorithms here. + + //default case, typecast as float + $a = (float)$a; + $b = (float)$b; + return ($a < $b ? -1 : ($a > $b ? 1 : 0) ); +} + +function activate_module($module){ + if (!is_module_installed($module)){ + if (!install_module($module)){ + return false; + } + } + $sql = "UPDATE " . db_prefix("modules") . " SET active=1 WHERE modulename='$module'"; + db_query($sql); + invalidatedatacache("inject-$module"); + massinvalidate("moduleprepare"); + if (db_affected_rows() <= 0){ + return false; + }else{ + return true; + } +} + +function deactivate_module($module){ + if (!is_module_installed($module)){ + if (!install_module($module)){ + return false; + }else{ + //modules that weren't installed go to deactivated state by default in install_module + return true; + } + } + $sql = "UPDATE " . db_prefix("modules") . " SET active=0 WHERE modulename='$module'"; + db_query($sql); + invalidatedatacache("inject-$module"); + massinvalidate("moduleprepare"); + if (db_affected_rows() <= 0){ + return false; + }else{ + return true; + } +} + +function uninstall_module($module){ + if (injectmodule($module,true)) { + $fname = $module."_uninstall"; + output("Running module uninstall script`n"); + tlschema("module-{$module}"); + $fname(); + tlschema(); + + output("Deleting module entry`n"); + $sql = "DELETE FROM " . db_prefix("modules") . + " WHERE modulename='$module'"; + db_query($sql); + + output("Deleting module hooks`n"); + module_wipehooks(); + + output("Deleting module settings`n"); + $sql = "DELETE FROM " . db_prefix("module_settings") . + " WHERE modulename='$module'"; + db_query($sql); + invalidatedatacache("modulesettings-$module"); + + output("Deleting module user prefs`n"); + $sql = "DELETE FROM " . db_prefix("module_userprefs") . + " WHERE modulename='$module'"; + db_query($sql); + + output("Deleting module object prefs`n"); + $sql = "DELETE FROM " . db_prefix("module_objprefs") . + " WHERE modulename='$module'"; + db_query($sql); + invalidatedatacache("inject-$module"); + massinvalidate("moduleprepare"); + return true; + } else { + return false; + } +} + +function install_module($module, $force=true){ + global $mostrecentmodule, $session; + $name = $session['user']['name']; + if (!$name) $name = '`@System`0'; + + require_once("lib/sanitize.php"); + if (modulename_sanitize($module)!=$module){ + output("Error, module file names can only contain alpha numeric characters and underscores before the trailing .php`n`nGood module names include 'testmodule.php', 'joesmodule2.php', while bad module names include, 'test.module.php' or 'joes module.php'`n"); + return false; + }else{ + // If we are forcing an install, then whack the old version. + if ($force) { + $sql = "DELETE FROM " . db_prefix("modules") . " WHERE modulename='$module'"; + db_query($sql); + } + // We want to do the inject so that it auto-upgrades any installed + // version correctly. + if (injectmodule($module,true)) { + // If we're not forcing and this is already installed, we are done + if (!$force && is_module_installed($module)) + return true; + $info = get_module_info($module); + //check installation requirements + if (!module_check_requirements($info['requires'])){ + output("`\$Module could not installed -- it did not meet its prerequisites.`n"); + return false; + }else{ + $keys = "|".join(array_keys($info), "|")."|"; + $sql = "INSERT INTO " . db_prefix("modules") . " (modulename,formalname,moduleauthor,active,filename,installdate,installedby,category,infokeys,version,download,description) VALUES ('$mostrecentmodule','".addslashes($info['name'])."','".addslashes($info['author'])."',0,'{$mostrecentmodule}.php','".date("Y-m-d H:i:s")."','".addslashes($name)."','".addslashes($info['category'])."','$keys','".addslashes($info['version'])."','".addslashes($info['download'])."', '".addslashes($info['description'])."')"; + db_query($sql); + $fname = $mostrecentmodule."_install"; + if (isset($info['settings']) && count($info['settings']) > 0) { + foreach($info['settings'] as $key=>$val){ + if (is_array($val)) { + $x = explode("|", $val[0]); + } else { + $x = explode("|",$val); + } + if (isset($x[1])){ + set_module_setting($key,$x[1]); + debug("Setting $key to default {$x[1]}"); + } + } + } + if ($fname() === false) { + return false; + } + output("`^Module installed. It is not yet active.`n"); + invalidatedatacache("inject-$mostrecentmodule"); + massinvalidate("moduleprepare"); + return true; + } + } else { + output("`\$Module could not be injected."); + output("Module not installed."); + output("This is probably due to the module file having a parse error or not existing in the filesystem.`n"); + return false; + } + } + +} + +/** + * Evaluates a PHP Expression + * + * @param string $condition The PHP condition to evaluate + * @return bool The result of the evaluated expression + */ +function module_condition($condition) { + global $session; + $result = eval($condition); + return (bool)$result; +} + +function get_module_install_status(){ + // Collect the names of all installed modules. + $seenmodules = array(); + $seencats = array(); + $sql = "SELECT modulename,category FROM " . db_prefix("modules"); + $result = @db_query($sql); + if ($result !== false){ + while ($row = db_fetch_assoc($result)) { + $seenmodules[$row['modulename'].".php"] = true; + if (!array_key_exists($row['category'], $seencats)) + $seencats[$row['category']] = 1; + else + $seencats[$row['category']]++; + } + } + + $uninstmodules = array(); + if ($handle = opendir("modules")){ + $ucount=0; + while (false !== ($file = readdir($handle))){ + if ($file[0] == ".") continue; + if (preg_match("/\\.php$/", $file) && !isset($seenmodules[$file])){ + $ucount++; + $uninstmodules[] = substr($file, 0, strlen($file)-4); + } + } + } + closedir($handle); + sort($uninstmodules); + return array('installedcategories'=>$seencats,'installedmodules'=>$seenmodules,'uninstalledmodules'=>$uninstmodules, 'uninstcount'=>$ucount); +} + +function get_racename($thisuser=true) { + if ($thisuser === true) { + global $session; + return translate_inline($session['user']['race'],"race"); + } else { + return translate_inline($thisuser,"race"); + } +} + +function module_delete_oldvalues($table,$key) { + require_once 'lib/gamelog.php'; + $total = 0; + $res = db_query("SELECT modulename FROM ".db_prefix('modules')." WHERE infokeys LIKE '%|$key|%'"); + while ($row = db_fetch_assoc($res)) { + $mod = $row['modulename']; + require_once "modules/{$mod}.php"; + $func = $mod."_getmoduleinfo"; + $info = $func(); + $keys = array_filter(array_keys($info[$key]), "module_pref_filter"); + $keys = array_map("addslashes", $keys); + $keys = implode("','", $keys); + if ($keys) db_query("DELETE FROM ".db_prefix($table)." WHERE modulename='$mod' AND setting NOT IN ('$keys')"); + $total += db_affected_rows(); + } + gamelog("Cleaned up $total old values in $table that don't exist anymore", 'maintenance'); +} + +function module_pref_filter($a){ + return !is_numeric($a); +} + +?> diff --git a/lotgd-web/lotgd/lib/motd.php b/lotgd-web/lotgd/lib/motd.php new file mode 100755 index 0000000..2b42f44 --- /dev/null +++ b/lotgd-web/lotgd/lib/motd.php @@ -0,0 +1,240 @@ +$ed | "); + } + rawoutput("$del ]"); + } +} + +function motditem($subject,$body,$author,$date,$id){ + if ($date) + rawoutput(""); + output_notl("`b`^%s`0`b", $subject); + if ($id > "") { + motd_admin($id); + } + if ($date || $author) output_notl("`n"); + if ($author > "") { + output_notl("`3%s`0", $author); + } + if ($date>"") + output_notl("`0 – `#%s`0", $date, true); + if ($date || $author) output_notl("`n"); + + output_notl("`2%s`0", nltoappon($body), true); + if ($date) rawoutput(""); + rawoutput("
"); +} + +function pollitem($id,$subject,$body,$author,$date,$showpoll=true){ + global $session; + $sql = "SELECT count(resultid) AS c, MAX(choice) AS choice FROM " . db_prefix("pollresults") . " WHERE motditem='$id' AND account='{$session['user']['acctid']}'"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + $choice = $row['choice']; + $body = unserialize($body); + + $poll = translate_inline("Poll:"); + if ($session['user']['loggedin'] && $showpoll) { + rawoutput("
"); + rawoutput("",true); + } + output_notl("`b`&%s `^%s`0`b", $poll, $subject); + if ($showpoll) motd_admin($id, true); + output_notl("`n`3%s`0 – `#%s`0`n", $author, $date, true); + output_notl("`2%s`0`n", stripslashes($body['body'])); + $sql = "SELECT count(resultid) AS c, choice FROM " . db_prefix("pollresults") . " WHERE motditem='$id' GROUP BY choice ORDER BY choice"; + $result = db_query_cached($sql,"poll-$id"); + $choices=array(); + $totalanswers=0; + $maxitem = 0; + while ($row = db_fetch_assoc($result)) { + $choices[$row['choice']]=$row['c']; + $totalanswers+=$row['c']; + if ($row['c']>$maxitem) $maxitem = $row['c']; + } + while (list($key,$val)=each($body['opt'])){ + if (trim($val)!=""){ + if ($totalanswers<=0) $totalanswers=1; + $percent = 0; + if(isset($choices[$key])) { + $percent = round($choices[$key] / $totalanswers * 100,1); + } + if ($session['user']['loggedin'] && $showpoll) { + rawoutput(""); + } + output_notl("%s (%s - %s%%)`n", stripslashes($val), + (isset($choices[$key])?(int)$choices[$key]:0), $percent); + if ($maxitem==0 || !isset($choices[$key])){ + $width=1; + } else { + $width = round(($choices[$key]/$maxitem) * 400,0); + } + $width = max($width,1); + rawoutput("$percent
"); + } + } + if ($session['user']['loggedin'] && $showpoll) { + $vote = translate_inline("Vote"); + rawoutput("
"); + } + rawoutput("
",true); +} + +function motd_form($id) { + global $session; + $subject = httppost('subject'); + $body = httppost('body'); + $preview = httppost('preview'); + if ($subject=="" || $body=="" || $preview>""){ + $edit = translate_inline("Edit a MoTD"); + $add = translate_inline("Add a MoTD"); + $ret = translate_inline("Return"); + + $row = array( + "motditem"=>0, + "motdauthorname"=>"", + "motdtitle"=>"", + "motdbody"=>"", + ); + if ($id>""){ + $sql = "SELECT " . db_prefix("motd") . ".*,name AS motdauthorname FROM " . db_prefix("motd") . " LEFT JOIN " . db_prefix("accounts") . " ON " . db_prefix("accounts") . ".acctid = " . db_prefix("motd") . ".motdauthor WHERE motditem='$id'"; + $result = db_query($sql); + if (db_num_rows($result)>0){ + $row = db_fetch_assoc($result); + $msg = $edit; + }else{ + $msg = $add; + } + }else{ + $msg = $add; + } + output_notl("`b%s`b", $msg); + rawoutput("[ $ret ]
"); + + rawoutput("
"); + addnav("","motd.php?op=add&id={$row['motditem']}"); + if ($row['motdauthorname']>"") + output("Originally by `@%s`0 on %s`n", $row['motdauthorname'], + $row['motddate']); + if ($subject>"") $row['motdtitle'] = stripslashes($subject); + if ($body>"") $row['motdbody'] = stripslashes($body); + if ($preview>""){ + if (httppost('changeauthor') || $row['motdauthorname']=="") + $row['motdauthorname']=$session['user']['name']; + if (httppost('changedate') || !isset($row['motddate']) || $row['motddate']=="") + $row['motddate']=date("Y-m-d H:i:s"); + motditem($row['motdtitle'], $row['motdbody'], + $row['motdauthorname'],$row['motddate'], ""); + } + output("Subject: "); + rawoutput("
"); + output("Body:`n"); + rawoutput("
"); + if ($row['motditem']>0){ + output("Options:`n"); + rawoutput(""); + output("Change Author`n"); + rawoutput(""); + output("Change Date (force popup again)`n"); + } + $prev = translate_inline("Preview"); + $sub = translate_inline("Submit"); + rawoutput("
"); + }else{ + if ($id>""){ + $sql = " SET motdtitle='$subject', motdbody='$body'"; + if (httppost('changeauthor')) + $sql.=", motdauthor={$session['user']['acctid']}"; + if (httppost('changedate')) + $sql.=", motddate='".date("Y-m-d H:i:s")."'"; + $sql = "UPDATE " . db_prefix("motd") . $sql . " WHERE motditem='$id'"; + db_query($sql); + invalidatedatacache("motd"); + invalidatedatacache("lastmotd"); + invalidatedatacache("motddate"); + } + if ($id=="" || db_affected_rows()==0){ + if ($id>""){ + $sql = "SELECT * FROM " . db_prefix("motd") . " WHERE motditem='$id'"; + $result = db_query($sql); + if (db_num_rows($result)>0) $doinsert = false; + else $doinsert=true; + }else{ + $doinsert=true; + } + if ($doinsert){ + $sql = "INSERT INTO " . db_prefix("motd") . " (motdtitle,motdbody,motddate,motdauthor) VALUES (\"$subject\",\"$body\",'".date("Y-m-d H:i:s")."','{$session['user']['acctid']}')"; + db_query($sql); + invalidatedatacache("motd"); + invalidatedatacache("lastmotd"); + invalidatedatacache("motddate"); + } + } + header("Location: motd.php"); + exit(); + } +} + +function motd_poll_form() { + global $session; + $subject = httppost('subject'); + $body = httppost('body'); + if ($subject=="" || $body==""){ + output("`\$NOTE:`^ Polls cannot be edited after they are begun in order to ensure fairness and accuracy of results.`0`n`n"); + rawoutput("
"); + addnav("","motd.php?op=add"); + output("Subject: "); + rawoutput("
"); + output("Body:`n"); + rawoutput("
"); + $option = translate_inline("Option"); + output("Choices:`n"); + $pollitem = "$option
"; + rawoutput($pollitem); + rawoutput($pollitem); + rawoutput($pollitem); + rawoutput($pollitem); + rawoutput($pollitem); + rawoutput("
"); + rawoutput("
"); + rawoutput("",true); + $addi = translate_inline("Add Poll Item"); + $add = translate_inline("Add"); + rawoutput("$addi
"); + rawoutput("
"); + }else{ + $opt = httppost("opt"); + $body = array("body"=>$body,"opt"=>$opt); + $sql = "INSERT INTO " . db_prefix("motd") . " (motdtitle,motdbody,motddate,motdtype,motdauthor) VALUES (\"$subject\",\"".addslashes(serialize($body))."\",'".date("Y-m-d H:i:s")."',1,'{$session['user']['acctid']}')"; + db_query($sql); + invalidatedatacache("motd"); + invalidatedatacache("lastmotd"); + invalidatedatacache("motddate"); + header("Location: motd.php"); + exit(); + } +} + +function motd_del($id) { + $sql = "DELETE FROM " . db_prefix("motd") . " WHERE motditem=\"$id\""; + db_query($sql); + invalidatedatacache("motd"); + invalidatedatacache("lastmotd"); + invalidatedatacache("motddate"); + header("Location: motd.php"); + exit(); +} + +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/mountname.php b/lotgd-web/lotgd/lib/mountname.php new file mode 100755 index 0000000..a93352f --- /dev/null +++ b/lotgd-web/lotgd/lib/mountname.php @@ -0,0 +1,22 @@ + diff --git a/lotgd-web/lotgd/lib/mounts.php b/lotgd-web/lotgd/lib/mounts.php new file mode 100755 index 0000000..97c9891 --- /dev/null +++ b/lotgd-web/lotgd/lib/mounts.php @@ -0,0 +1,14 @@ +0){ + return db_fetch_assoc($result); + }else{ + return array(); + } +} +?> diff --git a/lotgd-web/lotgd/lib/names.php b/lotgd-web/lotgd/lib/names.php new file mode 100755 index 0000000..f99a6ae --- /dev/null +++ b/lotgd-web/lotgd/lib/names.php @@ -0,0 +1,89 @@ + diff --git a/lotgd-web/lotgd/lib/newday/dbcleanup.php b/lotgd-web/lotgd/lib/newday/dbcleanup.php new file mode 100755 index 0000000..25500ae --- /dev/null +++ b/lotgd-web/lotgd/lib/newday/dbcleanup.php @@ -0,0 +1,15 @@ + diff --git a/lotgd-web/lotgd/lib/newday/dp_recalc.php b/lotgd-web/lotgd/lib/newday/dp_recalc.php new file mode 100755 index 0000000..1de22d9 --- /dev/null +++ b/lotgd-web/lotgd/lib/newday/dp_recalc.php @@ -0,0 +1,27 @@ +$label) { + $pdktotal += (int)$pdks[$type]; + if((int)$pdks[$type] < 0) $pdkneg = true; +} +if ($pdktotal == $dkills-$dp && !$pdkneg) { + $dp += $pdktotal; + $session['user']['maxhitpoints'] += (5 * $pdks["hp"]); + $session['user']['attack'] += $pdks["at"]; + $session['user']['defense'] += $pdks["de"]; + reset($labels); + foreach($labels as $type=>$label) { + $count = 0; + if (isset($pdks[$type])) $count = (int)$pdks[$type]; + while($count) { + $count--; + array_push($session['user']['dragonpoints'],$type); + } + } +}else{ + output("`\$Error: Please spend the correct total amount of dragon points.`n`n"); +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/newday/dragonpointspend.php b/lotgd-web/lotgd/lib/newday/dragonpointspend.php new file mode 100755 index 0000000..9b51a21 --- /dev/null +++ b/lotgd-web/lotgd/lib/newday/dragonpointspend.php @@ -0,0 +1,118 @@ + 1) { + page_header("Dragon Points"); + output("`@You earn one dragon point each time you slay the dragon."); + output("Advancements made by spending dragon points are permanent!"); + output("`n`nYou have `^%s`@ unspent dragon points.", $dkills-$dp); + output("How do you wish to spend them?`n`n"); + output("Be sure that your allocations add up to your total unspent dragon points."); + $text = "\n"; + rawoutput($text); + addnav("Reset", "newday.php?pdk=0$resline"); + $link = appendcount("newday.php?pdk=1$resline"); + rawoutput("
"); + addnav("",$link); + rawoutput(""); + reset($labels); + foreach($labels as $type=>$label) { + if (isset($canbuy[$type]) && $canbuy[$type]) { + rawoutput(""); + } + } + rawoutput(""); + rawoutput("
"); + output($label); + output_notl(":"); + rawoutput(""); + rawoutput(""); + rawoutput("
 "); + rawoutput("
"); + $click = translate_inline("Spend"); + rawoutput(""); + rawoutput("
 "); + rawoutput("
"); + rawoutput("
"); + rawoutput("
"); + rawoutput("
"); + reset($labels); + $count = 0; + foreach($labels as $type=>$label) { + if ($count > 0) break; + if (isset($canbuy[$type]) && $canbuy[$type]) { + rawoutput(""); + $count++; + } + } +}else{ + page_header("Dragon Points"); + reset ($labels); + $dist = array(); + foreach ($labels as $type=>$label) { + $dist[$type] = 0; // Initialize the distribution + if (isset($canbuy[$type]) && $canbuy[$type]) { + addnav($label, "newday.php?dk=$type$resline"); + } + } + output("`@You have `&1`@ unspent dragon point."); + output("How do you wish to spend it?`n`n"); + output("You earn one dragon point each time you slay the dragon."); + output("Advancements made by spending dragon points are permanent!"); + for ($i=0; $i"); + rawoutput(""); + reset ($labels); + foreach ($labels as $type=>$label) { + if ($type == 'unknown' && $dist[$type] == 0) continue; + rawoutput(""); + } + rawoutput("
"); + output($label); + output_notl(":"); + rawoutput("  "); + output_notl("`@%s", $dist[$type]); + rawoutput("
"); + rawoutput("
"); +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/newday/newday_runonce.php b/lotgd-web/lotgd/lib/newday/newday_runonce.php new file mode 100755 index 0000000..76755e6 --- /dev/null +++ b/lotgd-web/lotgd/lib/newday/newday_runonce.php @@ -0,0 +1,70 @@ +'0000-00-00'"); + + if (getsetting("expirecontent",180)>0){ + // Clean up old prefs + $tables = array('module_userprefs'=>'prefs','module_settings'=>'settings'); + foreach ($tables as $table=>$key) module_delete_oldvalues($table,$key); + + //Clean up debug log, moved from there + $timestamp = date("Y-m-d H:i:s",strtotime("-".round(getsetting("expirecontent",180)/10,0)." days")); + $sql = "DELETE FROM " . db_prefix("debuglog") . " WHERE date <'$timestamp'"; + db_query($sql); + require_once("lib/gamelog.php"); + gamelog("Cleaned up ".db_affected_rows()." from ".db_prefix("debuglog")." older than $timestamp.",'maintenance'); + + //Clean up game log + $timestamp = date("Y-m-d H:i:s",strtotime("-1 month")); + $sql = "DELETE FROM ".db_prefix("gamelog")." WHERE date < '$timestamp' "; + db_query($sql); + gamelog("Cleaned up ".db_prefix("gamelog")." table removing ".db_affected_rows()." older than $timestamp.","maintenance"); + + //Clean up old comments + + $sql = "DELETE FROM " . db_prefix("commentary") . " WHERE postdate<'".date("Y-m-d H:i:s",strtotime("-".getsetting("expirecontent",180)." days"))."'"; + db_query($sql); + gamelog("Deleted ".db_affected_rows()." old comments.","comment expiration"); + + //Clean up old moderated comments + + $sql = "DELETE FROM " . db_prefix("moderatedcomments") . " WHERE moddate<'".date("Y-m-d H:i:s",strtotime("-".getsetting("expirecontent",180)." days"))."'"; + db_query($sql); + gamelog("Deleted ".db_affected_rows()." old moderated comments.","comment expiration"); + } + if (strtotime(getsetting("lastdboptimize", date("Y-m-d H:i:s", strtotime("-1 day")))) < strtotime("-1 day")) + require_once("lib/newday/dbcleanup.php"); +?> diff --git a/lotgd-web/lotgd/lib/newday/setrace.php b/lotgd-web/lotgd/lib/newday/setrace.php new file mode 100755 index 0000000..6a4f80f --- /dev/null +++ b/lotgd-web/lotgd/lib/newday/setrace.php @@ -0,0 +1,32 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/newday/setspecialty.php b/lotgd-web/lotgd/lib/newday/setspecialty.php new file mode 100755 index 0000000..ea6e0f6 --- /dev/null +++ b/lotgd-web/lotgd/lib/newday/setspecialty.php @@ -0,0 +1,29 @@ + diff --git a/lotgd-web/lotgd/lib/nltoappon.php b/lotgd-web/lotgd/lib/nltoappon.php new file mode 100755 index 0000000..ae886eb --- /dev/null +++ b/lotgd-web/lotgd/lib/nltoappon.php @@ -0,0 +1,11 @@ + diff --git a/lotgd-web/lotgd/lib/output.php b/lotgd-web/lotgd/lib/output.php new file mode 100755 index 0000000..f4a8deb --- /dev/null +++ b/lotgd-web/lotgd/lib/output.php @@ -0,0 +1,902 @@ +1){ + //special case since we use `% as a color code so often. + $out = str_replace("`%","`%%",$out); + $out = call_user_func_array("sprintf",$args); + } + //holiday text + if ($priv==false) $out = holidayize($out,'output'); + //`1`2 etc color & formatting + $out = appoencode($out,$priv); + //apply to the page. + $output.=tlbutton_pop().$out; + $output.="\n"; +} + +/** + * Outputs a translated, color/style encoded string to the browser. + * + * @param string|array What to output. If an array is passed then the format used by sprintf is assumed + * + * @see output_notl + * + */ +function output(){ + global $block_new_output; + + if ($block_new_output) return; + $args = func_get_args(); + if (is_array($args[0])) $args = $args[0]; + if (is_bool($args[0]) && array_shift($args)) { + $schema= array_shift($args); + $args[0] = translate($args[0],$schema); + } else { + $args[0] = translate($args[0]); + } + call_user_func_array("output_notl",$args); +} + +/** + * Generate debug output for players who have the SU_DEBUG_OUTPUT flag set in the superuser mask + * + * @param string $text The string to output + * @param bool $force If true, force debug output even for non SU/non flagged + */ +function debug($text, $force=false){ + global $session, $block_new_output; + $temp = $block_new_output; + set_block_new_output(false); + if ($force || $session['user']['superuser'] & SU_DEBUG_OUTPUT){ + if (is_array($text)){ + require_once("lib/dump_item.php"); + $text = appoencode(dump_item($text),true); + } + rawoutput("
$text
"); + } + set_block_new_output($temp); +} + +/** + * Generates the appropriate output based on the LOGD coding system (ie: `b: Bold, `i: Italic) + * + * @param string $data The string to be output + * @param bool $priv Indicates if the passed string ($data) contains HTML + * @return string An output (HTML) formatted string + */ +function appoencode($data,$priv=false){ + global $nestedtags,$session; + $start = 0; + $out=""; + if( ($pos = strpos($data, "`")) !== false) { + global $nestedtags; + if (!isset($nestedtags['font'])) $nestedtags['font']=false; + if (!isset($nestedtags['div'])) $nestedtags['div']=false; + if (!isset($nestedtags['i'])) $nestedtags['i']=false; + if (!isset($nestedtags['b'])) $nestedtags['b']=false; + if (!isset($nestedtags['<'])) $nestedtags['<']=false; + if (!isset($nestedtags['>'])) $nestedtags['>']=false; + if (!isset($nestedtags['h'])) $nestedtags['h']=false; + + static $colors = array( + "1" => "colDkBlue", + "2" => "colDkGreen", + "3" => "colDkCyan", + "4" => "colDkRed", + "5" => "colDkMagenta", + "6" => "colDkYellow", + "7" => "colDkWhite", + "~" => "colBlack", + "!" => "colLtBlue", + "@" => "colLtGreen", + "#" => "colLtCyan", + "\$" => "colLtRed", + "%" => "colLtMagenta", + "^" => "colLtYellow", + "&" => "colLtWhite", + ")" => "colLtBlack", + "e" => "colDkRust", + "E" => "colLtRust", + "g" => "colXLtGreen", + "G" => "colXLtGreen", + "j" => "colMdGrey", + "J" => "colMdBlue", + "k" => "colaquamarine", + "K" => "coldarkseagreen", + "l" => "colDkLinkBlue", + "L" => "colLtLinkBlue", + "m" => "colwheat", + "M" => "coltan", + "p" => "collightsalmon", + "P" => "colsalmon", + "q" => "colDkOrange", + "Q" => "colLtOrange", + "R" => "colRose", + "T" => "colDkBrown", + "t" => "colLtBrown", + "V" => "colBlueViolet", + "v" => "coliceviolet", + "x" => "colburlywood", + "X" => "colbeige", + "y" => "colkhaki", + "Y" => "coldarkkhaki", + ); + do { + ++$pos; + if ($priv === false){ + $out .= HTMLEntities(substr($data, $start, $pos - $start - 1), ENT_COMPAT, getsetting("charset", "ISO-8859-1")); + } else { + $out .= substr($data, $start, $pos - $start - 1); + } + $start = $pos + 1; + if(isset($colors[$data[$pos]])) { + if ($nestedtags['font']) $out.="
"; + else $nestedtags['font']=true; + $out.=""; + } else { + switch($data[$pos]){ + case "n": + $out.="
\n"; + break; + case "0": + if ($nestedtags['font']) $out.="
"; + $nestedtags['font'] = false; + break; + case "b": + if ($nestedtags['b']){ + $out.=""; + $nestedtags['b']=false; + }else{ + $nestedtags['b']=true; + $out.=""; + } + break; + case "i": + if ($nestedtags['i']) { + $out.=""; + $nestedtags['i']=false; + }else{ + $nestedtags['i']=true; + $out.=""; + } + break; + case "c": + if ($nestedtags['div']) { + $out.=""; + $nestedtags['div']=false; + }else{ + $nestedtags['div']=true; + $out.="
"; + } + break; + case "h": + if ($nestedtags['h']) { + $out.=""; + $nestedtags['h']=false; + }else{ + $nestedtags['h']=true; + $out.=""; + } + break; + case ">": + if ($nestedtags['>']){ + $nestedtags['>']=false; + $out.="
"; + }else{ + $nestedtags['>']=true; + $out.="
"; + } + break; + case "<": + if ($nestedtags['<']){ + $nestedtags['<']=false; + $out.="
"; + }else{ + $nestedtags['<']=true; + $out.="
"; + } + break; + case "H": + if ($nestedtags['div']) { + $out.=""; + $nestedtags['div']=false; + }else{ + $nestedtags['div']=true; + $out.=""; + } + break; + case "w": + global $session; + if(!isset($session['user']['weapon'])) + $session['user']['weapon']=""; + $out.=appoencode($session['user']['weapon'],$priv); + break; + case "`": + $out.="`"; + ++$pos; + break; + default: + $out.="`".$data[$pos]; + } + } + } while( ($pos = strpos($data, "`", $pos)) !== false); + } + if ($priv === false){ + $out .= HTMLEntities(substr($data, $start), ENT_COMPAT, getsetting("charset", "ISO-8859-1")); + } else { + $out .= substr($data, $start); + } + return $out; +} + +$blockednavs = array( + 'blockpartial'=>array(), + 'blockfull'=>array(), + 'blockcat'=>array(), + 'unblockpartial'=>array(), + 'unblockfull'=>array() + ); + +/** + * Called to block the display of a nav + * if $partial is true, it will block any nav that begins with the given $link. + * if $partial is false, it will block only navs that have exactly the given $link. + * + * @param string $link The URL to block + * @param bool $partial + */ +function blocknav($link,$partial=false){ + //prevents a script from being able to generate navs on the given $link. + global $blockednavs; + $p = ($partial?'partial':'full'); + $blockednavs["block$p"][$link] = true; + //eliminate any unblocked navs that match this description. + if (isset($blockednavs["unblock$p"][$link])) { + unset($blockednavs["unblock$p"][$link]); + } + if ($partial){ + reset($blockednavs['unblockpartial']); + while (list($key,$val)=each($blockednavs['unblockpartial'])){ + if (substr($link,0,strlen($val))==$val || + substr($val,0,strlen($link))==$link){ + unset($blockednavs['unblockpartial'][$val]); + } + } + } +} + +/** + * Unlocks a nav from the blocked navs Array + * if $partial is true, it will unblock any nav that begins with the given $link. + * if $partial is false, it will unblock only navs that have exactly the given $link. + * + * @param string $link The nav to unblock + * @param bool $partial If the passed nav is partial or not + */ +function unblocknav($link,$partial=false){ + //prevents a link that was otherwise blocked with blocknav() from + //actually being blocked. + global $blockednavs; + $p = ($partial?'partial':'full'); + $blockednavs["unblock$p"][$link] = true; + //eliminate any blocked navs that match this description. + if (isset($blockednavs["block$p"][$link])) { + unset($blockednavs["block$p"][$link]); + } + if ($partial){ + reset($blockednavs['blockpartial']); + while (list($key,$val)=each($blockednavs['blockpartial'])){ + if (substr($link,0,strlen($val))==$val || + substr($val,0,strlen($link))==$link){ + unset($blockednavs['blockpartial'][$val]); + } + } + } +} + +/** + * Called to block the display of an entire category of navs + * + * @param string $cat The category to block + */ +function blocknavcat($cat){ + //prevents a script from being able to generate navs on the given $cat. + global $blockednavs; + if(!isset($blockednavs["blockcat"][$cat])) $blockednavs["blockcat"][$cat] = true; +} + +/** + * Unlocks a nav category from the blocked navs Array + * + * @param string $cat The category to unblock + */ +function unblocknavcat($cat){ + //prevents a category that was otherwise blocked with blocknavcat() from + //actually being blocked. + global $blockednavs; + //eliminate any blocked nav cats that match this description. + $blockednavs["blockcat"][$cat] = false; +} + +function appendcount($link) { + global $session; + return appendlink($link, "c=" . $session['counter'] . "-" . date("His")); +} + +function appendlink($link, $new) +{ + if (strpos($link, "?") !== false) { + return $link . '&' . $new; + } else { + return $link . '?' . $new; + } +} + +$navsection=""; +$navbysection = array(); +$navschema = array(); +$navnocollapse = array(); +$block_new_navs = false; + +/** + * Allow header/footer code to block/unblock additional navs + * + * @param bool $block should new navs be blocked + */ +function set_block_new_navs($block) +{ + global $block_new_navs; + $block_new_navs = $block; +} + +/** + * Generate and/or store a nav banner for the player + * + * @param string $text the display string for the nav banner + * @param collapse $collapse (default true) can the nav section collapse + */ +function addnavheader($text, $collapse=true,$translate=TRUE) +{ + global $navsection,$navbysection,$translation_namespace; + global $navschema,$navnocollapse, $block_new_navs,$notranslate; + + if ($block_new_navs) return; + + if (is_array($text)){ + $text = "!array!".serialize($text); + } + $navsection=$text; + if (!array_key_exists($text,$navschema)) + $navschema[$text] = $translation_namespace; + //So we can place sections with out adding navs to them. + if (!isset($navbysection[$navsection])) + $navbysection[$navsection] = array(); + if ($collapse === false) { + $navnocollapse[$text] = true; + } + if ($translate === false) { + if (!isset($notranslate)) + $notranslate = array(); + array_push($notranslate,array($text,"")); + } +} + +/** + * Generate and/or store the allowed navs or nav banners for the player. + * If $link is missing - then a banner will be displayed in the nav list + * If $text is missing - the nav will be stored in the allowed navs for the player but not displayed + * ALL internal site links that are displayed MUST also call addnav or badnav will occur. + * + * @param string $text (optional) The display string for the nav or nav banner + * @param string $link (optional) The URL of the link + * @param bool $priv Indicates if the name contains HTML + * @param bool $pop Indicates if the URL should generate a popup + * @param string $popsize If a popup - the size of the popup window + * + * @see badnav, apponencode + */ + +function addnav_notl($text,$link=false,$priv=false,$pop=false,$popsize="500x300"){ + global $navsection,$navbysection,$navschema,$notranslate; + global $block_new_navs; + + if ($block_new_navs) return; + + if ($link===false) { + // Don't do anything if text is "" + if ($text != "") { + addnavheader($text,TRUE,FALSE); + } + }else{ + $args = func_get_args(); + if ($text==""){ + //if there's no text to display, may as well just stick this on + //the nav stack now. + call_user_func_array("private_addnav",$args); + }else{ + if (!isset($navbysection[$navsection])) + $navbysection[$navsection] = array(); + if (!isset($notranslate)) + $notranslate = array(); + array_push($navbysection[$navsection],$args); + array_push($notranslate,$args); + } + } +} +function addnav($text,$link=false,$priv=false,$pop=false,$popsize="500x300"){ + global $navsection,$navbysection,$translation_namespace,$navschema; + global $block_new_navs; + + if ($block_new_navs) return; + + if ($link===false) { + // Don't do anything if text is "" + if ($text != "") { + addnavheader($text); + } + }else{ + $args = func_get_args(); + if ($text==""){ + //if there's no text to display, may as well just stick this on + //the nav stack now. + call_user_func_array("private_addnav",$args); + }else{ + if (!isset($navbysection[$navsection])) + $navbysection[$navsection] = array(); + $t = $args[0]; + if (is_array($t)) { + $t = $t[0]; + } + if (!array_key_exists($t,$navschema)) + $navschema[$t] = $translation_namespace; + array_push($navbysection[$navsection],array_merge($args,array("translate"=>false))); + } + } +} +/** + * Determine if a nav/URL is blocked + * + * @param string $link The nav to check + * @return bool + */ +function is_blocked($link) +{ + global $blockednavs; + if (isset($blockednavs['blockfull'][$link])) return true; + reset($blockednavs['blockpartial']); + while (list($l,$dummy)=each($blockednavs['blockpartial'])){ + $shouldblock = false; + if (substr($link,0,strlen($l))==$l) { + if (isset($blockednavs['unblockfull'][$link]) && + $blockednavs['unblockfull'][$link]) return false; + reset($blockednavs['unblockpartial']); + while (list($l2,$dummy)= each($blockednavs['unblockpartial'])){ + if (substr($link,0,strlen($l2))==$l2){ + return false; + } + } + return true; + } + } + return false; +} + + +/** + * Determine how many navs are available + * + * @param string $section The nav section to check + * @return int + */ +function count_viable_navs($section) +{ + global $navbysection, $blockednavs; + + if (isset($blockednavs['blockcat'][$section]) && $blockednavs['blockcat'][$section] == true) { + return 0; + } + $count = 0; + $val = $navbysection[$section]; + reset($val); + if (count($val) > 0) { + while(list($k, $nav) = each($val)) { + if (is_array($nav) && count($nav) > 0) { + $link = $nav[1]; // [0] is the text, [1] is the link + if (!is_blocked($link)) $count++; + } + } + } + return $count; +} + + +/** + * Determins if there are any navs for the player + * + * @return bool + */ +function checknavs() { + global $navbysection, $session; + + // If we already have navs entered (because someone stuck raw links in) + // just return true; + if (is_array($session['allowednavs']) && + count($session['allowednavs']) > 0) return true; + + // If we have any links which are going to be stuck in, return true + reset($navbysection); + while(list($key, $val) = each($navbysection)) { + if (count_viable_navs($key) > 0) { + reset($val); + while(list($k, $v) = each($val)) { + if (is_array($v) && count($v) > 0) return true; + } + } + } + + // We have no navs. + return false; +} + +/** + * Builds navs for display + * + * @return string Output formatted navs + */ +function buildnavs(){ + global $navbysection, $navschema, $session, $navnocollapse; + reset($navbysection); + $builtnavs=""; + while (list($key,$val)=each($navbysection)){ + $tkey = $key; + $navbanner=""; + if (count_viable_navs($key)>0){ + if ($key>"") { + if ($session['loggedin']) tlschema($navschema[$key]); + if (substr($key,0,7)=="!array!"){ + $key = unserialize(substr($key,7)); + } + $navbanner = private_addnav($key); + if ($session['loggedin']) tlschema(); + } + + $style = "default"; + $collapseheader = ""; + $collapsefooter = ""; + + if ($tkey > "" && (!array_key_exists($tkey,$navnocollapse) || !$navnocollapse[$tkey])) { + // Generate the collapsable section header + $args = array("name"=>"nh-{$key}", + "title"=>($key ? $key : "Unnamed Navs")); + $args = modulehook("collapse-nav{", $args); + if (isset($args['content'])) + $collapseheader = $args['content']; + if (isset($args['style'])) + $style = $args['style']; + if (!($key > "") && $style == "classic") { + $navbanner = ""; + } + } + + reset($val); + $sublinks = ""; + while (list($k,$v)=each($val)){ + if (is_array($v) && count($v)>0){ + $sublinks .= call_user_func_array("private_addnav",$v); + }//end if + }//end while + + // Generate the enclosing collapsable section footer + if ($tkey > "" && (!array_key_exists($tkey,$navnocollapse) || !$navnocollapse[$tkey])) { + $args = modulehook("}collapse-nav"); + if (isset($args['content'])) + $collapsefooter = $args['content']; + } + + switch ($style) { + case "classic": + $navbanner = str_replace("","",$navbanner); + $navbanner = str_replace("","",$navbanner); + // Build the nav section + $builtnavs .= "{$navbanner}{$collapseheader}{$sublinks}
{$collapsefooter}\n"; + break; + case "default": + default: + // Is style isn't set (should the module not be active) + // - this catches it + // Build the nav section + $builtnavs .= "{$navbanner}{$collapseheader}{$sublinks}{$collapsefooter}\n"; + break; + } + }//end if + }//end while + $navbysection = array(); + return $builtnavs; +}//end function + +$accesskeys=array(); +$quickkeys=array(); +/** + * Private functions (Undocumented) + * + * @param string $text + * @param string $link + * @param bool $priv + * @param bool $pop + * @param bool $popsize + * @return mixed + */ +function private_addnav($text,$link=false,$priv=false,$pop=false,$popsize="500x300"){ + //don't call this directly please. I'll break your thumbs if you do. + global $nav,$session,$accesskeys,$REQUEST_URI,$quickkeys,$navschema,$notranslate; + + if (is_blocked($link)) return false; + + $thisnav = ""; + $unschema = 0; + $translate=true; + if (isset($notranslate)) + if (in_array(array($text,$link),$notranslate)) $translate=false; + + if (is_array($text)){ + if ($text[0] && $session['loggedin']) { + if ($link === false) $schema = "!array!" . serialize($text); + else $schema = $text[0]; + if ($translate) { + tlschema($navschema[$schema]); + $unschema = 1; + } + } + if ($link != "!!!addraw!!!") { + if ($translate) $text[0] = translate($text[0]); + $text = call_user_func_array("sprintf",$text); + } else { + $text = call_user_func_array("sprintf",$text); + } + }else{ + if ($text && $session['loggedin'] && $translate) { + tlschema($navschema[$text]); + $unschema = 1; + } + if ($link != "!!!addraw!!!" && $text>"" && $translate) $text = translate($text); //leave the hack in here for now, use addnav_notl please + } + + $extra=""; + $ignoreuntil=""; + if ($link===false){ + $text = holidayize($text,'nav'); + $thisnav.=tlbutton_pop().templatereplace("navhead",array("title"=>appoencode($text,$priv))); + }elseif ($link === "") { + $text = holidayize($text,'nav'); + $thisnav.=tlbutton_pop().templatereplace("navhelp",array("text"=>appoencode($text,$priv))); + } elseif ($link == "!!!addraw!!!") { + $thisnav .= $text; + }else{ + if ($text!=""){ + $extra=""; + if (strpos($link,"?")){ + $extra="&c={$session['counter']}"; + }else{ + $extra="?c={$session['counter']}"; + } + + $extra.="-".date("His"); + //hotkey for the link. + $key=""; + if ($text[1]=="?") { + // check to see if a key was specified up front. + $hchar = strtolower($text[0]); + if ($hchar==' ' || array_key_exists($hchar,$accesskeys) && $accesskeys[$hchar]==1){ + $text = substr($text,2); + $text = holidayize($text,'nav'); + if ($hchar == ' ') $key = " "; + }else{ + $key = $text[0]; + $text = substr($text,2); + $text = holidayize($text,'nav'); + $found=false; + $text_len = strlen($text); + for ($i=0;$i<$text_len; ++$i){ + $char = $text[$i]; + if ($ignoreuntil == $char){ + $ignoreuntil=""; + }else{ + if ($ignoreuntil<>""){ + if ($char=="<") $ignoreuntil=">"; + if ($char=="&") $ignoreuntil=";"; + if ($char=="`") $ignoreuntil=$text[$i+1]; + }else{ + if ($char==$key) { + $found=true; + break; + } + } + } + } + if ($found==false) { + //the hotkey for this link wasn't actually in the + //text, prepend it in parens. + if (strpos($text, "__") !== false) { + $text=str_replace("__", "(".$key.") ", $text); + }else{ + $text="(".strtoupper($key).") ".$text; + } + $i=strpos($text, $key); + } + } + } else { + $text = holidayize($text,'nav'); + } + + if ($key==""){ + //we have no previously defined key. Look for a new one. + for ($i=0;$i"") { + if ($char=="<") $ignoreuntil=">"; + if ($char=="&") $ignoreuntil=";"; + if ($char=="`") $ignoreuntil=substr($text,$i+1,1); + }else{ + break; + } + } + } + } + if (!isset($i)) $i=0; + if ($iappoencode($text,$priv), + "link"=>HTMLEntities($link.($pop!=true?$extra:""), ENT_COMPAT, getsetting("charset", "ISO-8859-1")), + "accesskey"=>$keyrep, + "popup"=>($pop==true ? "target='_blank'".($popsize>""?" onClick=\"".popup($link,$popsize)."; return false;\"":"") : "") + )); + $n = str_replace(" diff --git a/lotgd-web/lotgd/lib/output_array.php b/lotgd-web/lotgd/lib/output_array.php new file mode 100755 index 0000000..34e4714 --- /dev/null +++ b/lotgd-web/lotgd/lib/output_array.php @@ -0,0 +1,34 @@ +0) $output.=", "; + if (is_array($val)){ + $output.="'".addslashes($key)."'=>".code_array($val); + }else{ + $output.="'".addslashes($key)."'=>'".addslashes($val)."'"; + } + $i++; + } + $output.=")\n"; + return $output; +} +?> diff --git a/lotgd-web/lotgd/lib/pageparts.php b/lotgd-web/lotgd/lib/pageparts.php new file mode 100755 index 0000000..64baf8c --- /dev/null +++ b/lotgd-web/lotgd/lib/pageparts.php @@ -0,0 +1,806 @@ +$script)); + if ($session['user']['loggedin']) { + modulehook("everyheader-loggedin", array('script'=>$script)); + } + $runheaders[$script] = true; + modulehook("header-$script"); + } + } + + $arguments = func_get_args(); + if (!$arguments || count($arguments) == 0) { + $arguments = array("Legend of the Green Dragon"); + } + $title = call_user_func_array("sprintf_translate", $arguments); + $title = holidayize($title,'title'); + $title = sanitize($title); + calculate_buff_fields(); + + $header = $template['header']; + $header=str_replace("{title}",$title,$header); + $header.=tlbutton_pop(); +} + +/** + * Returns an output formatted popup link based on JavaScript + * + * @param string $page The URL to open + * @param string $size The size of the popup window (Default: 550x300) + * @return string + */ +function popup($page,$size="550x300"){ + //$s = split("x",$size); + $s = explode("x",$size); + return "window.open('$page','".preg_replace("([^[:alnum:]])","",$page)."','scrollbars=yes,resizable=yes,width={$s[0]},height={$s[1]}').focus()"; +} + +/** + * Brings all the output elements together and terminates the rendering of the page. Saves the current user info and updates the rendering statistics + * Hooks provided: + * footer-{$script name} + * everyfooter + * + */ +function page_footer($saveuser=true){ + global $output,$nestedtags,$header,$nav,$session,$REMOTE_ADDR, + $REQUEST_URI,$pagestarttime,$quickkeys,$template,$y2,$z2, + $logd_version,$copyright,$SCRIPT_NAME,$nopopups, $footer, + $dbinfo; + $z = $y2^$z2; + $footer = $template['footer']; + //page footer module hooks + $script = substr($SCRIPT_NAME,0,strpos($SCRIPT_NAME,".")); + $replacementbits = array(); + $replacementbits = modulehook("footer-$script",$replacementbits); + if ($script == "runmodule" && (($module = httpget('module'))) > "") { + // This modulehook allows you to hook directly into any module without + // the need to hook into footer-runmodule and then checking for the + // required module. + modulehook("footer-$module",$replacementbits); + } + // Pass the script file down into the footer so we can do something if + // we need to on certain pages (much like we do on the header. + // Problem is 'script' is a valid replacement token, so.. use an + // invalid one which we can then blow away. + $replacementbits['__scriptfile__'] = $script; + $replacementbits = modulehook("everyfooter",$replacementbits); + if ($session['user']['loggedin']) { + $replacementbits = modulehook("everyfooter-loggedin", $replacementbits); + } + unset($replacementbits['__scriptfile__']); + //output any template part replacements that above hooks need (eg, + //advertising) + reset($replacementbits); + while (list($key,$val)=each($replacementbits)){ + $header = str_replace("{".$key."}","{".$key."}".join($val,""),$header); + $footer = str_replace("{".$key."}","{".$key."}".join($val,""),$footer); + } + + $builtnavs = buildnavs(); + + restore_buff_fields(); + calculate_buff_fields(); + + tlschema("common"); + + $charstats = charstats(); + + restore_buff_fields(); + + $sql = "SELECT motddate FROM " . db_prefix("motd") . " ORDER BY motditem DESC LIMIT 1"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + db_free_result($result); + $headscript = ""; + if (isset($session['user']['lastmotd']) && + ($row['motddate']>$session['user']['lastmotd']) && + (!isset($nopopup[$SCRIPT_NAME]) || $nopopups[$SCRIPT_NAME]!=1) && + $session['user']['loggedin']){ + $headscript.=popup("motd.php"); + $session['needtoviewmotd']=true; + }else{ + $session['needtoviewmotd']=false; + } + $pre_headscript = ""; + if ($headscript>""){ + $header=str_replace("{headscript}",$pre_headscript."",$header); + }else{ + $header = str_replace("{headscript}",$pre_headscript,$header); + } + + $script = ""; + + if (!isset($session['user']['name'])) $session['user']['name']=""; + if (!isset($session['user']['login'])) $session['user']['login']=""; + + //clean up unclosed output tags. + while (list($key,$val)=each($nestedtags)){ + if ($nestedtags[$key] === true) $output.=""; + + unset($nestedtags[$key]); + } + //output keypress script + $script.=""; + + //handle paypal + if (strpos($footer,"{paypal}") || strpos($header,"{paypal}")){ $palreplace="{paypal}"; }else{ $palreplace="{stats}"; } + + //NOTICE | + //NOTICE | Although under the license, you're not required to keep this + //NOTICE | paypal link, I do request, as the author of this software + //NOTICE | which I have made freely available to you, that you leave it in. + //NOTICE | + $paypalstr = '
'; + $currency = getsetting("paypalcurrency", "USD"); + + if (!isset($_SESSION['logdnet']) || !isset($_SESSION['logdnet']['']) || $_SESSION['logdnet']['']=="" || !isset($session['user']['laston']) || date("Y-m-d H:i:s",strtotime("-1 hour"))>$session['user']['laston']){ + $already_registered_logdnet = false; + }else{ + $already_registered_logdnet = true; + } + + if (getsetting("logdnet",0) && $session['user']['loggedin'] && !$already_registered_logdnet){ + //account counting, just for my own records, I don't use this in the calculation for server order. + $sql = "SELECT count(*) AS c FROM " . db_prefix("accounts"); + $result = db_query_cached($sql,"acctcount",600); + $row = db_fetch_assoc($result); + $c = $row['c']; + $a = getsetting("serverurl","http://".$_SERVER['SERVER_NAME'].($_SERVER['SERVER_PORT'] == 80?"":":".$_SERVER['SERVER_PORT']).dirname($_SERVER['REQUEST_URI'])); + if (!preg_match("/\\/$/", $a)) { + $a = $a . "/"; + savesetting("serverurl", $a); + } + + $l = getsetting("defaultlanguage","en"); + $d = getsetting("serverdesc","Another LoGD Server"); + $e = getsetting("gameadminemail", "postmaster@localhost.com"); + $u = getsetting("logdnetserver","http://logdnet.logd.com/"); + if (!preg_match("/\\/$/", $u)) { + $u = $u . "/"; + savesetting("logdnetserver", $u); + } + + + global $logd_version; + $v = $logd_version; + $c = rawurlencode($c); + $a = rawurlencode($a); + $l = rawurlencode($l); + $d = rawurlencode($d); + $e = rawurlencode($e); + $v = rawurlencode($v); + $u = rawurlencode($u); + $paypalstr .= ""; + }else{ + $paypalstr .= '
+ + + + + + + + + + + +
'; + } + // DP Donation button + $paypalstr .= '
'; + $paypalstr .= '
+ + + + + + + + + + + +
'; + $paysite = getsetting("paypalemail", ""); + if ($paysite != "") { + $paypalstr .= '
'; + $paypalstr .= '
+ + + + +'; + if (file_exists("payment.php")) { + $paypalstr .= ''; + } + $paypalstr .= ' + + + + + + +
'; + } + $paypalstr .= '
'; + $footer=str_replace($palreplace,(strpos($palreplace,"paypal")?"":"{stats}").$paypalstr,$footer); + $header=str_replace($palreplace,(strpos($palreplace,"paypal")?"":"{stats}").$paypalstr,$header); + //NOTICE | + //NOTICE | Although I will not deny you the ability to remove the above + //NOTICE | paypal link, I do request, as the author of this software + //NOTICE | which I made available for free to you that you leave it in. + //NOTICE | + + //output the nav + $footer = str_replace("{".($z)."}",$$z,$footer); + $header=str_replace("{nav}",$builtnavs,$header); + $footer=str_replace("{nav}",$builtnavs,$footer); + //output the motd + + $header = str_replace("{motd}", motdlink(), $header); + $footer = str_replace("{motd}", motdlink(), $footer); + //output the mail link + if (isset($session['user']['acctid']) && $session['user']['acctid']>0 && $session['user']['loggedin']) { + $header=str_replace("{mail}",maillink(),$header); + $footer=str_replace("{mail}",maillink(),$footer); + }else{ + $header=str_replace("{mail}","",$header); + $footer=str_replace("{mail}","",$footer); + } + //output petition count + + $header=str_replace("{petition}","
".translate_inline("Petition for Help")."",$header); + $footer=str_replace("{petition}","".translate_inline("Petition for Help")."",$footer); + if ($session['user']['superuser'] & SU_EDIT_PETITIONS){ + $sql = "SELECT count(petitionid) AS c,status FROM " . db_prefix("petitions") . " GROUP BY status"; + $result = db_query_cached($sql,"petition_counts"); + $petitions=array(0=>0,1=>0,2=>0,3=>0,4=>0,5=>0,6=>0,7=>0); + while ($row = db_fetch_assoc($result)) { + $petitions[(int)$row['status']] = $row['c']; + } + $pet = translate_inline("`0`bPetitions:`b"); + $ued = translate_inline("`0`bUser Editor`b"); + db_free_result($result); + if ($session['user']['superuser'] & SU_EDIT_USERS){ + $p = "$ued|$pet"; + addnav("", "user.php"); + addnav("", "viewpetition.php"); + } else { + $p = "$pet"; + addnav("", "viewpetition.php"); + } + $p .= " `\${$petitions[5]}`0|`^{$petitions[4]}`0|`b{$petitions[0]}`b|{$petitions[1]}|`!{$petitions[3]}`0|`#{$petitions[7]}`0|`%{$petitions[6]}`0|`i{$petitions[2]}`i"; + $pcount = templatereplace("petitioncount", array("petitioncount"=>appoencode($p, true))); + $footer = str_replace("{petitiondisplay}", $pcount, $footer); + $header = str_replace("{petitiondisplay}", $pcount, $header); + } else { + $footer = str_replace("{petitiondisplay}", "", $footer); + $header = str_replace("{petitiondisplay}", "", $header); + } + //output character stats + $footer=str_replace("{stats}",$charstats,$footer); + $header=str_replace("{stats}",$charstats,$header); + //do something -- I don't know what + $header=str_replace("{script}",$script,$header); + //output view PHP source link + $sourcelink = "source.php?url=".preg_replace("/[?].*/","",($_SERVER['REQUEST_URI'])); + $footer=str_replace("{source}","".translate_inline("View PHP Source")."",$footer); + $header=str_replace("{source}","".translate_inline("View PHP Source")."",$header); + //output version + $footer=str_replace("{version}", "Version: $logd_version", $footer); + //output page generation time + $gentime = getmicrotime()-$pagestarttime; + $session['user']['gentime']+=$gentime; + $session['user']['gentimecount']++; + $footer=str_replace("{pagegen}","Page gen: ".round($gentime,3)."s / ".$dbinfo['queriesthishit']." queries (".round($dbinfo['querytime'],3)."s), Ave: ".round($session['user']['gentime']/$session['user']['gentimecount'],3)."s - ".round($session['user']['gentime'],3)."/".round($session['user']['gentimecount'],3)."",$footer); + + tlschema(); + + //clean up spare {fields}s from header and footer (in case they're not used) + $footer = preg_replace("/{[^} \t\n\r]*}/i","",$footer); + $header = preg_replace("/{[^} \t\n\r]*}/i","",$header); + + //finalize output + $output=$header.$output.$footer; + $session['user']['gensize']+=strlen($output); + $session['output']=$output; + if ($saveuser === true) { + saveuser(); + } + unset($session['output']); + //this somehow allows some frames to load before the user's navs say it can + //session_write_close(); + echo $output; + exit(); +} + +/** + * Page header for popup windows. + * + * @param string $title The title of the popup window + */ +function popup_header($title="Legend of the Green Dragon"){ + global $header, $template; + + translator_setup(); + prepare_template(); + + modulehook("header-popup"); + + $arguments = func_get_args(); + if (!$arguments || count($arguments) == 0) { + $arguments = array("Legend of the Green Dragon"); + } + $title = call_user_func_array("sprintf_translate", $arguments); + $title = holidayize($title,'title'); + + $header = $template['popuphead']; + $header = str_replace("{title}", $title, $header); +} + +/** + * Ends page generation for popup windows. Saves the user account info - doesn't update page generation stats + * + */ +function popup_footer(){ + global $output,$nestedtags,$header,$session,$y2,$z2,$copyright, $template; + + while (list($key,$val)=each($nestedtags)){ + if ($nestedtags[$key] === true) $output.=""; + unset($nestedtags[$key]); + } + + $footer = $template['popupfoot']; + + // Pass the script file down into the footer so we can do something if + // we need to on certain pages (much like we do on the header. + // Problem is 'script' is a valid replacement token, so.. use an + // invalid one which we can then blow away. + $replacementbits = modulehook("footer-popup",array()); + //output any template part replacements that above hooks need + reset($replacementbits); + while (list($key,$val)=each($replacementbits)){ + $header = str_replace("{".$key."}","{".$key."}".join($val,""),$header); + $footer = str_replace("{".$key."}","{".$key."}".join($val,""),$footer); + } + + $z = $y2^$z2; + $footer = str_replace("{".($z)."}",$$z, $footer); + + //clean up spare {fields}s from header and footer (in case they're not used) + $footer = preg_replace("/{[^} \t\n\r]*}/i","",$footer); + $header = preg_replace("/{[^} \t\n\r]*}/i","",$header); + + $output=$header.$output.$footer; + saveuser(); + session_write_close(); + echo $output; + exit(); +} + +$charstat_info = array(); +$last_charstat_label = ""; +/** + * Resets the character stats array + * + */ +function wipe_charstats(){ + global $charstat_info, $last_charstat_label; + $last_charstat_label = ""; + $charstat_info = array(); +} + +/** + * Add a attribute and/or value to the character stats display + * + * @param string $label The label to use + * @param mixed $value (optional) value to display + */ +function addcharstat($label, $value=false) { + global $charstat_info, $last_charstat_label; + if ($value === false) { + if (!isset($charstat_info[$label])) + $charstat_info[$label] = array(); + $last_charstat_label=$label; + } else { + if ($last_charstat_label=="") { + $last_charstat_label = "Other Info"; + addcharstat($last_charstat_label); + } + $charstat_info[$last_charstat_label][$label]=$value; + } +} + +/** + * Returns the character stat related to the category ($cat) and the label + * + * @param string $cat The relavent category for the stat + * @param string $label The label of the character stat + * @return mixed The value associated with the stat + */ +function getcharstat($cat, $label) { + global $charstat_info; + return $charstat_info[$cat][$label]; +} + +/** + * Sets a value to the passed category & label for character stats + * + * @param string $cat The category for the char stat + * @param string $label The label associated with the value + * @param mixed $val The value of the attribute + */ +function setcharstat($cat, $label, $val) { + global $charstat_info, $last_charstat_label; + if (!isset($charstat_info[$cat][$label])) { + $oldlabel = $last_charstat_label; + addcharstat($cat); + addcharstat($label, $val); + $last_charstat_label = $oldlabel; + } else { + $charstat_info[$cat][$label] = $val; + } +} + +/** + * Returns output formatted character stats + * + * @param array $buffs + * @return string + */ +function getcharstats($buffs){ + //returns output formatted character statistics. + global $charstat_info; + $charstat_str = templatereplace("statstart"); + reset($charstat_info); + foreach ($charstat_info as $label=>$section) { + if (count($section)) { + $arr = array("title"=>translate_inline($label)); + $sectionhead = templatereplace("stathead", $arr); + reset($section); + foreach ($section as $name=>$val) { + if ($name==$label){ + // when the section and stat name are equal, use + // 'statbuff' template piece. + $a2 = array("title"=>translate_inline("`0$name"), + "value"=>"`^$val`0"); + $charstat_str .= templatereplace("statbuff", $a2); + }else{ + $a2 = array("title"=>translate_inline("`&$name`0"), + "value"=>"`^$val`0"); + $charstat_str .= $sectionhead.templatereplace("statrow", $a2); + $sectionhead = ""; + } + } + } + } + $charstat_str .= templatereplace("statbuff", + array("title"=>translate_inline("`0Buffs"),"value"=>$buffs)); + $charstat_str .= templatereplace("statend"); + return appoencode($charstat_str,true); +} + +/** + * Returns the value associated with the section & label. Returns an empty string if the stat isn't set + * + * @param string $section The character stat section + * @param string $title The stat display label + * @return mixed The value associated with the stat + */ +function getcharstat_value($section,$title){ + global $charstat_info; + if (isset($charstat_info[$section][$title])){ + return $charstat_info[$section][$title]; + }else{ + return ""; + } +} + +/** + * Returns the current character stats or (if the character isn't logged in) the currently online players + * Hooks provided: + * charstats + * + * @return array The current stats for this character or the list of online players + */ +function charstats(){ + global $session, $playermount, $companions; + + wipe_charstats(); + + $u =& $session['user']; + + if ($session['loggedin']){ + $u['hitpoints']=round($u['hitpoints'],0); + $u['experience']=round($u['experience'],0); + $u['maxhitpoints']=round($u['maxhitpoints'],0); + $spirits=array(-6=>"Resurrected",-2=>"Very Low",-1=>"Low","0"=>"Normal",1=>"High",2=>"Very High"); + if ($u['alive']){ }else{ $spirits[(int)$u['spirits']] = "DEAD"; } + //calculate_buff_fields(); + reset($session['bufflist']); + $atk=$u['attack']; + $def=$u['defense']; + $buffcount = 0; + $buffs = ""; + while (list($key,$val)=each($session['bufflist'])){ + if (isset($val['suspended']) && $val['suspended']) continue; + if (isset($val['atkmod'])) { + $atk *= $val['atkmod']; + } + if (isset($val['defmod'])) { + $def *= $val['defmod']; + } + // Short circuit if the name is blank + if ($val['name'] > "" || $session['user']['superuser'] & SU_DEBUG_OUTPUT){ + tlschema($val['schema']); + if ($val['name']=="") + $val['name'] = "DEBUG: {$key}"; + if (is_array($val['name'])) { + $val['name'][0] = str_replace("`%","`%%",$val['name'][0]); + $val['name']=call_user_func_array("sprintf_translate", $val['name']); + } else { //in case it's a string + $val['name']=translate_inline($val['name']); + } + if ($val['rounds']>=0){ + // We're about to sprintf, so, let's makes sure that + // `% is handled. + //$n = translate_inline(str_replace("`%","`%%",$val['name'])); + $b = translate_inline("`#%s `7(%s rounds left)`n","buffs"); + $b = sprintf($b, $val['name'], $val['rounds']); + $buffs.=appoencode($b, true); + }else{ + $buffs.= appoencode("`#{$val['name']}`n",true); + } + tlschema(); + $buffcount++; + } + } + if ($buffcount==0){ + $buffs.=appoencode(translate_inline("`^None`0"),true); + } + + $atk = round($atk, 2); + $def = round($def, 2); + if ($atk < $u['attack']){ + $atk = round($u['attack'],1)."`\$".round($atk-$u['attack'],1); + }else if($atk > $u['attack']){ + $atk = round($u['attack'],1)."`@+".round($atk-$u['attack'],1); + } else { + // They are equal, display in the 1 signifigant digit format. + $atk = round($atk,1); + } + if ($def < $u['defense']){ + $def = round($u['defense'],1)."`\$".round($def-$u['defense'],1); + }else if($def > $u['defense']){ + $def = round($u['defense'],1)."`@+".round($def-$u['defense'],1); + } else { + // They are equal, display in the 1 signifigant digit format. + $def = round($def, 1); + } + + addcharstat("Vital Info"); + addcharstat("Name", $u['name']); + addcharstat("Level", "`b".$u['level'].check_temp_stat("level",1)."`b"); + if ($u['alive']) { + addcharstat("Hitpoints", $u['hitpoints'].check_temp_stat("hitpoints",1). + "`0/".$u['maxhitpoints'].check_temp_stat("maxhitpoints",1)); + addcharstat("Turns", $u['turns'].check_temp_stat("turns",1)); + addcharstat("Attack", $atk.check_temp_stat("attack",1)); + addcharstat("Defense", $def.check_temp_stat("defense",1)); + } else { + $maxsoul = $u['level'] * 5 + 50; + addcharstat("Soulpoints", $u['soulpoints'].check_temp_stat("soulpoints",1)."`0/".$maxsoul); + addcharstat("Torments", $u['gravefights'].check_temp_stat("gravefights",1)); + addcharstat("Psyche", 10+round(($u['level']-1)*1.5)); + addcharstat("Spirit", 10+round(($u['level']-1)*1.5)); + } + addcharstat("Spirits", translate_inline("`b".$spirits[(int)$u['spirits']]."`b")); + if ($u['race'] != RACE_UNKNOWN) { + addcharstat("Race", translate_inline($u['race'],"race")); + }else { + addcharstat("Race", translate_inline(RACE_UNKNOWN,"race")); + } + if (count($companions)>0) { + addcharstat("Companions"); + foreach ($companions as $name=>$companion) { + if ($companion['hitpoints'] > 0 ||(isset($companion['cannotdie']) && $companion['cannotdie'] == true)) { + if ($companion['hitpoints']<0) { + $companion['hitpoints'] = 0; + } + if($companion['hitpoints']<$companion['maxhitpoints']) { + $color = "`\$"; + }else{ + $color = "`@"; + } + if (isset($companion['suspended']) && $companion['suspended'] == true) { + $suspcode = "`7 *"; + } else { + $suspcode = ""; + } + addcharstat($companion['name'], $color.($companion['hitpoints'])."`7/`&".($companion['maxhitpoints'])."$suspcode`0"); + } + } + } + addcharstat("Personal Info"); + if ($u['alive']) { + addcharstat("Gold", $u['gold'].check_temp_stat("gold",1)); + } else { + addcharstat("Favor", $u['deathpower'].check_temp_stat("deathpower",1)); + } + addcharstat("Gems", $u['gems'].check_temp_stat("gems",1)); + addcharstat("Experience", $u['experience'].check_temp_stat("experience",1)); + addcharstat("Equipment Info"); + addcharstat("Weapon", $u['weapon']); + addcharstat("Armor", $u['armor']); + if ($u['hashorse']) + addcharstat("Creature", $playermount['mountname'] . "`0"); + + modulehook("charstats"); + + $charstat = getcharstats($buffs); + + if (!is_array($session['bufflist'])) $session['bufflist']=array(); + return $charstat; + }else{ + $ret = ""; + if ($ret = datacache("charlisthomepage")){ + + }else{ + $onlinecount=0; + // If a module wants to do it's own display of the online chars, + // let it. + $list = modulehook("onlinecharlist", array()); + if (isset($list['handled']) && $list['handled']) { + $onlinecount = $list['count']; + $ret = $list['list']; + } else { + $sql="SELECT name,alive,location,sex,level,laston,loggedin,lastip,uniqueid FROM " . db_prefix("accounts") . " WHERE locked=0 AND loggedin=1 AND laston>'".date("Y-m-d H:i:s",strtotime("-".getsetting("LOGINTIMEOUT",900)." seconds"))."' ORDER BY level DESC"; + $result = db_query($sql); + $ret.=appoencode(sprintf(translate_inline("`bOnline Characters (%s players):`b`n"),db_num_rows($result))); + while ($row = db_fetch_assoc($result)) { + $ret.=appoencode("`^{$row['name']}`n"); + $onlinecount++; + } + db_free_result($result); + if ($onlinecount==0) + $ret.=appoencode(translate_inline("`iNone`i")); + } + savesetting("OnlineCount",$onlinecount); + savesetting("OnlineCountLast",strtotime("now")); + updatedatacache("charlisthomepage",$ret); + } + return $ret; + } +} +/** + * Loads the template into the current session. If the template doesn't + * exist - uses the default (admin-defined) template, and then falls back + * to jade.htm + * + * @param string $templatename The template name (minus the path) + * @return array The template split into the sections defined by ")); + if ($fieldname!=""){ + $template[$fieldname]=substr($val,strpos($val,"-->")+3); + modulehook("template-{$fieldname}", + array("content"=>$template[$fieldname])); + } + } + return $template; +} + +/** + * Returns a display formatted (and popup enabled) mail link - determines if unread mail exists and highlights the link if needed + * + * @return string The formatted mail link + */ +function maillink(){ + global $session; + $sql = "SELECT sum(if(seen=1,1,0)) AS seencount, sum(if(seen=0,1,0)) AS notseen FROM " . db_prefix("mail") . " WHERE msgto=\"".$session['user']['acctid']."\""; + $result = db_query_cached($sql,"mail-{$session['user']['acctid']}",86400); + $row = db_fetch_assoc($result); + db_free_result($result); + $row['seencount']=(int)$row['seencount']; + $row['notseen']=(int)$row['notseen']; + if ($row['notseen']>0){ + return sprintf("".translate_inline("Ye Olde Mail: %s new, %s old", 'common')."",$row['notseen'],$row['seencount']); + }else{ + return sprintf("".translate_inline("Ye Olde Mail: %s new, %s old", 'common')."",$row['notseen'],$row['seencount']); + } +} + +/** + * Returns a display formatted (and popup enabled) MOTD link - determines if unread MOTD items exist and highlights the link if needed + * + * @return string The formatted MOTD link + */ +function motdlink(){ + global $session; + if ($session['needtoviewmotd']){ + return "".translate_inline("MoTD").""; + }else{ + return "".translate_inline("MoTD").""; + } +} +?> diff --git a/lotgd-web/lotgd/lib/partner.php b/lotgd-web/lotgd/lib/partner.php new file mode 100755 index 0000000..8033bae --- /dev/null +++ b/lotgd-web/lotgd/lib/partner.php @@ -0,0 +1,37 @@ + diff --git a/lotgd-web/lotgd/lib/petition/petition_default.php b/lotgd-web/lotgd/lib/petition/petition_default.php new file mode 100755 index 0000000..281c6b9 --- /dev/null +++ b/lotgd-web/lotgd/lib/petition/petition_default.php @@ -0,0 +1,104 @@ +0){ + $ip = explode(".",$_SERVER['REMOTE_ADDR']); + array_pop($ip); + $ip = join($ip,".")."."; + $sql = "SELECT count(petitionid) AS c FROM ".db_prefix("petitions")." WHERE (ip LIKE '$ip%' OR id = '".addslashes($_COOKIE['lgi'])."') AND date > '".date("Y-m-d H:i:s",strtotime("-1 day"))."'"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + if ($row['c'] < 5 || (isset($session['user']['superuser']) && $session['user']['superuser']&~SU_DOESNT_GIVE_GROTTO)){ + if (!isset($session['user']['acctid'])) + $session['user']['acctid']=0; + if (!isset($session['user']['password'])) + $session['user']['password']=""; + $p = $session['user']['password']; + unset($session['user']['password']); + $date = date("Y-m-d H:i:s"); + $post['cancelpetition'] = false; + $post['cancelreason'] = 'The admins here decided they didn\'t like something about how you submitted your petition. They were also too lazy to give a real reason.'; + $post = modulehook("addpetition",$post); + if (!$post['cancelpetition']){ + unset($post['cancelpetition'], $post['cancelreason']); + $sql = "INSERT INTO " . db_prefix("petitions") . " (author,date,body,pageinfo,ip,id) VALUES (".(int)$session['user']['acctid'].",'$date',\"".addslashes(output_array($post))."\",\"".addslashes(output_array($session,"Session:"))."\",'{$_SERVER['REMOTE_ADDR']}','".addslashes($_COOKIE['lgi'])."')"; + db_query($sql); + // Fix the counter + invalidatedatacache("petitioncounts"); + // If the admin wants it, email the petitions to them. + if (getsetting("emailpetitions", 0)) { + // Yeah, the format of this is ugly. + require_once("lib/sanitize.php"); + $name = color_sanitize($session['user']['name']); + $url = getsetting("serverurl", + "http://".$_SERVER['SERVER_NAME'] . + ($_SERVER['SERVER_PORT']==80?"":":".$_SERVER['SERVER_PORT']) . + dirname($_SERVER['REQUEST_URI'])); + if (!preg_match("/\\/$/", $url)) { + $url = $url . "/"; + savesetting("serverurl", $url); + } + $tl_server = translate_inline("Server"); + $tl_author = translate_inline("Author"); + $tl_date = translate_inline("Date"); + $tl_body = translate_inline("Body"); + $tl_subject = sprintf_translate("New LoGD Petition at %s", $url); + + $msg = "$tl_server: $url\n"; + $msg .= "$tl_author: $name\n"; + $msg .= "$tl_date : $date\n"; + $msg .= "$tl_body :\n".output_array($post)."\n"; + mail(getsetting("gameadminemail","postmaster@localhost.com"),$tl_subject, $msg); + } + $session['user']['password']=$p; + output("Your petition has been sent to the server admin."); + output("Please be patient, most server admins have jobs and obligations beyond their game, so sometimes responses will take a while to be received."); + } else { + output("`\$There was a problem with your petition!`n"); + output("`@Please read the information below carefully; there was a problem with your petition, and it was not submitted.\n"); + rawoutput("
"); + output($post['cancelreason']); + rawoutput("
"); + } + }else{ + output("`\$`bError:`b There have already been %s petitions filed from your network in the last day; to prevent abuse of the petition system, you must wait until there have been 5 or fewer within the last 24 hours.",$row['c']); + output("If you have multiple issues to bring up with the staff of this server, you might think about consolidating those issues to reduce the overall number of petitions you file."); + } +}else{ + output("`c`b`\$Before sending a petition, please make sure you have read the motd.`n"); + output("Petitions about problems we already know about just take up time we could be using to fix those problems.`b`c`n"); + rawoutput("
"); + if ($session['user']['loggedin']) { + output("Your Character's Name: "); + output_notl("%s", $session['user']['name']); + rawoutput(""); + output("`nYour email address: "); + output_notl("%s", htmlentities($session['user']['emailaddress'])); + rawoutput(""); + } else { + output("Your Character's Name: "); + rawoutput(""); + output("`nYour email address: "); + rawoutput(""); + $nolog = translate_inline("Character is not logged in!!"); + rawoutput(""); + } + output("`nDescription of the problem:`n"); + $abuse = httpget("abuse"); + if ($abuse == "yes") { + rawoutput(""); + rawoutput("

".stripslashes(htmlentities(httpget("problem")))."


"); + } else { + rawoutput(""); + } + modulehook("petitionform",array()); + $submit = translate_inline("Submit"); + rawoutput("

"); + output("Please be as descriptive as possible in your petition."); + output("If you have questions about how the game works, please check out the FAQ.", true); + output("Petitions about game mechanics will more than likely not be answered unless they have something to do with a bug."); + output("Remember, if you are not signed in, and do not provide an email address, we have no way to contact you."); + rawoutput("
"); +} +?> diff --git a/lotgd-web/lotgd/lib/petition/petition_faq.php b/lotgd-web/lotgd/lib/petition/petition_faq.php new file mode 100755 index 0000000..c372242 --- /dev/null +++ b/lotgd-web/lotgd/lib/petition/petition_faq.php @@ -0,0 +1,31 @@ +%s
", $t, true); +$t = translate_inline("`@Frequently Asked Questions on Game Play (General)`0"); +output_notl("•%s
", $t, true); +$t = translate_inline("`@Frequently Asked Questions on Game Play (with spoilers)`0"); +output_notl("•%s
", $t, true); +$t = translate_inline("`@Frequently Asked Questions on Technical Issues`0"); +output_notl("•%s
", $t, true); +modulehook("faq-toc"); +modulehook("faq-posttoc"); +output("`nThank you,`nthe Management.`n"); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/petition/petition_faq1.php b/lotgd-web/lotgd/lib/petition/petition_faq1.php new file mode 100755 index 0000000..9a61a6b --- /dev/null +++ b/lotgd-web/lotgd/lib/petition/petition_faq1.php @@ -0,0 +1,87 @@ +$c
"); +output("`n`n`c`bGeneral questions`b`c`n"); +output("`^1. What is the purpose of this game?`n"); +output("`@To get chicks.`n"); +output("Seriously, though. The purpose is to slay the green dragon.`n`n"); +output("`^2. How do I find the green dragon?`n"); +output("`@You can't.`n"); +output("Well, sort of."); +output("You can't find her until you've reached a certain level."); +output("When you're at that level, it will be immediately obvious.`n`n"); +output("`^3. How do I increase my level?`n"); +output("`@Send us money.`n"); +output("No, don't send money - you increase your experience by fighting creatures in the forest."); +output("Once you've gotten enough experience, you can challenge your master in the village.`n`n"); +output("Well, you can send us money if you want (see PayPal link).`n`n"); +output("`^4. Why can't I beat my master?`n"); +output("`@He's far too wily for the likes of you.`n"); +output("Did you ask him if you have enough experience?`n"); +output("Have you tried purchasing some armor or weapons in the village?`n`n"); +output("`^5. I used up all my turns. How do I get more?`n"); +output("`@Send money.`n"); +output("No, put your wallet away."); +output("There *are* a few ways to get an extra turn or two, but by and large you just have to wait for tomorrow."); +output("When a new day comes you'll have more energy.`n"); +output("Don't bother asking us what those few ways are - some things are fun to find on your own.`n`n"); +output("`^6. When does a new day start?`n"); +output("`@Right after the old one ends.`n`n"); +output("`^7. Arghhh, you guys are killing me with your smart answers - can't you just give me a straight answer?`n"); +output("`@Nope.`n"); +output("Well, okay, new days correspond with the clock in the village (can also be viewed from other places)."); +output("When the clock strikes midnight, expect a new day to begin."); +output("The number of times a clock in LotGD strikes midnight per calendar day may vary by server."); +output("Beta server has 4 play days per calendar day, main server at LotGD.net has 2."); +output("Other servers depend on the admin.`n"); +output("This server has %s days per calendar day.`n`n", getsetting("daysperday", 2)); +output("`^8. Something's gone wrong!!! How do I let you know?`n"); +output("`@Send money."); +output("Better yet, send a petition."); +output("A petition should not say 'this doesn't work' or 'I'm broken' or 'I can't log in' or 'yo. Sup?'"); +output("A petition *should* be very complete in describing *what* doesn't work."); +output("Please tell us what happened, what the error message is (copy and paste is your friend), when it occurred, and anything else that may be helpful."); +output("\"`#I'm broken`@\" is not helpful."); +output("\"`#There are salmon flying out of my monitor when I log in`@\" is much more descriptive as well as humorous, although there's not much we can do about it."); +output("In general, please be patient with these requests - many people play the game, and as long as the admin is swamped with 'yo - Sup?' petitions, it will take some time to sift through them.`n`n"); +output("`^9. What if all I have to say is 'yo - sup?'?`n"); +output("`@If you don't have something nice (or useful, or interesting, or creative that adds to the general revelry of the game) to say, don't say anything.`n"); +output("But if you do want to converse with someone, send them an email through Ye Olde Post Office.`n`n"); +output("`^10. How do I use emotes?`n"); +output("`@Type :, ::, or /me before your text.`n`n"); +output("`^11. What's an emote?`n"); +output("`&Farmgirl AnObviousAnswer punches you in the gut.`n"); +output("`@That's an emote."); +output("You can emote in the village if you want to do an action rather than simply speaking.`n`n"); +output("`^12. How do you get colors in your name?`n"); +output("`@Eat funny mushrooms.`n"); +output("No, put that mushroom away, colors are given out by a site's admin for a variety of reasons -- for example it might signify that the character was integral to the beta-testing process - finding a bug, helping to create creatures, etc, or being married to the admin (*cough*Appleshiner*cough*)."); +output("Check with your admins to find out how they grant colors.`n`n"); +output("`^13. Sup dOOd, iz it cool 2 uz common IM wurds in the village? Cuz u no, it's faster. R u down wit that?`n"); +output("`@NO, for the love of Pete, use full words and good grammar, PLEASE!"); +output("These are not words: U, R, Ur, Cya, K, Kay, d00d, L8tr, sup, na and anything else like that!`n`n"); +output("`^14. Does that Curious Looking Rock have a purpose?`n"); +output("`@Of course it does! It confuses newbies!`n"); +output("Seriously, a wise man once said, \"`#Good things come to those who wait.`@\""); +output("This should also be applied to the Rock.`n`n"); +output("`^15. Wow, there are mounts AND familiars in the stables! Can I have one of each?`n"); +output("`@(Oh for the love of... [we get this question a lot])`n"); +output("No! Not! Nix! Nada! You can only have one creature at a time."); +output("Not two. Certainly not three. Four is right out. Five? You must be joking!"); +output("Now all together now, HOW many companion creatures can you have at a time?`n`n"); +output("`^16. Why not?`n"); +output("`@Because we're big meanies. Actually, the game's code just doesn't allow for that right now."); +output("It might in the next version, then again it might not. Please stop asking!`n`n"); +output("`^17. What's with the thingies before peoples' names?`n"); +output("`#<`2CLAN`#> `&Clan Member ClanMember strikes you with the flat side of his weapon.`n"); +output("`3\"`@You dare claim ignorance of my clan's famous deeds? I am `\$ClanMember`@, a member of the mighty clan CLAN, which is short for Completely Ludicrous And Nonsensical! We have performed many a deed after having planned it in the privacy of our `%Clan Hall`@."); +output("Our leaders and officers are among the mightiest in the land. Bolstered by the support of our friends and clanmates, we prevail!`3\"`n`n"); +output("`^18. I am so confused! What is going on in the village square/Garden/Inn/etc.?`n"); +output("`@A hubbub.`n"); +output("The fact is that because there's so many people, there can be several conversations happening at once in any given area."); +output("Also, the thing to understand is that not all the comments are posted immediately, and that sometimes a person won't press the refresh or add button for several minutes, during which time more comments could have been said that the person missed while they were typing their own."); +output("Not to worry, though. Don't be shy, join in!`n`n"); +rawoutput("
$c"); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/petition/petition_faq2.php b/lotgd-web/lotgd/lib/petition/petition_faq2.php new file mode 100755 index 0000000..37ec7b0 --- /dev/null +++ b/lotgd-web/lotgd/lib/petition/petition_faq2.php @@ -0,0 +1,55 @@ +$c
"); +output("`n`n`&(Warning, the FAQs below might contain some spoilers, so if you really want to discover things on your own, you'd be better off not reading too far."); +output("This is not a manual. It's a self-help pamphlet.)`n`n`n`n`n`n`n`n`n`n`n`n`n"); +output("`^1. What are gems for?`n"); +output("`@Gems are magical portals into the future. Gaze into the depths of a gem and you can see that which is to come.`n"); +output("Gullible? We sure hope not!`n"); +output("Lots of people love those little gemstones and are willing to trade things for them."); +output("Your local bartender is something of a gemologist.`n`n"); +output("`^2. How do you get gems?`n"); +output("`@To the mines with you!!`n"); +output("Actually, you can't mine them. (Well, you can, but only if you get lucky and find the mine. Warning though, mines can be dangerous.)"); +output("Gems can be found in the forest during 'special events' that happen randomly - if you play often enough, you're bound to stumble across one at some point."); +output("Gems can also be gained very occasionally from a forest fight.`n`n"); +output("`^3. Why do some people seem to have so many hitpoints at a low level?`n"); +output("`@Cause they're bigger than you.`n"); +output("No, really, they *are* bigger than you. You'll be big too someday.`n`n"); +output("`^4. Does that have something to do with the titles that people have?`n"); +output("`@But of course!`n"); +output("Indeed, every time you kill the dragon, you return to level one."); +output("If you kill the dragon enough times, you get a new title."); +output("So low level players with titles have had opportunities to embiggen themselves. (see Hall of Fame)`n`n"); +output("`^5. What's a buff?`n"); +output("`@It's what we use to shine our shoes.`n"); +output("Did you think it was some sort of temporary or permanent effect which affects your stats in a positive or negative manner? Hah!`n`n"); +output("`^6. Why does that old man keep hitting me with an ugly/pretty stick in the forest?`n"); +output("`@You look like a piñata!`n",true); +output("It's a special event that can add or remove charm.`n`n"); +output("`^7. Well, what's the point of charm?`n"); +output("`@To get chicks (or guys).`n"); +output("Well, actually, that *is* the point."); +output("Visit some folks at the Inn, and you ought to be able to figure this one out."); +output("The more charm you have, the more successful you'll be at wooing said folks.`n`n"); +output("`^8. Okay, I saw the man in the forest and he hit me with his ugly stick, but it says I'm uglier than the stick, and I made it lose a charm point. What's going on?`n"); +output("`@You're clearly the least charming person on the planet."); +output("And if you're the person who actually *asked* this question, you're also the dumbest."); +output("Use a little power of inference, wouldja?"); +output("No. Really.`n"); +output("Okay, we did say you were the dumbest, so: it means you currently have zero charm points.`n`n"); +output("`^9. How do I check my charm?`n"); +output("`@Take a peek in the mirror once in a while.`n"); +output("We jest - there's no mirror."); +output("You'll have to ask a friend how you look today - the responses may be vague, but they'll give you a clue how you're doing.`n`n"); +output("`^10. Who is the Management?`n"); +output("`@Appleshiner, Foilwench and Catscradler are in charge of this FAQ, but if something goes wrong, blame MightyE or Kendaer."); +output("They're in charge of everything else."); +output("To get ahold of them, or one of their trusty helpers, use the Petition for Help link.`n`n"); +output("`^11. How did they get to be so darn attractive, anyway?`n"); +output("`@Lots of at-home facials, my dear!!"); +output("MightyE especially enjoys the Grapefruit Essence Facial Masque.`n"); +rawoutput("
$c"); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/petition/petition_faq3.php b/lotgd-web/lotgd/lib/petition/petition_faq3.php new file mode 100755 index 0000000..b06adc2 --- /dev/null +++ b/lotgd-web/lotgd/lib/petition/petition_faq3.php @@ -0,0 +1,40 @@ +$c
"); +output("`n`n`c`bSpecific and technical questions`b`c`n"); +output("`^1.a. How can I have been killed by another player while I was currently playing?`n"); +output("`@The biggest cause of this is someone who began attacking you while you were offline, and completed the fight while you were online."); +output("This can even happen if you have been playing nonstop for the last hour."); +output("When someone starts a fight, they are forced by the game to finish it at some point."); +output("If they start a fight with you, and close their browser, the next time they log on, they will have to finish the fight."); +output("You will lose the lesser of the gold you had on hand when they attacked you, or the gold on hand when they finished the fight."); +output("So if you logged out with 1 gold on hand, they attack you, you log on, accumulate 2000 gold on hand, and they complete the fight, they will only come away from it with 1 gold."); +output("The same is true if you logged out with 2000 gold, and when they completed killing you, you only had 1 gold.`n`n"); +output("`^1.b. Why did it say I was killed in the fields when I slept in the inn?`n"); +output("`@The same thing can happen where someone started attacking you when you were in the fields, and finished after you had retired to the inn for the day."); +output("Keep in mind that if you are idle on the game for too long, you become a valid target for others to attack you in the fields."); +output("If you're going to go away from your computer for a few minutes, it's a good idea to head to the inn for your room first so that you don't risk someone attacking you while you're idle.`n`n"); +output("`^2. The game tells me that I'm not accepting cookies, what are they and what do I do?`n"); +output("`@Cookies are little bits of data that websites store on your computer so they can distinguish you from other players."); +output("Sometimes if you have a firewall it will block cookies, and some web browsers will let you block cookies."); +output("Check the documentation for your browser or firewall, or look around in its preferences for settings to modify whether or not you accept cookies."); +output("You need to at least accept session cookies to play the game, though all cookies are better.`n`n"); +output("`^3. What do`n  `iWarning: mysql_pconnect(): Lost connection to MySQL server during query in /home/lotgd/public_html/dbwrapper.php on line 82`i`nand`n  `iWarning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /home/lotgd/public_html/dbwrapper.php on line 54`i`nmean?`n", true); +output("`@It's a secret message from your computer telling you to stop staring at a screen and to go play outside.`n"); +output("Actually, it's a common temporary error, usually having to do with server load."); +output("Don't worry about it, just reload the page (it may take a few tries).`n`n"); +output("`^4. Nothing is responding for hours now - what should I do ?`n"); +output("`@Go outside play a bit in Real Life (tm). When you get back it will work again - if not it's a serious problem."); +output("Any server problems are caught less then 5 minutes after occurring, so if there is a problem, it's known - and we are working on it."); +output("Every mail and ye olde mail reporting the same problem is just making it harder for us to work.`n`n"); +output("`^5. Why is the site giving me so many popups?`n"); +output("`@Please turn off your popup blocker. These aren't ads.`n"); +output("We use popup windows in the game for the following purposes:`n"); +output("a) To file a petition.`n"); +output("b) To write and receive Ye Olde Mail.`n"); +output("c) To make sure you see our newest Message of the Day (MoTD).`n"); +output("That last one is very important, since until you've viewed it the window will continue to try to open on every page load. These messages are for server announcements such as outages, current known bugs (which you really don't have to petition about, since we already know of them), and other things that the staff think you need to know about right away.`n`n"); +rawoutput("
$c"); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/petition/petition_primer.php b/lotgd-web/lotgd/lib/petition/petition_primer.php new file mode 100755 index 0000000..7cb6b27 --- /dev/null +++ b/lotgd-web/lotgd/lib/petition/petition_primer.php @@ -0,0 +1,76 @@ +$c
"); +output("`n`n`^Welcome to the Legend of the Green Dragon New Player Primer`n`n"); +output("`^`bThe village square`b`n"); +output("`@Legend of the Green Dragon (LotGD) is turning out to be a fairly expansive game, with a lot of areas to explore."); +output("It's easy to get lost with all that there is to do out there, so keep in mind that the village square is pretty much the center of the village you start in."); +output("This area will give you access to most other areas that you can get to, with a few exceptions (we'll talk about those in a little while)."); +output("If you ever get lost, or are not sure what's going on, head to the village square and regain your bearings.`n`n"); +output("`^`bYour first day`b`n"); +output("`@Your first day in the world can be very confusing!"); +output("You're presented with a lot of information, and you don't need almost any of it! It's true!"); +output("One thing you should probably keep an eye on though, are your hit points. This is found under \"Vital Info.\""); +output("No matter what profession you choose, in the end, you are some kind of warrior or fighter, and so you need to learn how to do battle."); +output("The best way to do this is to look for creatures to kill in the forest."); +output("When you find one, check it out, and make sure that it's not a higher level than you, because if it is, you might not live through the fight."); +output("Keep in mind that you can always try to run away from something that you encountered, but sometimes it might take several tries before you get away."); +output("You might want to buy armor and weapons in the village square in order to give yourself a better chance against these creatures out in the forest.`n`n"); +output("Once you have defeated a creature, you'll notice that you're probably a little hurt."); +output("Head on over to the Healer's Hut, and you can get patched up in short order."); +output("While you're level 1, healing is free, but as you advance, it becomes more and more expensive."); +output("Also keep in mind that it's more expensive to heal 1 point, then later heal 1 point again than it is to heal 2 in one shot."); +output("So if you're trying to save up some money, and you're barely hurt, you might risk a fight or two while you're a little hurt, and heal the damage from several fights in one shot.`n`n"); +output("After you've killed a few creatures, you should head back to the village, into Bluspring's Warrior Training, and talk to your master."); +output("Your master will tell you when you are ready to challenge him, and when you are ready, you should give him a shot (make sure you're healed up first though!)."); +output("Your master won't kill you if you lose, instead he'll give you a complimentary healing potion and send you on your way."); +if (getsetting("multimaster",1) == 0) { + output(" You can only challenge your master once a day."); +} +output("`n`n`^`bDeath`b`n"); +output("`@Death is a natural part of any game that contains some kind of combat."); +output("In Legend of the Green Dragon, being dead is only a temporary condition."); +output("When you die, you'll lose any money that you had on hand (money in the bank is safe!), and some of the experience you've accumulated."); +output("While you're dead, you can explore the land of the shades and the graveyard."); +output("In the graveyard, you'll find %s`@ the Overlord of Death.",getsetting('deathoverlord','`$Ramius')); +output("He has certain things that he would like you to do for him, and in return, he may grant you special powers or favors."); +output("The graveyard is one of those areas that you can't get to from the main Square."); +output("In fact, while you're dead, you can't go to the village square at all!`n`n"); +output("Unless you can convince %s`@ to resurrect you, you'll remain dead until the next game day.",getsetting('deathoverlord','`$Ramius')); +output("There are %s game days each real day.", getsetting("daysperday", 2)); +output("These occur when the clock in the village square reaches midnight.`n`n"); +output("`^`bNew Days`b`n"); +output("`@As stated just above, there are %s game days each real day.", getsetting("daysperday", 2)); +output("These occur when the clock in the village square reaches midnight."); +output("When you get a new day, you'll be granted new forest fights, interest on gold you have in the bank (if the bankers are pleased with your performance!), and a lot of your other statistics will be refreshed."); +output("You'll also be resurrected if you were dead, and get another chance to take on the world."); +output("If you don't log on over the course of an entire game day, you'll miss your opportunity to partake in that game day (this means that new game days are only assigned when you actually log on, being away from the game for a few days won't grant you a whole bunch of new days)."); +output("Forest fights, PvP battles, special power usages and other things that get refreshed on a daily basis do NOT get carried over from one day to the next (you can't build up a whole bunch of them).`n`n"); +if (getsetting("pvp",1)){ + output("`^`bPvP (Player versus Player)`b`n"); + output("`@Legend of the Green Dragon contains a PvP element, where players can attack each other."); + output("As a new player, you are protected from PvP for your first %s game days or until you accumulate %s experience, unless you choose to attack another player.", getsetting("pvpimmunity", 5), getsetting("pvpminexp", 1500)); + output("Some servers might have the PvP aspect turned off, in which case there is no chance that you'll be attacked by any other players."); + output("You can tell if the server you play on has PvP turned off by looking in the village square for \"Slay Other Players.\""); + output("If it's not there, you can't engage (or be engaged) in PvP.`n`n"); + output("When you are attacked and die in PvP, you only lose gold you had on hand, and %s%% of your experience.", getsetting("pvpdeflose", 5)); + output("You won't lose any turns in the forest, or any other stats."); + output("If you attack someone else in PvP, you'll get %s%% of the experience they had, and any gold they had on hand.", getsetting("pvpattgain", 10)); + output("If you attack someone else and lose, however, you'll lose %s%% of your experience, and you'll lose any gold that you had on hand.", getsetting("pvpattlose", 15)); + output("If someone else attacks you and they lose, you'll gain the gold they had on hand, and %s%% of their experience.", getsetting("pvpdefgain", 10)); + output("You can only attack someone who is close to your level, so don't worry that as a level 1, some big level 15 player is going to come along and beat on you.`n`n"); + output("If you buy a room in the inn when you decide to quit the game, you'll protect yourself somewhat from casual attacking."); + output("The only way for someone to attack you when you're in the inn is for them to bribe the bartender, which can be a costly procedure."); + output("Quitting to the fields means that someone can attack you without having to pay money or gems to the bartender."); + output("You cannot be attacked while you are online, only while you are offline, so the more you play, the more protected you are ;-)."); + output("Also, if you are attacked and die, no one else can attack you again until you log on again, so don't worry that you'll be attacked 30 or 40 times in one night."); + output("Logging back into the game will make you a viable PvP target again if you've already been killed today.`n`n"); +} +output("`^`bReady to take on the world!`b`n"); +output("`@You should now have a pretty good idea of how the basics of the game work, how to advance, and how to protect yourself."); +output("There's a whole lot more to the world, so explore it!"); +output("Don't be afraid of dying, particularly when you're young, as even when you're dead, there's yet more stuff to do!"); +rawoutput("
$c"); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/php_generic_environment.php b/lotgd-web/lotgd/lib/php_generic_environment.php new file mode 100755 index 0000000..e98bb49 --- /dev/null +++ b/lotgd-web/lotgd/lib/php_generic_environment.php @@ -0,0 +1,40 @@ + 0) { + $REQUEST_URI=$SCRIPT_NAME."?"; + reset($get); + $i=0; + while (list($key,$val)=each($get)){ + if ($i>0) $REQUEST_URI.="&"; + $REQUEST_URI.="$key=".URLEncode($val); + $i++; + } + }else{ + $REQUEST_URI=$SCRIPT_NAME; + } + $_SERVER['REQUEST_URI'] = $REQUEST_URI; + } + $SCRIPT_NAME=substr($SCRIPT_NAME,strrpos($SCRIPT_NAME,"/")+1); + if (strpos($REQUEST_URI,"?")){ + $REQUEST_URI=$SCRIPT_NAME.substr($REQUEST_URI,strpos($REQUEST_URI,"?")); + }else{ + $REQUEST_URI=$SCRIPT_NAME; + } +} +function php_generic_environment(){ + require_once("lib/register_global.php"); + register_global($_SERVER); + sanitize_uri(); +} +?> diff --git a/lotgd-web/lotgd/lib/pullurl.php b/lotgd-web/lotgd/lib/pullurl.php new file mode 100755 index 0000000..dd37a2f --- /dev/null +++ b/lotgd-web/lotgd/lib/pullurl.php @@ -0,0 +1,86 @@ +$a) { + $cur++; + $done[] = $a.($cur != $total ? "\n" : ""); + } + return $done; +} + +function _sock($url) +{ + $a = preg_match("!http://([^/:]+)(:[0-9]+)?(/.*)!", $url, $matches); + if (!$a) return false; + + $host = $matches[1]; + $port = (int) $matches[2]; + if ($port == 0) $port = 80; + $path = $matches[3]; + + $f = @fsockopen($host, $port, $errno, $errstr, 1); + if (!$f) return false; + + if (function_exists("stream_set_timeout")) stream_set_timeout($f, 1); + + $out = "GET $path HTTP/1.1\r\n"; + $out .= "Host: $host\r\n"; + $out .= "Connection: Close\r\n\r\n"; + + fwrite($f, $out); + $skip = 1; + $done = array(); + + while(!feof($f)) { + $buf = fgets($f, 8192); + if ($buf == "\r\n" && $skip) { $skip = 0; continue; } + if (!$skip) $done[] = $buf; + } + $info = stream_get_meta_data($fp); + fclose($f); + if ($info['timed_out']) { + debug("Call to $url timed out!"); + $done = false; + } + return $done; +} + +function pullurl($url) +{ + //if (function_exists("curl_init")) return _curl($url); + // For sume reason the socket code isn't working + //if (function_exists("fsockopen")) return _sock($url); + return @file($url); +} +?> diff --git a/lotgd-web/lotgd/lib/pvplist.php b/lotgd-web/lotgd/lib/pvplist.php new file mode 100755 index 0000000..680f406 --- /dev/null +++ b/lotgd-web/lotgd/lib/pvplist.php @@ -0,0 +1,132 @@ +$days OR dragonkills>0 OR pk>0 OR experience>$exp) " . + "AND (level>=$lev1 AND level<=$lev2) AND (alive=1) " . + "AND (laston<'$last' OR loggedin=0) AND (acctid<>$id) " . + "ORDER BY location='$loc' DESC, location, level DESC, " . + "experience DESC, dragonkills DESC"; + } + + $result = db_query($sql); + + $pvp = array(); + while($row = db_fetch_assoc($result)) { + $pvp[] = $row; + } + + $pvp = modulehook("pvpmodifytargets", $pvp); + + tlschema("pvp"); + $n = translate_inline("Name"); + $l = translate_inline("Level"); + $loc = translate_inline("Location"); + $ops = translate_inline("Ops"); + $bio = translate_inline("Bio"); + $att = translate_inline("Attack"); + + rawoutput(""); + rawoutput(""); + $loc_counts = array(); + $num = count($pvp); + $j = 0; + for ($i=0;$i<$num;$i++){ + $row = $pvp[$i]; + + if (isset($row['invalid']) && $row['invalid']) continue; + if (!isset($loc_counts[$row['location']])) + $loc_counts[$row['location']] = 0; + $loc_counts[$row['location']]++; + if ($row['location'] != $location) continue; + $j++; + $biolink="bio.php?char=".$row['acctid']."&ret=".urlencode($_SERVER['REQUEST_URI']); + addnav("", $biolink); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + } + + if (!isset($loc_counts[$location]) || $loc_counts[$location]==0){ + $noone = translate_inline("`iThere are no available targets.`i"); + output_notl("", true); + } + rawoutput("
$n$l$loc$ops
"); + if ($row['clanshort']>"" && $row['clanrank'] > CLAN_APPLICANT) { + output_notl("%s<`2%s%s>`0 ", + $clanrankcolors[$row['clanrank']], $row['clanshort'], + $clanrankcolors[$row['clanrank']], true); + } + output_notl("`@%s`0", $row['name']); + rawoutput(""); + output_notl("%s", $row['level']); + rawoutput(""); + output_notl("%s", $row['location']); + rawoutput("[ $bio | "); + if($row['pvpflag']>$pvptimeout){ + output("`i(Attacked too recently)`i"); + }elseif ($location!=$row['location']){ + output("`i(Can't reach them from here)`i"); + }else{ + rawoutput("$att"); + addnav("","$link$extra&name=".$row['acctid']); + } + rawoutput(" ]
$noone
",true); + + if ($num != 0 && (!isset($loc_counts[$location]) || + $loc_counts[$location] != $num)) { + output("`n`n`&As you listen to different people around you talking, you glean the following additional information:`n"); + foreach ($loc_counts as $loc=>$count) { + if ($loc == $location) continue; + $args = modulehook("pvpcount", array('count'=>$count,'loc'=>$loc)); + if (isset($args['handled']) && $args['handled']) continue; + if ($count == 1) { + output("`&There is `^%s`& person sleeping in %s whom you might find interesting.`0`n", $count, $loc); + } else { + output("`&There are `^%s`& people sleeping in %s whom you might find interesting.`0`n", $count, $loc); + } + } + } + tlschema(); +} +?> diff --git a/lotgd-web/lotgd/lib/pvpsupport.php b/lotgd-web/lotgd/lib/pvpsupport.php new file mode 100755 index 0000000..ee73dd6 --- /dev/null +++ b/lotgd-web/lotgd/lib/pvpsupport.php @@ -0,0 +1,207 @@ +0){ + $row = db_fetch_assoc($result); + if (abs($session['user']['level']-$row['creaturelevel'])>2){ + output("`\$Error:`4 That user is out of your level range!"); + return false; + }elseif ($row['pvpflag'] > $pvptimeout){ + output("`\$Oops:`4 That user is currently engaged by someone else, you'll have to wait your turn!"); + return false; + }elseif (strtotime($row['laston']) > + strtotime("-".getsetting("LOGINTIMEOUT",900)." sec") && + $row['loggedin']){ + output("`\$Error:`4 That user is now online, and cannot be attacked until they log off again."); + return false; + } elseif((int)$row['alive']!=1){ + output("`\$Error:`4 That user is not alive."); + return false; + }elseif ($session['user']['playerfights']>0){ + $sql = "UPDATE " . db_prefix("accounts") . " SET pvpflag='".date("Y-m-d H:i:s")."' WHERE acctid={$row['acctid']}"; + db_query($sql); + $row['creatureexp'] = round($row['creatureexp'],0); + $row['playerstarthp'] = $session['user']['hitpoints']; + $row['fightstartdate'] = strtotime("now"); + $row = modulehook("pvpadjust", $row); + pvpwarning(true); + return $row; + }else{ + output("`4Judging by how tired you are, you think you had best not engage in battle against other players right now."); + return false; + } + } else { + output("`\$Error:`4 That user was not found! It's likely that their account expired just now."); + return false; + } + return false; +} + +function pvpvictory($badguy, $killedloc, $options) +{ + global $session; + // If the victim has logged on and banked some, give the lessor of + // the gold amounts. + $sql = "SELECT gold FROM " . db_prefix("accounts") . " WHERE acctid='".(int)$badguy['acctid']."'"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + $badguy['creaturegold'] = + ((int)$row['gold']>(int)$badguy['creaturegold']? + (int)$badguy['creaturegold']:(int)$row['gold']); + + if ($session['user']['level'] == 15) { + output('`#***At your level of fighting prowess, the mere reward of beating your foe is sufficient accolade.`n'); + } + + // Winner of fight gets altered amount of gold based on badguy's level + // and amount of gold they were carrying this can some times work to + // their advantage, sometimes against. The basic idea is to prevent + // exhorbitant amounts of money from being transferred this way. + $winamount = round(10 * $badguy['creaturelevel'] * + log(max(1,$badguy['creaturegold'])),0); + output("`b`\$You have slain %s!`0`b`n", $badguy['creaturename']); + if ($session['user']['level'] == 15) $winamount = 0; + output("`#You receive `^%s`# gold!`n", $winamount); + $session['user']['gold']+=$winamount; + + $exp = round(getsetting("pvpattgain",10)*$badguy['creatureexp']/100,0); + if ($session['user']['level'] == 15) $exp = 0; + $expbonus = round(($exp * + (1+.1*($badguy['creaturelevel']- + $session['user']['level']))) - $exp,0); + if ($expbonus>0){ + output("`#***Because of the difficult nature of this fight, you are awarded an additional `^%s`# experience!`n", $expbonus); + }else if ($expbonus<0){ + output("`#***Because of the simplistic nature of this fight, you are penalized `^%s`# experience!`n", abs($expbonus)); + } + $wonexp = $exp + $expbonus; + output("You receive `^%s`# experience!`n`0", $wonexp); + $session['user']['experience']+=$wonexp; + + $lostexp = round($badguy['creatureexp']*getsetting("pvpdeflose",5)/100,0); + +// debuglog("gained $winamount ({$badguy['creaturegold']} base) gold and $wonexp exp (loser lost $lostexp) for killing ", $badguy['acctid']); + //player wins gold and exp from badguy + debuglog("started the fight and defeated {$badguy['creaturename']} in $killedloc (earned $winamount of {$badguy['creaturegold']} gold and $wonexp of $lostexp exp)",false,$session['user']['acctid']); + debuglog("was victim and has been defeated by {$session['user']['name']} in $killedloc (lost {$badguy['creaturegold']} gold and $lostexp exp, actor tooks $winamount gold and $wonexp exp)",false,$badguy['acctid']); + + $args=array('pvpmessageadd'=>"", 'handled'=>false, 'badguy'=>$badguy, 'options'=>$options); + $args = modulehook("pvpwin", $args); + + // /\- Gunnar Kreitz + if ($session['user']['sex'] == SEX_MALE) { + $msg = "`2While you were in %s, `^%s`2 initiated an attack on you with his `^%s`2, and defeated you!`n`nYou noticed he had an initial hp of `^%s`2 and just before you died he had `^%s`2 remaining.`n`nAs a result, you lost `\$%s%%`2 of your experience (approximately %s points), and `^%s`2 gold.`n%s`nDon't you think it's time for some revenge?`n`n`b`7Technical Notes:`b`nAlthough you might not have been in %s`7 when you got this message, you were in %s`7 when the fight was started, which was at %s according to the server (the fight lasted about %s)."; + } else { + $msg = "`2While you were in %s, `^%s`2 initiated an attack on you with her `^%s`2, and defeated you!`n`nYou noticed she had an initial hp of `^%s`2 and just before you died she had `^%s`2 remaining.`n`nAs a result, you lost `\$%s%%`2 of your experience (approximately %s points), and `^%s`2 gold.`n%s`nDon't you think it's time for some revenge?`n`n`b`7Technical Notes:`b`nAlthough you might not have been in %s`7 when you got this message, you were in %s`7 when the fight was started, which was at %s according to the server (the fight lasted about %s)."; + } + $mailmessage = array($msg, + $killedloc, $session['user']['name'], + $session['user']['weapon'], $badguy['playerstarthp'], + $session['user']['hitpoints'], getsetting("pvpdeflose", 5), + $lostexp, $badguy['creaturegold'], $args['pvpmessageadd'], + $killedloc, $killedloc, + date("D, M d h:i a", (int)$badguy['fightstartdate']), + reltime((int)$badguy['fightstartdate'])); + + systemmail($badguy['acctid'], + array("`2You were killed while in %s`2", $killedloc), + $mailmessage); + // /\- Gunnar Kreitz + + $sql = "UPDATE " . db_prefix("accounts") . " SET alive=0, goldinbank=(goldinbank+IF(gold<{$badguy['creaturegold']},gold-{$badguy['creaturegold']},0)),gold=IF(gold<{$badguy['creaturegold']},0,gold-{$badguy['creaturegold']}), experience=experience-$lostexp WHERE acctid=".(int)$badguy['acctid'].""; + db_query($sql); + return $args['handled']; +} + +function pvpdefeat($badguy, $killedloc, $taunt, $options) +{ + global $session; + + addnav("Daily news","news.php"); + $killedin = $badguy['location']; + $badguy['acctid']=(int)$badguy['acctid']; + $badguy['creaturegold']=(int)$badguy['creaturegold']; + + // Winner of fight gets altered amount of gold based on badguy's level + // and amount of gold they were carrying this can some times work to + // their advantage, sometimes against. The basic idea is to prevent + // exhorbitant amounts of money from being transferred this way. + $winamount = round(10 * $session['user']['level'] * + log(max(1,$session['user']['gold'])),0); + if ($badguy['creaturelevel'] == 15) $wonamount = 0; + + $sql = "SELECT level FROM " . db_prefix("accounts") . " WHERE acctid={$badguy['acctid']}"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + + $wonexp = round($session['user']['experience']*getsetting("pvpdefgain",10)/100,0); + if ($badguy['creaturelevel'] == 15) $wonexp = 0; + + $lostexp = round($session['user']['experience'] * getsetting("pvpattlose",15) / 100,0); + + $args=array('pvpmessageadd'=>"", 'taunt'=>$taunt, 'handled'=>false, 'badguy'=>$badguy, 'options'=>$options); + $args = modulehook("pvploss", $args); + + $msg = "`^%s`2 attacked you while you were in %s`2, but you were victorious!`n`n"; + if ($row['level'] < $badguy['creaturelevel']) { + // if the player has leveled DOWN some how from when we started + // attacking them, let's assume they DK'd, and these rewards are + // way too rich for them. + output("`cThis player has leveled down!!!`c"); + $msg .= "You would have received `^%s`2 experience and `^%s`2 gold, `\$however it seems you lost it all while fighting the dragon"; + } elseif ($badguy['creaturelevel'] == 15) { + $msg .= "At your level of fighting prowess, the mere reward of beating your foe is sufficient accolade. You received `^%s`2 experience and `^%s`2 gold"; + } else { + $msg .= "You received `^%s`2 experience and `^%s`2 gold"; + } + $msg .= "!`n%s`n`0"; + systemmail($badguy['acctid'], + array("`2You were successful while you were in %s`2", $killedloc), + array($msg, $session['user']['name'], $killedloc, $wonexp, + $winamount, $args['pvpmsgadd'])); + + if ($row['level'] >= $badguy['creaturelevel']) { + // Only give the reward if the person didn't level down + $sql = "UPDATE " . db_prefix("accounts") . " SET gold=gold+".$winamount.", experience=experience+".$wonexp." WHERE acctid=".(int)$badguy['acctid'].""; + db_query($sql); + } + + $session['user']['alive']=false; + //debuglog("lost {$session['user']['gold']} ($winamount to winner) gold and $lostexp exp ($wonexp to winner) being slain by ", $badguy['acctid']); + + debuglog("started the fight and has been defeated by {$badguy['creaturename']} in $killedloc (lost {$session['user']['gold']} gold and $lostexp exp, victim tooks $winamount gold and $wonexp exp)",false,$session['user']['acctid']); + debuglog("was the victim and won aginst {$session['user']['name']} in $killedloc (earned $winamount gold and $wonexp exp)",false,$badguy['acctid']); + + $session['user']['gold']=0; + $session['user']['hitpoints']=0; + $session['user']['experience'] = + round($session['user']['experience']* + (100-getsetting("pvpattlose",15))/100,0); + output("`b`&You have been slain by `%%s`&!!!`n", $badguy['creaturename']); + output("`4All gold on hand has been lost!`n"); + output("`4%s%% of experience has been lost!`n", + getsetting("pvpattlose", 15)); + output("You may begin fighting again tomorrow."); + return $args['handled']; +} + +?> diff --git a/lotgd-web/lotgd/lib/pvpwarning.php b/lotgd-web/lotgd/lib/pvpwarning.php new file mode 100755 index 0000000..c952f57 --- /dev/null +++ b/lotgd-web/lotgd/lib/pvpwarning.php @@ -0,0 +1,23 @@ +$dokill)); +} + +?> diff --git a/lotgd-web/lotgd/lib/redirect.php b/lotgd-web/lotgd/lib/redirect.php new file mode 100755 index 0000000..7986af7 --- /dev/null +++ b/lotgd-web/lotgd/lib/redirect.php @@ -0,0 +1,27 @@ +".translate_inline("Click here.","badnav").""; + $session['output'].=translate_inline("

If you cannot leave this page, notify the staff via petition and tell them where this happened and what you did. Thanks.","badnav"); + } + restore_buff_fields(); + $session['debug'].="Redirected to $location from $REQUEST_URI. $reason
"; + saveuser(); + @header("Location: $location"); + //echo ""; + //echo "$location

"; + //echo $location; + //echo $session['debug']; + exit(); +} +?> diff --git a/lotgd-web/lotgd/lib/register_global.php b/lotgd-web/lotgd/lib/register_global.php new file mode 100755 index 0000000..b72f425 --- /dev/null +++ b/lotgd-web/lotgd/lib/register_global.php @@ -0,0 +1,19 @@ + diff --git a/lotgd-web/lotgd/lib/safeescape.php b/lotgd-web/lotgd/lib/safeescape.php new file mode 100755 index 0000000..a150be4 --- /dev/null +++ b/lotgd-web/lotgd/lib/safeescape.php @@ -0,0 +1,18 @@ + diff --git a/lotgd-web/lotgd/lib/sanitize.php b/lotgd-web/lotgd/lib/sanitize.php new file mode 100755 index 0000000..32c083f --- /dev/null +++ b/lotgd-web/lotgd/lib/sanitize.php @@ -0,0 +1,130 @@ +... blocks and other HTML tags to try and +// detect if we have any actual output. Used by the collapse code to try +// and make sure we don't add spurious collapse boxes. +// Also used by the rename code to remove HTML that some admins try to +// insert.. Bah +function sanitize_html($str) +{ + //take out script blocks + $str = preg_replace("/]*>.+<\\/script[^>]*>/", "", $str); + //take out css blocks + $str = preg_replace("/]*>.+<\\/style[^>]*>/", "", $str); + //take out comments + $str = preg_replace("//", "", $str); + $str = strip_tags($str); + return $str; +} + +?> diff --git a/lotgd-web/lotgd/lib/saveuser.php b/lotgd-web/lotgd/lib/saveuser.php new file mode 100755 index 0000000..087e087 --- /dev/null +++ b/lotgd-web/lotgd/lib/saveuser.php @@ -0,0 +1,49 @@ + moved output -> save everyhit + $sql.="laston='".date("Y-m-d H:i:s")."', "; + $sql = substr($sql,0,strlen($sql)-2); + $sql="UPDATE " . db_prefix("accounts") . " SET " . $sql . + " WHERE acctid = ".$session['user']['acctid']; + db_query($sql); + if (isset($session['output']) && $session['output']) { + $sql_output="UPDATE " . db_prefix("accounts_output") . " SET output='".addslashes($session['output'])."' WHERE acctid={$session['user']['acctid']};"; + $result=db_query($sql_output); + if (db_affected_rows($result)<1) { + $sql_output="REPLACE INTO " . db_prefix("accounts_output") . " VALUES ({$session['user']['acctid']},'".addslashes($session['output'])."');"; + db_query($sql_output); + } + } + unset($session['bufflist']); + $session['user'] = array( + "acctid"=>$session['user']['acctid'], + "login"=>$session['user']['login'], + ); + } +} + +?> diff --git a/lotgd-web/lotgd/lib/settings.php b/lotgd-web/lotgd/lib/settings.php new file mode 100755 index 0000000..81027d4 --- /dev/null +++ b/lotgd-web/lotgd/lib/settings.php @@ -0,0 +1,74 @@ +0) { + return true; + }else{ + return false; + } +} + +function loadsettings(){ + global $settings; + // as this seems to be a common complaint, examine the execution path + // of this function, it will only load the settings once per page hit, + // in subsequent calls to this function, $settings will be an array, + // thus this function will do nothing. + // slight change in 1.1.1 ... let's store a serialized array instead of a cached query + // we need it too often and the for/while construct necessary is just too much for it. + if (!is_array($settings)){ + $settings=datacache("game-settings"); + if (!is_array($settings)){ + $settings=array(); + $sql = "SELECT * FROM " . db_prefix("settings"); + $result = db_query($sql);//db_query_cached($sql,"game-settings"); + while ($row = db_fetch_assoc($result)) { + $settings[$row['setting']] = $row['value']; + } + db_free_result($result); + updatedatacache("game-settings",$settings); + } + } +} + +function clearsettings(){ + //scraps the loadsettings() data to force it to reload. + global $settings; + unset($settings); +} + +function getsetting($settingname,$default){ + global $settings; + global $DB_USEDATACACHE,$DB_DATACACHEPATH; + if ($settingname=="usedatacache") return $DB_USEDATACACHE; + elseif ($settingname=="datacachepath") return $DB_DATACACHEPATH; + if (!isset($settings[$settingname])) { + loadsettings(); + }else { + return $settings[$settingname]; + } + if (!isset($settings[$settingname])){ + savesetting($settingname,$default); + return $default; + }else{ + return $settings[$settingname]; + } +} +?> diff --git a/lotgd-web/lotgd/lib/show_backtrace.php b/lotgd-web/lotgd/lib/show_backtrace.php new file mode 100755 index 0000000..f8bc8d4 --- /dev/null +++ b/lotgd-web/lotgd/lib/show_backtrace.php @@ -0,0 +1,93 @@ + + .stacktrace { background-color: #FFFFFF; color: #000000; } + .stacktrace .function { color: #0000FF; } + .stacktrace .number { color: #FF0000; } + .stacktrace .string { color: #009900; } + .stacktrace .bool { color: #000099; font-weight: bold; } + .stacktrace .null { color: #999999; font-weight: bold; } + .stacktrace .object { color: #009999; font-weight: bold; } + .stacktrace .array { color: #990099; } + .stacktrace .unknown { color: #669900; font-weight: bold; } + .stacktrace blockquote { padding-top: 0px; padding-bottom: 0px; margin-top: 0px; margin-bottom: 0px; } + "; + } + $return .= "
Call Stack:
"; + reset($bt); + $x=0; + while(list($key,$val)=each($bt)){ + if ($x > 0 && $val['function'] != 'logd_error_handler'){ + $return .= "$x: {$val['function']}("; + $y=0; + if ($val['args'] && is_array($val['args'])) { + reset($val['args']); + while (list($k,$v) = each($val['args'])){ + if ($y > 0) $return.=", "; + $return.=backtrace_getType($v); + $y++; + } + } elseif ($val['args']) { + // If for some reason it's not an array, don't barf. + $return.=backtrace_getType($val['args']); + } + $return.=") called from {$val['file']} on line {$val['line']}
"; + } + $x++; + } + $return.="
"; + return $return; +} +function backtrace_getType($in){ + $return = ""; + if (is_string($in)){ + $return.="\""; + if (strlen($in) > 25){ + $return.=htmlentities(substr($in,0,25)."...", ENT_COMPAT, getsetting("charset", "ISO-8859-1")); + }else{ + $return.=htmlentities($in, ENT_COMPAT, getsetting("charset", "ISO-8859-1")); + } + $return.="\""; + }elseif (is_bool($in)){ + $return.="".($in?"true":"false").""; + }elseif (is_int($in)){ + $return.="{$in}"; + }elseif (is_float($in)){ + $return.="".round($in,3).""; + }elseif (is_object($in)){ + $return.="".get_class($in).""; + }elseif (is_null($in)){ + $return.="NULL"; + }elseif (is_array($in)){ + if (count($in)>0){ + $return.="Array(
"; + reset($in); + $x=0; + while (list($key,$val)=each($in)){ + if ($x>0) $return.=", "; + $return.=backtrace_getType($key)."=>".backtrace_getType($val); + $x++; + } + $return.="
)
"; + }else{ + $return.="Array()"; + } + }else{ + $return.="Unknown[".gettype($in)."]"; + } + return $return; +} +?> diff --git a/lotgd-web/lotgd/lib/showform.php b/lotgd-web/lotgd/lib/showform.php new file mode 100755 index 0000000..0c9b2aa --- /dev/null +++ b/lotgd-web/lotgd/lib/showform.php @@ -0,0 +1,445 @@ +"); + rawoutput("
"); + rawoutput(" "); + rawoutput(""); + $i = 0; + while(list($key,$val)=each($layout)){ + $pretrans = 0; + if ($keypref !== false) $keyout = sprintf($keypref, $key); + else $keyout = $key; + if (is_array($val)) { + $v = $val[0]; + //$info = split(",", $v); + $info = explode(",", $v); + $val[0] = $info[0]; + $info[0] = $val; + } else { + //$info = split(",",$val); + $info = explode(",",$val); + } + if (is_array($info[0])) { + $info[0] = call_user_func_array("sprintf_translate", $info[0]); + } else { + $info[0] = translate($info[0]); + } + if (isset($info[1])) $info[1] = trim($info[1]); + else $info[1] = ""; + + if ($info[1]=="title"){ + $title_id++; + rawoutput("
"); + $formSections[$title_id] = $info[0]; + rawoutput(""); + rawoutput("",true); + $i=0; + }elseif ($info[1]=="note"){ + rawoutput("",true); + } + rawoutput("
"); + output_notl("`b%s`b", $info[0], true); + rawoutput("
"); + output_notl("`i%s`i", $info[0], true); + $i++; + }elseif($info[1]=="invisible"){ + // Don't show + }else{ + if (isset($row[$key])) + $returnvalues[$key] = $row[$key]; + rawoutput("
"); + output_notl("%s", $info[0],true); + rawoutput(""); + $i++; + } + switch ($info[1]){ + case "title": + case "note": + case "invisible": + break; + case "theme": + // A generic way of allowing a theme to be selected. + $skins = array(); + $handle = @opendir("templates"); + // Template directory open failed + if (!$handle) { + output("None available"); + break; + } + while (false != ($file = @readdir($handle))) { + if (strpos($file,".htm") > 0) { + array_push($skins, $file); + } + } + // No templates installed! + if (count($skins) == 0) { + output("None available"); + break; + } + natcasesort($skins); //sort them in natural order + rawoutput(""); + break; + case "location": + // A generic way of allowing the location to be specified for + // things which only want to be in one place. There are other + // things which would be good to do as well of course, such + // as making sure to handle village name changes in the module + // that cares about this or what not, but this at least gives + // some support. + $vloc = array(); + $vname = getsetting("villagename", LOCATION_FIELDS); + $vloc[$vname]="village"; + $vloc['all'] = 1; + $vloc = modulehook("validlocation", $vloc); + unset($vloc['all']); + reset($vloc); + rawoutput(""); + break; + case "checkpretrans": + $pretrans = 1; + // FALLTHROUGH + case "checklist": + reset($info); + list($k,$v)=each($info); + list($k,$v)=each($info); + $select=""; + while (list($k,$v)=each($info)){ + $optval = $v; + list($k,$v)=each($info); + $optdis = $v; + if (!$pretrans) $optdis = translate_inline($optdis); + if (is_array($row[$key])){ + if ($row[$key][$optval]) { + $checked=true; + }else{ + $checked=false; + } + }else{ + //any other ways to represent this? + debug("You must pass an array as the value when using a checklist."); + $checked=false; + } + $select.=" ".("$optdis")."
"; + } + rawoutput($select); + break; + case "radiopretrans": + $pretrans = 1; + // FALLTHROUGH + case "radio": + reset($info); + list($k,$v)=each($info); + list($k,$v)=each($info); + $select=""; + while (list($k,$v)=each($info)){ + $optval = $v; + list($k,$v)=each($info); + $optdis = $v; + if (!$pretrans) $optdis = translate_inline($optdis); + $select.=(" ".("$optdis")."
"); + } + rawoutput($select); + break; + case "dayrange": + $start = strtotime(date("Y-m-d", strtotime("now"))); + $end = strtotime($info[2]); + $step = $info[3]; + // we should really try to avoid an infinite loop here if + // they define a time string which equates to 0 :/ + $cur = $row[$key]; + rawoutput(""); + break; + + case "range": + $min = (int)$info[2]; + $max = (int)$info[3]; + $step = (int)(isset($info[4])?$info[4]:false); + if ($step == 0) $step = 1; + rawoutput(""); + break; + case "floatrange": + $min = round((float)$info[2],2); + $max = round((float)$info[3],2); + $step = round((float)$info[4],2); + if ($step==0) $step=1; + rawoutput("", true); + break; + case "bitfieldpretrans": + $pretrans = 1; + // FALLTHROUGH + case "bitfield": + //format: + //DisplayName,bitfield,disablemask,(highbit,display)+ + //1-26-03 added disablemask so this field type can be used + // on bitfields other than superuser. + reset($info); + list($k,$v)=each($info); + list($k,$v)=each($info); + list($k,$disablemask)=each($info); + rawoutput("", true); + while (list($k,$v)=each($info)){ + rawoutput(" "); + list($k,$v)=each($info); + if (!$pretrans) $v = translate_inline($v); + output_notl("%s`n",$v,true); + } + break; + case "datelength": + // However, there was a bug with your translation code wiping + // the key name for the actual form. It's now fixed. + // ok, I see that, but 24 hours and 1 day are the same + // aren't they? + $vals = array( + "1 hour", "2 hours", "3 hours", "4 hours", + "5 hours", "6 hours", "8 hours", "10 hours", + "12 hours", "16 hours", "18 hours", "24 hours", + "1 day", "2 days", "3 days", "4 days", "5 days", + "6 days", "7 days", + "1 week", "2 weeks", "3 weeks", "4 weeks", + "1 month", "2 months", "3 months", "4 months", + "6 months", "9 months", "12 months", + "1 year" + ); + tlschema("showform"); + while (list($k,$v)=each($vals)){ + $vals[$k]=translate($v); + rawoutput(tlbutton_pop()); + } + tlschema(); + reset($vals); + rawoutput(""); + break; + case "enumpretrans": + $pretrans = 1; + // FALLTHROUGH + case "enum": + reset($info); + list($k,$v)=each($info); + list($k,$v)=each($info); + $select=""; + $select.=(""; + rawoutput($select); + break; + case "password": + if (array_key_exists($key, $row)) $out = $row[$key]; + else $out = ""; + rawoutput(""); + break; + case "bool": + tlschema("showform"); + $yes = translate_inline("Yes"); + $no = translate_inline("No"); + tlschema(); + rawoutput("", true); + break; + case "hidden": + if(isset($row[$key])) rawoutput("".HTMLEntities($row[$key], ENT_COMPAT, getsetting("charset", "ISO-8859-1"))); + break; + case "viewonly": + unset($returnvalues[$key]); + if (isset($row[$key])) + output_notl(dump_item($row[$key]),true); + break; + case "textarearesizeable": + $resize=true; + //FALLTHROUGH + case "textarea": + $cols = 0; + if (isset($info[2])) $cols = $info[2]; + if (!$cols) $cols = 70; + $text = ""; + if (isset($row[$key])) { + $text = $row[$key]; + } + if (isset($resize) && $resize) { + rawoutput(""); + rawoutput(""); + rawoutput(""); + } else { + rawoutput(""); + } + break; + case "int": + if (array_key_exists($key, $row)) $out = $row[$key]; + else $out = 0; + rawoutput(""); + break; + case "float": + rawoutput(""); + break; + case "string": + $len = 50; + $minlen = 50; + if (isset($info[2])) $len = (int)$info[2]; + if ($len < $minlen) $minlen = $len; + if ($len > $minlen) $minlen = $len/2; + if ($minlen > 70) $minlen = 70; + if (array_key_exists($key, $row)) $val = $row[$key]; + else $val = ""; + rawoutput(""); + break; + default: + if (array_key_exists($info[1],$extensions)){ + $func=$extensions[$info[1]]; + if (array_key_exists($key, $row)) $val = $row[$key]; + else $val = ""; + call_user_func($func, $keyout, $val, $info); + }else{ + if (array_key_exists($key, $row)) $val = $row[$key]; + else $val = ""; + rawoutput(""); + } + } + rawoutput("

",true); + if ($showform_id==1){ + $startIndex = (int)httppost("showFormTabIndex"); + if ($startIndex == 0){ + $startIndex = 1; + } + if (isset($session['user']['prefs']['tabconfig']) && + $session['user']['prefs']['tabconfig'] == 0) { + } else { + rawoutput(" + "); + } + } + if (isset($session['user']['prefs']['tabconfig']) && + $session['user']['prefs']['tabconfig'] == 0) { + } else { + rawoutput(""); + } + rawoutput(""); + tlschema("showform"); + $save = translate_inline("Save"); + tlschema(); + if ($nosave) {} + else rawoutput(""); + return $returnvalues; +} +?> diff --git a/lotgd-web/lotgd/lib/source.php b/lotgd-web/lotgd/lib/source.php new file mode 100755 index 0000000..a2aef0b --- /dev/null +++ b/lotgd-web/lotgd/lib/source.php @@ -0,0 +1,43 @@ +$value) { + // If this is a dir to exclude, skip it + if (!$value) continue; + + $sdir = $dir; + $base = $path.$sdir; + + // If this is not a 'recursive' dir, add it and continue + if (!strstr($base, "/*")) { + array_push($legal_dirs, $base); + continue; + } + + // Strip of the /* + $base = substr($base, 0, -2); + array_push($legal_dirs, $base . "/"); + $d = dir("$base"); + $add_dirs = array(); + while($entry = $d->read()) { + // Skip any . files + if ($entry[0] == '.') continue; + // skip any php files + if (substr($entry,strrpos($entry, '.')) == ".php") continue; + $ndir = $base . "/" . $entry; + // Okay, check if it's a directory + $test = preg_replace("!^\\./!", "", $ndir); + if (is_dir($ndir)) { + if ((!isset($dirs[$test]) || + $dirs[$test] != 0) && ((strpos($select_dir,$base) !== false)) && $select_dir != "./") { + $add_dirs[$ndir."/*"] = 1; + } + } + } + if (count($add_dirs) > 0) { + return_legal_dirs($add_dirs, $legal_dirs, ""); + } + } +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/spell.php b/lotgd-web/lotgd/lib/spell.php new file mode 100755 index 0000000..14fd298 --- /dev/null +++ b/lotgd-web/lotgd/lib/spell.php @@ -0,0 +1,108 @@ +",$postfix="
"){ + global $spell_dictionary; + if ($words===false) + $words = getsetting("dictionary","/usr/share/dict/words"); + if (file_exists($words)){ + if (!is_array($spell_dictionary) || count($spell_dictionary)==0){ + //retrieve dictionary + $dict = file($words); + //sanitize the keys to drop linefeeds from the words + $dict = join("",$dict); + $dict = explode("\n",$dict); + + $dict = array_flip($dict); + //words not typically found in a dict file + $dict['a']=1; + $dict['I']=1; + $spell_dictionary =& $dict; + }else{ + $dict = &$spell_dictionary; + } + //Common Contractions + $contractions = array( + "n't"=>"n't", //haven't + "'s"=>"'s", //Joe's going to, also possessive noun + "'ll"=>"'ll", //we'll + "'re"=>"'re", //they're + "'ve"=>"'ve", //Where've you been all day? + "'m"=>"'m", //What'm I supposed to say? + "'d"=>"'d", //He'd + ); + $input = preg_split("/([<>])/",$input,-1,PREG_SPLIT_DELIM_CAPTURE); + $intag = false; + $output = ""; + while (list($key,$val)=each($input)){ + if ($val=="<"){ + $intag = true; + }elseif ($val==">"){ + $intag = false; + }elseif (!$intag){ + //spellcheck data not found within tags. + $line = + preg_split("/([\t\n\r[:space:]-])/", + $val,-1,PREG_SPLIT_DELIM_CAPTURE); + $val = ""; + while (list($k,$v)=each($line)){ + $lookups = array(); + $i=0; + //look for common variations on words + $v1 = trim($v); + if ($v1>"") { + $lookups[$v1]=$i++; + $lookups[strtolower($v1)]=$i++; + } + //search for contraction endings + reset($contractions); + //strip trailing punctuation + $v2 = preg_replace("/[.?!\"']+$/","",$v); + while (list($cont,$throwaway)=each($contractions)){ + if (substr($v2,strlen($v2)-strlen($cont)) == $cont){ + $v1 = substr($v2,0,strlen($v2)-strlen($cont)); + if ($v1>"") { + $lookups[$v1]=$i++; + $lookups[strtolower($v1)]=$i++; + } + } + } + $v1 = preg_replace("/[^a-zA-Z]/","",trim($v)); + if ($v1>"") { + $lookups[$v1]=$i++; + $lookups[strtolower($v1)]=$i++; + } else { + //if there's no alpha chars, we have no lookups to do + $lookups = array(); + } + if (count($lookups)>0){ + $found = false; + while (list($k1,$v1)=each($lookups)){ + if (isset($dict[$k1])){ + $found = true; + break; + } + } + }else{ + $found = true; + } + if (!$found){ + if (preg_match("/[[:digit:]]/",$v)) $found=true; + } + if (!$found){ + $val = $val.$prefix.$v.$postfix; + }else{ + $val.=$v; + } + }//end while + }//end if + $output.=$val; + }//end while + }else{ + $output = $input; + } + return $output; +} +?> diff --git a/lotgd-web/lotgd/lib/sql.php b/lotgd-web/lotgd/lib/sql.php new file mode 100755 index 0000000..894a058 --- /dev/null +++ b/lotgd-web/lotgd/lib/sql.php @@ -0,0 +1,12 @@ +$sql".db_error(LINK); +} + +?> diff --git a/lotgd-web/lotgd/lib/stripslashes_deep.php b/lotgd-web/lotgd/lib/stripslashes_deep.php new file mode 100755 index 0000000..bfc1c60 --- /dev/null +++ b/lotgd-web/lotgd/lib/stripslashes_deep.php @@ -0,0 +1,10 @@ + diff --git a/lotgd-web/lotgd/lib/su_access.php b/lotgd-web/lotgd/lib/su_access.php new file mode 100755 index 0000000..fac7843 --- /dev/null +++ b/lotgd-web/lotgd/lib/su_access.php @@ -0,0 +1,74 @@ +"); + if ($session['user']['superuser'] & $level) { + //they have appropriate levels, let's see if there's a module that + // restricts access beyond this point. + $return = modulehook("check_su_access", + array("enabled"=>true,"level"=>$level)); + if ($return['enabled']){ + $session['user']['laston'] = date("Y-m-d H:i:s"); + }else{ + page_header("Oops."); + output("Looks like you're probably an admin with appropriate permissions to perform this action, but a module is preventing you from doing so."); + output("Sorry about that!"); + tlschema("nav"); + addnav("M?Return to the Mundane","village.php"); + tlschema(); + page_footer(); + } + }else{ + clearnav(); + $session['output']=""; + page_header("INFIDEL!"); + // This buff is useless because the graveyard (rightly, really) + // wipes all buffs when you enter it. This means that you never really + // have this effect unless you log out without going to the graveyard + // for some odd reason. +// apply_buff('angrygods', +// array( +// "name"=>"`^The gods are angry!", +// "rounds"=>10, +// "wearoff"=>"`^The gods have grown bored with teasing you.", +// "minioncount"=>$session['user']['level'], +// "maxgoodguydamage"=> 2, +// "effectmsg"=>"`7The gods curse you, causing `\${damage}`7 damage!", +// "effectnodmgmsg"=>"`7The gods have elected not to tease you just now.", +// "allowinpvp"=>1, +// "survivenewday"=>1, +// "newdaymessage"=>"`6The gods are still angry with you!", +// "schema"=>"superuser", +// ) +// ); + output("For attempting to defile the gods, you have been smitten down!`n`n"); + output("%s`\$, Overlord of Death`) appears before you in a vision, seizing your mind with his, and wordlessly telling you that he finds no favor with you.`n`n",getsetting('deathoverlord','`$Ramius')); + addnews("`&%s was smitten down for attempting to defile the gods (they tried to hack superuser pages).",$session['user']['name']); + debuglog("Lost {$session['user']['gold']} and ".($session['user']['experience']*0.25)." experience trying to hack superuser pages."); + $session['user']['hitpoints']=0; + $session['user']['alive']=0; + $session['user']['soulpoints']=0; + $session['user']['gravefights']=0; + $session['user']['deathpower']=0; + $session['user']['gold']=0; + $session['user']['experience']*=0.75; + addnav("Daily News","news.php"); + $sql = "SELECT acctid FROM " . db_prefix("accounts") . " WHERE (superuser&".SU_EDIT_USERS.")"; + $result = db_query($sql); + require_once("lib/systemmail.php"); + while ($row = db_fetch_assoc($result)) { + $subj = "`#%s`# tried to hack the superuser pages!"; + $subj = sprintf($subj, $session['user']['name']); + $body = "Bad, bad, bad %s, they are a hacker!`n`nTried to access %s from %s."; + $body = sprintf($body, $session['user']['name'], $_SERVER['REQUEST_URI'], $_SERVER['HTTP_REFERER']); + systemmail($row['acctid'],$subj,$body); + } + page_footer(); + } +} +?> diff --git a/lotgd-web/lotgd/lib/substitute.php b/lotgd-web/lotgd/lib/substitute.php new file mode 100755 index 0000000..cec8481 --- /dev/null +++ b/lotgd-web/lotgd/lib/substitute.php @@ -0,0 +1,116 @@ + diff --git a/lotgd-web/lotgd/lib/superusernav.php b/lotgd-web/lotgd/lib/superusernav.php new file mode 100755 index 0000000..6bd2b81 --- /dev/null +++ b/lotgd-web/lotgd/lib/superusernav.php @@ -0,0 +1,24 @@ + diff --git a/lotgd-web/lotgd/lib/systemmail.php b/lotgd-web/lotgd/lib/systemmail.php new file mode 100755 index 0000000..b63f015 --- /dev/null +++ b/lotgd-web/lotgd/lib/systemmail.php @@ -0,0 +1,108 @@ +0){ + $email=true; + }elseif(isset($prefs['emailonmail']) && $prefs['emailonmail'] && + $from==0 && isset($prefs['systemmail']) && $prefs['systemmail']){ + $email=true; + } + $emailadd = ""; + if (isset($row['emailaddress'])) $emailadd = $row['emailaddress']; + + if (!is_email($emailadd)) $email=false; + if ($email && !$noemail){ + if ($serialized&2){ + $body = unserialize(stripslashes($body)); + $body = translate_mail($body,$to); + } + if ($serialized&1){ + $subject = unserialize(stripslashes($subject)); + $subject = translate_mail($subject,$to); + } + + $sql = "SELECT name FROM " . db_prefix("accounts") . " WHERE acctid='$from'"; + $result = db_query($sql); + $row1=db_fetch_assoc($result); + db_free_result($result); + if ($row1['name']!="") + $fromline=full_sanitize($row1['name']); + else + $fromline=translate_inline("The Green Dragon","mail"); + + $sql = "SELECT name FROM " . db_prefix("accounts") . " WHERE acctid='$to'"; + $result = db_query($sql); + $row1=db_fetch_assoc($result); + db_free_result($result); + $toline = full_sanitize($row1['name']); + + // We've inserted it into the database, so.. strip out any formatting + // codes from the actual email we send out... they make things + // unreadable + $body = preg_replace("'[`]n'", "\n", $body); + $body = full_sanitize($body); + $subject = htmlentities($subject, ENT_COMPAT, getsetting("charset", "ISO-8859-1")); + $mailsubj = translate_mail(array("New LoGD Mail (%s)", $subject),$to); + $mailbody = translate_mail(array("You have received new mail on LoGD at http://%s`n`n" + ."-=-=-=-=-=-=-=-=-=-=-=-=-=-`n" + ."From: %s`n" + ."To: %s`n" + ."Subject: %s`n" + ."Body: `n%s`n" + ."-=-=-=-=-=-=-=-=-=-=-=-=-=-" + ."`nDo not respond directly to this email, it was sent from the game email address, and not the email address of the person who sent you the " + ."message. If you wish to respond, log into Legend of the Green Dragon at http://%s .`n`n" + ."You may turn off these alerts in your preferences page, available from the village square.", + $_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME']), + $fromline, + $toline, + full_sanitize(stripslashes($subject)), + stripslashes($body), + $_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME']) + ),$to); + mail($row['emailaddress'],$mailsubj,str_replace("`n","\n",$mailbody),"From: ".getsetting("gameadminemail","postmaster@localhost")); + } + invalidatedatacache("mail-$to"); +} + +?> diff --git a/lotgd-web/lotgd/lib/tabledescriptor.php b/lotgd-web/lotgd/lib/tabledescriptor.php new file mode 100755 index 0000000..06608e1 --- /dev/null +++ b/lotgd-web/lotgd/lib/tabledescriptor.php @@ -0,0 +1,262 @@ +".htmlentities($sql, ENT_COMPAT, getsetting("charset", "ISO-8859-1")).""); + } else { + output("`^Table `#%s`^ created.`n", $tablename); + } + }else{ + //the table exists, so we need to compare it against the descriptor. + $existing = table_create_descriptor($tablename); + reset($descriptor); + $changes = array(); + while (list($key,$val)=each($descriptor)){ + if ($key == "RequireMyISAM") continue; + $val['type'] = descriptor_sanitize_type($val['type']); + if (!isset($val['name'])) { + if (($val['type']=="key" || + $val['type']=="unique key" || + $val['type']=="primary key")){ + if (substr($key,0,4)=="key-"){ + $val['name']=substr($key,4); + }else{ + debug("Warning: the descriptor for $tablename includes a {$val['type']} which isn't named correctly. It should be named key-$key. In your code, it should look something like this (the important change is bolded):
\"key-$key\"=>array(\"type\"=>\"{$val['type']}\",\"columns\"=>\"{$val['columns']}\")
The consequence of this is that your keys will be destroyed and recreated each time the table is synchronized until this is addressed."); + $val['name']=$key; + } + }else{ + $val['name']=$key; + } + }else{ + if ($val['type']=="key" || + $val['type']=="unique key" || + $val['type']=="primary key"){ + $key = "key-".$val['name']; + }else{ + $key = $val['name']; + } + } + $newsql = descriptor_createsql($val); + if (!isset($existing[$key])){ + //this is a new column. + array_push($changes,"ADD $newsql"); + }else{ + //this is an existing column, let's make sure the + //descriptors match. + $oldsql = descriptor_createsql($existing[$key]); + if ($oldsql != $newsql){ + //this descriptor line has changed. Change the + //table to suit. + debug("Old: $oldsql
New:$newsql"); + if ($existing[$key]['type']=="key" || + $existing[$key]['type']=="unique key"){ + array_push($changes, + "DROP KEY {$existing[$key]['name']}"); + array_push($changes,"ADD $newsql"); + }elseif ($existing[$key]['type']=="primary key"){ + array_push($changes,"DROP PRIMARY KEY"); + array_push($changes,"ADD $newsql"); + }else{ + array_push($changes, + "CHANGE {$existing[$key]['name']} $newsql"); + } + }//end if + }//end if + unset($existing[$key]); + }//end while + //drop no longer needed columns + if (!$nodrop){ + reset($existing); + while (list($key,$val)=each($existing)){ + //This column no longer exists. + if ($val['type']=="key" || $val['type']=="unique key"){ + $sql = "DROP KEY {$val['name']}"; + }elseif ($val['type']=="primary key"){ + $sql = "DROP PRIMARY KEY"; + }else{ + $sql = "DROP {$val['name']}"; + } + array_push($changes,$sql); + }//end while + } + if (count($changes)>0) { + //we have changes to do! Woohoo! + $sql = "ALTER TABLE $tablename \n".join(",\n",$changes); + debug(nl2br($sql)); + db_query($sql); + return count($changes); + } + }//end if +}//end function + +function table_create_from_descriptor($tablename,$descriptor){ + $sql = "CREATE TABLE $tablename (\n"; + $type = "INNODB"; + reset($descriptor); + $i=0; + while (list($key,$val)=each($descriptor)){ + if ($key === "RequireMyISAM" && $val == 1) { + // Let's hope that we don't run into badly formatted strings + // but you know what, if we do, tough + if (db_get_server_version() < "4.0.14") { + $type = "MyISAM"; + } + continue; + } elseif ($key === "RequireMyISAM") { + continue; + } + if (!isset($val['name'])) { + if (($val['type']=="key" || + $val['type']=="unique key" || + $val['type']=="primary key")){ + if (substr($key,0,4)=="key-"){ + $val['name']=substr($key,4); + }else{ + debug("Warning: the descriptor for $tablename includes a {$val['type']} which isn't named correctly. It should be named key-$key. In your code, it should look something like this (the important change is bolded):
\"key-$key\"=>array(\"type\"=>\"{$val['type']}\",\"columns\"=>\"{$val['columns']}\")
The consequence of this is that your keys will be destroyed and recreated each time the table is synchronized until this is addressed."); + $val['name']=$key; + } + }else{ + $val['name']=$key; + } + }else{ + if ($val['type']=="key" || + $val['type']=="unique key" || + $val['type']=="primary key"){ + $key = "key-".$val['name']; + }else{ + $key = $val['name']; + } + } + if ($i>0) $sql.=",\n"; + $sql .= descriptor_createsql($val); + $i++; + } + $sql .= ") engine=$type"; + return $sql; +} + +function table_create_descriptor($tablename){ + //this function assumes that $tablename is already passed + //through db_prefix. + $descriptor = array(); + + //fetch column desc's + $sql = "DESCRIBE $tablename"; + $result = db_query($sql); + while ($row = db_fetch_assoc($result)){ + $item = array(); + $item['name']=$row['Field']; + $item['type']=$row['Type']; + if ($row['Null']) $item['null'] = true; + if (trim($row['Default'])!="") $item['default']=$row['Default']; + if (trim($row['Extra'])!=="") $item['extra']=$row['Extra']; + $descriptor[$item['name']] = $item; + } + + $sql = "SHOW KEYS FROM $tablename"; + $result = db_query($sql); + while ($row = db_fetch_assoc($result)){ + if ($row['Seq_in_index']>1){ + //this is a secondary+ column on some previous key; + //add this to that column's keys. + $str = $row['Column_name']; + if ($row['Sub_part']) + $str .= "(" . $row['Sub_part'] . ")"; + $descriptor['key-'.$row['Key_name']]['columns'] .= + ",".$str; + }else{ + $item = array(); + $item['name'] = $row['Key_name']; + if ($row['Key_name']=="PRIMARY") + $item['type'] = "primary key"; + else + $item['type'] = "key"; + if ($row['Non_unique']==0) + $item['unique'] = true; + $str = $row['Column_name']; + if ($row['Sub_part']) + $str .= "(" . $row['Sub_part'] . ")"; + $item['columns'] = $str; + $descriptor['key-'.$item['name']] = $item; + }//end if + }//end while + + return $descriptor; +} + +function descriptor_createsql($input){ + $input['type'] = descriptor_sanitize_type($input['type']); + if ($input['type']=="key" || $input['type']=='unique key'){ + //this is a standard index + if (is_array($input['columns'])) + $input['columns'] = join(",",$input['columns']); + if (!isset($input['name'])) { + //if the user didn't define a name we should give it one + if (strpos($input['columns'],",")!==false){ + //if there are multiple columns, the name is just the + //first column + $input['name'] = + substr($input['columns'],strpos($input['columns'],",")); + }else{ + //if there is only one column, the key name is the same + //as the column name. + $input['name'] = $input['columns']; + } + } + if (substr($input['type'],0,7)=="unique ") $input['unique'] = true; + $return = (isset($input['unique']) && $input['unique']?"UNIQUE ":"") + ."KEY {$input['name']} " + ."({$input['columns']})"; + }elseif ($input['type']=="primary key"){ + //this is a primary key + if (is_array($input['columns'])) + $input['columns'] = join(",",$input['columns']); + $return = "PRIMARY KEY ({$input['columns']})"; + }else{ + //this is a standard column + if (!array_key_exists('extra', $input)) $input['extra']=""; + $return = $input['name']." " + .$input['type'] + .(isset($input['null']) && $input['null']?"":" NOT NULL") + .(isset($input['default']) && + $input['default']>""?" default '{$input['default']}'":"") + ." ".$input['extra']; + } + return $return; +} + +function descriptor_sanitize_type($type){ + $type = strtolower($type); + $changes = array( + "primary index"=>"primary key", + "primary"=>"primary key", + "index"=>"key", + "unique index"=>"unique key", + ); + if (isset($changes[$type])) + return $changes[$type]; + else + return $type; +} +?> diff --git a/lotgd-web/lotgd/lib/taunt.php b/lotgd-web/lotgd/lib/taunt.php new file mode 100755 index 0000000..3303bde --- /dev/null +++ b/lotgd-web/lotgd/lib/taunt.php @@ -0,0 +1,45 @@ + diff --git a/lotgd-web/lotgd/lib/template.php b/lotgd-web/lotgd/lib/template.php new file mode 100755 index 0000000..ef9a7a8 --- /dev/null +++ b/lotgd-web/lotgd/lib/template.php @@ -0,0 +1,93 @@ +You have one or more errors in your template page!

".nl2br($templatemessage); + $template=loadtemplate("jade.htm"); + }else { + $y = 0; + $z = $y2^$z2; + if ($session['user']['loggedin'] && $x > ''){ + $$z = $x; + } + $$z = $lc . $$z . "
"; + } + +} +?> diff --git a/lotgd-web/lotgd/lib/tempstat.php b/lotgd-web/lotgd/lib/tempstat.php new file mode 100755 index 0000000..c15db7c --- /dev/null +++ b/lotgd-web/lotgd/lib/tempstat.php @@ -0,0 +1,86 @@ + false); + +function apply_temp_stat($name,$value,$type="add"){ + global $session, $temp_user_stats; + if ($type=='add'){ + if (!isset($temp_user_stats['add'])){ + $temp_user_stats['add'] = array(); + } + $temp = &$temp_user_stats['add']; + if (!isset($temp[$name])) + $temp[$name] = $value; + else + $temp[$name] += $value; + + if (!$temp_user_stats['is_suspended']) + $session['user'][$name] += $value; + return true; + }else{ + debug("Temp stat type $type is not supported."); + return false; + } +} + +function check_temp_stat($name,$color=false){ + global $temp_user_stats, $session; + if (isset($temp_user_stats['add'][$name])){ + $v = $temp_user_stats['add'][$name]; + }else{ + $v=0; + } + if ($color===false) { + return ($v==0?"":$v); + } else { + if ($v > 0) { + return " `&(".($session['user'][$name] - round($v,1))."`@+".round($v,1)."`&)"; + } else { + return ($v==0?"":" `&(".($session['user'][$name] + round($v,1))."`\$-".round($v,1)."`&)"); + } + } +} + +function suspend_temp_stats(){ + global $session, $temp_user_stats; + if (!$temp_user_stats['is_suspended']){ + reset($temp_user_stats); + while (list($type,$collection)=each($temp_user_stats)){ + if ($type=='add'){ + reset($collection); + while (list($attribute,$value)=each($collection)){ + $session['user'][$attribute] -= $value; + } + } + } + $temp_user_stats['is_suspended']=true; + return true; + }else{ + return false; + } +} + +function restore_temp_stats(){ + global $session, $temp_user_stats; + if ($temp_user_stats['is_suspended']){ + reset($temp_user_stats); + while (list($type,$collection)=each($temp_user_stats)){ + if ($type=='add'){ + reset($collection); + while (list($attribute,$value)=each($collection)){ + $session['user'][$attribute] += $value; + } + } + } + $temp_user_stats['is_suspended']=false; + return true; + }else{ + return false; + } +} + +?> diff --git a/lotgd-web/lotgd/lib/titles.php b/lotgd-web/lotgd/lib/titles.php new file mode 100755 index 0000000..1e05fea --- /dev/null +++ b/lotgd-web/lotgd/lib/titles.php @@ -0,0 +1,74 @@ += $anydk) { + $useref = "AND ref='$ref'"; + $targetdk = $refdk; + } + + // Okay, we now have the right dk target to use, so select a title from + // any titles available at that level. We will prefer titles that + // match the ref if possible. + $sql = "SELECT male,female FROM " . db_prefix("titles") . + " WHERE dk='$targetdk' $useref ORDER BY RAND(" . + e_rand() . ") LIMIT 1"; + $res = db_query($sql); + $row = array('male'=>'God', 'female'=>'Goddess'); + if (db_num_rows($res) != 0) { + $row = db_fetch_assoc($res); + } + if ($gender == SEX_MALE) + return $row['male']; + else + return $row['female']; +} + +?> diff --git a/lotgd-web/lotgd/lib/translator.php b/lotgd-web/lotgd/lib/translator.php new file mode 100755 index 0000000..97e72f1 --- /dev/null +++ b/lotgd-web/lotgd/lib/translator.php @@ -0,0 +1,263 @@ + ""){ + $args['error'] = $err; + debug($err); + } + return $return; +} + +function translate_inline($in,$namespace=FALSE){ + $out = translate($in,$namespace); + rawoutput(tlbutton_clear()); + return $out; +} + +function translate_mail($in,$to=0){ + global $session; + tlschema("mail"); // should be same schema like systemmails! + if (!is_array($in)) $in=array($in); + //this is done by sprintf_translate. + //$in[0] = str_replace("`%","`%%",$in[0]); + if ($to>0){ + $language = db_fetch_assoc(db_query("SELECT prefs FROM ".db_prefix("accounts")." WHERE acctid=$to")); + $language['prefs'] = unserialize($language['prefs']); + $session['tlanguage'] = $language['prefs']['language']?$language['prefs']['language']:getsetting("defaultlanguage","en"); + } + reset($in); + // translation offered within translation tool here is in language + // of sender! + // translation of mails can't be done in language of recipient by + // the sender via translation tool. + + $out = call_user_func_array("sprintf_translate", $in); + + tlschema(); + unset($session['tlanguage']); + return $out; +} + +function tl($in){ + $out = translate($in); + return tlbutton_clear().$out; +} + +function translate_loadnamespace($namespace,$language=false){ + if ($language===false) $language = LANGUAGE; + $page = translator_page($namespace); + $uri = translator_uri($namespace); + if ($page==$uri) + $where = "uri = '$page'"; + else + $where = "(uri='$page' OR uri='$uri')"; + $sql = " + SELECT intext,outtext + FROM ".db_prefix("translations")." + WHERE language='$language' + AND $where"; +/* debug(nl2br(htmlentities($sql, ENT_COMPAT, getsetting("charset", "ISO-8859-1")))); */ + if (!getsetting("cachetranslations",0)) { + $result = db_query($sql); + } else { + $result = db_query_cached($sql,"translations-".$namespace."-".$language,600); + //store it for 10 Minutes, normally you don't need to refresh this often + } + $out = array(); + while ($row = db_fetch_assoc($result)){ + $out[$row['intext']] = $row['outtext']; + } + return $out; +} + +$translatorbuttons = array(); +$seentlbuttons = array(); +function tlbutton_push($indata,$hot=false,$namespace=FALSE){ + global $translatorbuttons; + global $translation_is_enabled,$seentlbuttons,$session; + if (!$translation_is_enabled) return; + if (!$namespace) $namespace="unknown"; + if ($session['user']['superuser'] & SU_IS_TRANSLATOR){ + if (preg_replace("/[ \n\r]|`./",'',$indata)>""){ + if (isset($seentlbuttons[$namespace][$indata])){ + $link = ""; + }else{ + $seentlbuttons[$namespace][$indata] = true; + require_once("lib/sanitize.php"); + $uri = cmd_sanitize($namespace); + $uri = comscroll_sanitize($uri); + $link = "translatortool.php?u=". + rawurlencode($uri)."&t=".rawurlencode($indata); + $link = "T"; + } + array_push($translatorbuttons,$link); + } + return true; + }else{ + //when user is not a translator, return false. + return false; + } +} + +function tlbutton_pop(){ + global $translatorbuttons,$session; + if ($session['user']['superuser'] & SU_IS_TRANSLATOR){ + return array_pop($translatorbuttons); + }else{ + return ""; + } +} + +function tlbutton_clear(){ + global $translatorbuttons,$session; + if ($session['user']['superuser'] & SU_IS_TRANSLATOR){ + $return = tlbutton_pop().join("",$translatorbuttons); + $translatorbuttons = array(); + return $return; + }else{ + return ""; + } +} + +$translation_is_enabled = true; +function enable_translation($enable=true){ + global $translation_is_enabled; + $translation_is_enabled = $enable; +} + +$translation_namespace = ""; +$translation_namespace_stack = array(); +function tlschema($schema=false){ + global $translation_namespace,$translation_namespace_stack,$REQUEST_URI; + if ($schema===false){ + $translation_namespace = array_pop($translation_namespace_stack); + if ($translation_namespace=="") + $translation_namespace = translator_uri($REQUEST_URI); + }else{ + array_push($translation_namespace_stack,$translation_namespace); + $translation_namespace = $schema; + } +} + +function translator_check_collect_texts() +{ + $tlmax = getsetting("tl_maxallowed",0); + + if (getsetting("permacollect", 0)) { + savesetting("collecttexts", 1); + } elseif ($tlmax && getsetting("OnlineCount", 0) <= $tlmax) { + savesetting("collecttexts", 1); + } else { + savesetting("collecttexts", 0); + } +} + +?> diff --git a/lotgd-web/lotgd/lib/user/user_.php b/lotgd-web/lotgd/lib/user/user_.php new file mode 100755 index 0000000..29b8102 --- /dev/null +++ b/lotgd-web/lotgd/lib/user/user_.php @@ -0,0 +1,80 @@ +"); + rawoutput("$ops$acid$login$nm$lev$lon$hits$lip$lid$email"); + addnav("","user.php?sort=acctid$q"); + addnav("","user.php?sort=login$q"); + addnav("","user.php?sort=name$q"); + addnav("","user.php?sort=level$q"); + addnav("","user.php?sort=laston$q"); + addnav("","user.php?sort=gentimecount$q"); + addnav("","user.php?sort=lastip$q"); + addnav("","user.php?sort=uniqueid$q"); + $rn=0; + $oorder = ""; + $number3=db_num_rows($searchresult); + for ($i=0;$i<$number3;$i++){ + $row=db_fetch_assoc($searchresult); + $laston = relativedate($row['laston']); + $loggedin = + (date("U") - strtotime($row['laston']) < + getsetting("LOGINTIMEOUT",900) && $row['loggedin']); + if ($loggedin) + $laston=translate_inline("`#Online`0"); + $row['laston']=$laston; + if ($row[$order]!=$oorder) $rn++; + $oorder = $row[$order]; + rawoutput(""); + rawoutput(""); + rawoutput("[ $ed | $del | $ban | $log ]"); + addnav("","user.php?op=edit&userid={$row['acctid']}$m"); + addnav("","user.php?op=del&userid={$row['acctid']}"); + addnav("","user.php?op=setupban&userid={$row['acctid']}"); + addnav("","user.php?op=debuglog&userid={$row['acctid']}"); + rawoutput(""); + output_notl("%s", $row['acctid']); + rawoutput(""); + output_notl("%s", $row['login']); + rawoutput(""); + output_notl("`&%s`0", $row['name']); + rawoutput(""); + output_notl("`^%s`0", $row['level']); + rawoutput(""); + output_notl("%s", $row['laston']); + rawoutput(""); + output_notl("%s", $row['gentimecount']); + rawoutput(""); + output_notl("%s", $row['lastip']); + rawoutput(""); + output_notl("%s", $row['uniqueid']); + rawoutput(""); + output_notl("%s", $row['emailaddress']); + rawoutput(""); + $gentimecount+=$row['gentimecount']; + $gentime+=$row['gentime']; + } + rawoutput(""); + output("Total hits: %s`n", $gentimecount); + output("Total CPU time: %s seconds`n", round($gentime,3)); + output("Average page gen time is %s seconds`n", round($gentime/max($gentimecount,1),4)); +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/user/user_debuglog.php b/lotgd-web/lotgd/lib/user/user_debuglog.php new file mode 100755 index 0000000..860e2e1 --- /dev/null +++ b/lotgd-web/lotgd/lib/user/user_debuglog.php @@ -0,0 +1,72 @@ + 0) { + addnav("Previous page", + "user.php?op=debuglog&userid=$userid&start=$prev$returnpetition"); +} +$result = db_query($sql); +$odate = ""; +while ($row = db_fetch_assoc($result)) { + $dom = date("D, M d",strtotime($row['date'])); + if ($odate != $dom){ + output_notl("`n`b`@%s`0`b`n", $dom); + $odate = $dom; + } + $time = date("H:i:s", strtotime($row['date']))." (".reltime(strtotime($row['date'])).")"; + output_notl("`#%s (%s) `^%s - `&%s`7 %s`0", $row['field'], $row['value'], $time, $row['actorname'], $row['message']); + if ($row['target']) { + output(" \\-- Recipient = `\$%s`0", $row['targetname']); + } + output_notl("`n"); +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/user/user_del.php b/lotgd-web/lotgd/lib/user/user_del.php new file mode 100755 index 0000000..0f4eab2 --- /dev/null +++ b/lotgd-web/lotgd/lib/user/user_del.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/user/user_delban.php b/lotgd-web/lotgd/lib/user/user_delban.php new file mode 100755 index 0000000..fdee3f5 --- /dev/null +++ b/lotgd-web/lotgd/lib/user/user_delban.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/user/user_edit.php b/lotgd-web/lotgd/lib/user/user_edit.php new file mode 100755 index 0000000..bb6b795 --- /dev/null +++ b/lotgd-web/lotgd/lib/user/user_edit.php @@ -0,0 +1,101 @@ +"); + addnav("","user.php?op=special&userid=$userid$returnpetition"); + $grant = translate_inline("Grant New Day"); + rawoutput(""); + $fix = translate_inline("Fix Broken Navs"); + rawoutput(""); + $mark = translate_inline("Mark Email As Valid"); + rawoutput(""); + rawoutput(""); + //Show a user's usertable + rawoutput("
"); + addnav("","user.php?op=save&userid=$userid$returnpetition"); + $save = translate_inline("Save"); + rawoutput(""); + if ($row['loggedin']==1 && $row['laston']>date("Y-m-d H:i:s",strtotime("-".getsetting("LOGINTIMEOUT",900)." seconds"))){ + output_notl("`\$"); + rawoutput(""); + output("`\$Warning:`0"); + rawoutput(""); + output("`\$This user is probably logged in at the moment!`0"); + } + // Okay, munge the display name down to just the players name sans + // title + $row['name'] = get_player_basename($row); + /*careful using this hook! add only things with 'viewonly' in there, nothing will be saved if do otherwise! Example: + do_hook of your module: + array_push($args['userinfo'], "Some Stuff to have a look at,title"); + $args['userinfo']['test'] = "The truth!!!,viewonly"; + $args['user']['test'] = "Is out there???"; + */ + $showformargs = modulehook("modifyuserview", array("userinfo"=>$userinfo, "user"=>$row)); + $info = showform($showformargs['userinfo'],$showformargs['user']); + rawoutput(""); + rawoutput("
"); + output("`n`nLast Page Viewed:`n"); + rawoutput(""); +}elseif(httpget("subop")=="module"){ + //Show a user's prefs for a given module. + addnav("Operations"); + addnav("Edit user","user.php?op=edit&userid=$userid$returnpetition"); + $module = httpget('module'); + $info = get_module_info($module); + if (count($info['prefs']) > 0) { + $data = array(); + $msettings = array(); + while (list($key,$val)=each($info['prefs'])){ + // Handle vals which are arrays. + if (is_array($val)) { + $v = $val[0]; + $x = explode("|", $v); + $val[0] = $x[0]; + $x[0] = $val; + } else { + $x = explode("|",$val); + } + $msettings[$key] = $x[0]; + // Set up the defaults as well. + if (isset($x[1])) $data[$key] = $x[1]; + } + $sql = "SELECT * FROM " . db_prefix("module_userprefs") ." WHERE modulename='$module' AND userid='$userid'"; + $result = db_query($sql); + while ($row = db_fetch_assoc($result)){ + $data[$row['setting']] = $row['value']; + } + rawoutput("
"); + addnav("","user.php?op=savemodule&module=$module&userid=$userid$returnpetition"); + tlschema("module-$module"); + showform($msettings,$data); + tlschema(); + rawoutput("
"); + }else{ + output("The $module module doesn't appear to define any user preferences."); + } +} +module_editor_navs('prefs', "user.php?op=edit&subop=module&userid=$userid$returnpetition&module="); +addnav("","user.php?op=lasthit&userid=$userid"); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/user/user_lasthit.php b/lotgd-web/lotgd/lib/user/user_lasthit.php new file mode 100755 index 0000000..321eac6 --- /dev/null +++ b/lotgd-web/lotgd/lib/user/user_lasthit.php @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/user/user_removeban.php b/lotgd-web/lotgd/lib/user/user_removeban.php new file mode 100755 index 0000000..0afbfa0 --- /dev/null +++ b/lotgd-web/lotgd/lib/user/user_removeban.php @@ -0,0 +1,131 @@ +'') OR (" . db_prefix("bans") . ".uniqueid=" . + db_prefix("accounts") . ".uniqueid AND " . + db_prefix("bans") . ".uniqueid<>''))"; + $r = db_query($sql); + echo ""; + $number=db_num_rows($r); + for ($x=0;$x<$number;$x++){ + $ro = db_fetch_assoc($r); + echo ""; + } + if (db_num_rows($r)==0) + echo ""; + echo ""; + exit(); +} + db_query("DELETE FROM " . db_prefix("bans") . " WHERE banexpire < \"".date("Y-m-d")."\" AND banexpire>'0000-00-00'"); +$duration = httpget("duration"); +if ($duration=="") { + $since = " WHERE banexpire <= '".date("Y-m-d H:i:s",strtotime("+2 weeks"))."' AND banexpire > '0000-00-00'"; + output("`bShowing bans that will expire within 2 weeks.`b`n`n"); +}else{ + if ($duration=="forever") { + $since=""; + output("`bShowing all bans`b`n`n"); + }else{ + $since = " WHERE banexpire <= '".date("Y-m-d H:i:s",strtotime("+".$duration))."' AND banexpire > '0000-00-00'"; + output("`bShowing bans that will expire within %s.`b`n`n",$duration); + } +} +addnav("Will Expire Within"); +addnav("1 week","user.php?op=removeban&duration=1+week"); +addnav("2 weeks","user.php?op=removeban&duration=2+weeks"); +addnav("3 weeks","user.php?op=removeban&duration=3+weeks"); +addnav("4 weeks","user.php?op=removeban&duration=4+weeks"); +addnav("2 months","user.php?op=removeban&duration=2+months"); +addnav("3 months","user.php?op=removeban&duration=3+months"); +addnav("4 months","user.php?op=removeban&duration=4+months"); +addnav("5 months","user.php?op=removeban&duration=5+months"); +addnav("6 months","user.php?op=removeban&duration=6+months"); +addnav("1 year","user.php?op=removeban&duration=1+year"); +addnav("2 years","user.php?op=removeban&duration=2+years"); +addnav("4 years","user.php?op=removeban&duration=4+years"); +addnav("Forever","user.php?op=removeban&duration=forever"); +$sql = "SELECT * FROM " . db_prefix("bans") . " $since ORDER BY banexpire"; +$result = db_query($sql); +rawoutput(" +"); +rawoutput(""); +$ops = translate_inline("Ops"); +$bauth = translate_inline("Ban Author"); +$ipd = translate_inline("IP/ID"); +$dur = translate_inline("Duration"); +$mssg = translate_inline("Message"); +$aff = translate_inline("Affects"); +$l = translate_inline("Last"); + rawoutput(""); +$i=0; +while ($row = db_fetch_assoc($result)) { + $liftban = translate_inline("Lift ban"); + $showuser = translate_inline("Click to show users"); + rawoutput(""); + rawoutput(""); + $i++; +} +rawoutput("
$ops$bauth$ipd$dur$mssg$aff$l
"); + output_notl("%s", $liftban, true); + rawoutput(""); + addnav("","user.php?op=delban&ipfilter=".URLEncode($row['ipfilter'])."&uniqueid=".URLEncode($row['uniqueid'])); + rawoutput(""); + output_notl("`&%s`0", $row['banner']); + rawoutput(""); + output_notl("%s", $row['ipfilter']); + output_notl("%s", $row['uniqueid']); + rawoutput(""); + // "43200" used so will basically round to nearest day rather than floor number of days + $expire= sprintf_translate("%s days", + round((strtotime($row['banexpire'])+43200-strtotime("now"))/86400,0)); + if (substr($expire,0,2)=="1 ") + $expire= translate_inline("1 day"); + if (date("Y-m-d",strtotime($row['banexpire'])) == date("Y-m-d")) + $expire=translate_inline("Today"); + if (date("Y-m-d",strtotime($row['banexpire'])) == + date("Y-m-d",strtotime("1 day"))) + $expire=translate_inline("Tomorrow"); + if ($row['banexpire']=="0000-00-00") + $expire=translate_inline("Never"); + output_notl("%s", $expire); + rawoutput(""); + output_notl("%s", $row['banreason']); + rawoutput(""); + $file = "user.php?op=removeban&subop=xml&ip={$row['ipfilter']}&id={$row['uniqueid']}"; + rawoutput(""); + addnav("",$file); + rawoutput(""); + output_notl("%s", relativedate($row['lasthit'])); + rawoutput("
"); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/user/user_save.php b/lotgd-web/lotgd/lib/user/user_save.php new file mode 100755 index 0000000..1156d89 --- /dev/null +++ b/lotgd-web/lotgd/lib/user/user_save.php @@ -0,0 +1,150 @@ +"") { + $sql.="password=\"".md5(md5($val))."\","; + $updates++; + output("Password value has been updated.`n"); + debuglog($session['user']['name']."`0 changed password to $val",$userid); + if ($session['user']['acctid']==$userid) { + $session['user']['password']=md5(md5($val)); + } + } + }elseif ($key=="superuser"){ + $value = 0; + while (list($k,$v)=each($val)){ + if ($v) $value += (int)$k; + } + //strip off an attempt to set privs that the user doesn't + //have authority to set. + $stripfield = ((int)$oldvalues['superuser'] | $session['user']['superuser'] | SU_ANYONE_CAN_SET | ($session['user']['superuser'] & SU_MEGAUSER ? 0xFFFFFFFF : 0)); + $value = $value & $stripfield; + //put back on privs that the user used to have but the + //current user can't set. + $unremovable = ~ ((int)$session['user']['superuser'] | SU_ANYONE_CAN_SET | ($session['user']['superuser'] & SU_MEGAUSER ? 0xFFFFFFFF : 0)); + $filteredunremovable = (int)$oldvalues['superuser'] & $unremovable; + $value = $value | $filteredunremovable; + if ((int)$value != (int)$oldvalues['superuser']){ + $sql.="$key = \"$value\","; + $updates++; + output("Superuser values have changed.`n"); + if ($session['user']['acctid']==$userid) { + $session['user']['superuser']=$value; + } + debuglog($session['user']['name']."`0 changed superuser to ".show_bitfield($value),$userid); + debug("superuser has changed to $value"); + } + } elseif ($key=="name" && stripslashes($val)!=$oldvalues[$key]) { + $updates++; + $tmp = sanitize_colorname(getsetting("spaceinname", 0), + stripslashes($val), true); + $tmp = preg_replace("/[`][cHw]/", "", $tmp); + $tmp = sanitize_html($tmp); + if ($tmp != stripslashes($val)) { + output("`\$Illegal characters removed from player name!`0`n"); + } + if (soap($tmp) != ($tmp)) { + output("`^The new name doesn't pass the bad word filter!`0"); + } + $newname = change_player_name($tmp, $oldvalues); + $sql.="$key = \"".addslashes($newname)."\","; + output("Changed player name to %s`0`n", $newname); + debuglog($session['user']['name'] . "`0 changed player name to $newname`0", $userid); + $oldvalues['name']=$newname; + if ($session['user']['acctid']==$userid) { + $session['user']['name'] = $newname; + } + } elseif ($key=="title" && stripslashes($val)!=$oldvalues[$key]) { + $updates++; + $tmp = sanitize_colorname(true, stripslashes($val), true); + $tmp = preg_replace("/[`][cHw]/", "", $tmp); + $tmp = sanitize_html($tmp); + if ($tmp != stripslashes($val)) { + output("`\$Illegal characters removed from player title!`0`n"); + } + if (soap($tmp) != ($tmp)) { + output("`^The new title doesn't pass the bad word filter!`0"); + } + $newname = change_player_title($tmp, $oldvalues); + $sql.="$key = \"$val\","; + output("Changed player title from %s`0 to %s`0`n", $oldvalues['title'], $tmp); + $oldvalues[$key]=$tmp; + if ($newname != $oldvalues['name']) { + $sql.="name = \"".addslashes($newname)."\","; + output("Changed player name to %s`0 due to changed dragonkill title`n", $newname); + debuglog($session['user']['name'] . "`0 changed player name to $newname`0 due to changed dragonkill title", $userid); + $oldvalues['name']=$newname; + if ($session['user']['acctid']==$userid) { + $session['user']['name'] = $newname; + } + } + if ($session['user']['acctid']==$userid) { + $session['user']['title'] = $tmp; + } + } elseif ($key=="ctitle" && stripslashes($val)!=$oldvalues[$key]) { + $updates++; + $tmp = sanitize_colorname(true, stripslashes($val), true); + $tmp = preg_replace("/[`][cHw]/", "", $tmp); + $tmp = sanitize_html($tmp); + if ($tmp != stripslashes($val)) { + output("`\$Illegal characters removed from custom title!`0`n"); + } + if (soap($tmp) != ($tmp)) { + output("`^The new custom title doesn't pass the bad word filter!`0"); + } + $newname = change_player_ctitle($tmp, $oldvalues); + $sql.="$key = \"$val\","; + output("Changed player ctitle from %s`0 to %s`0`n", $oldvalues['ctitle'], $tmp); + $oldvalues[$key]=$tmp; + if ($newname != $oldvalues['name']) { + $sql.="name = \"".addslashes($newname)."\","; + output("Changed player name to %s`0 due to changed custom title`n", $newname); + debuglog($session['user']['name'] . "`0 changed player name to $newname`0 due to changed custom title", $userid); + $oldvalues['name']=$newname; + if ($session['user']['acctid']==$userid) { + $session['user']['name'] = $newname; + } + } + if ($session['user']['acctid']==$userid) { + $session['user']['ctitle'] = $tmp; + } + }elseif ($key=="oldvalues"){ + //donothing. + }elseif ($oldvalues[$key]!=stripslashes($val) && isset($oldvalues[$key])){ + $sql.="$key = \"$val\","; + $updates++; + output("%s has changed to %s.`n", $key, stripslashes($val)); + debuglog($session['user']['name']."`0 changed $key to $val",$userid); + if ($session['user']['acctid']==$userid) { + $session['user'][$key]=stripslashes($val); + } + } + } +} + $sql=substr($sql,0,strlen($sql)-1); +$sql = "UPDATE " . db_prefix("accounts") . " SET " . $sql . " WHERE acctid=\"$userid\""; + $petition = httpget("returnpetition"); +if ($petition!="") + addnav("","viewpetition.php?op=view&id=$petition"); +addnav("","user.php"); + if ($updates>0){ + db_query($sql); + debug("Updated $updates fields in the user record with:\n$sql"); + output("%s fields in the user's record were updated.", $updates); +}else{ + output("No fields were changed in the user's record."); +} +$op = "edit"; +httpset($op, "edit"); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/user/user_saveban.php b/lotgd-web/lotgd/lib/user/user_saveban.php new file mode 100755 index 0000000..f6fb3a2 --- /dev/null +++ b/lotgd-web/lotgd/lib/user/user_saveban.php @@ -0,0 +1,40 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/user/user_savemodule.php b/lotgd-web/lotgd/lib/user/user_savemodule.php new file mode 100755 index 0000000..12d5963 --- /dev/null +++ b/lotgd-web/lotgd/lib/user/user_savemodule.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/user/user_setupban.php b/lotgd-web/lotgd/lib/user/user_setupban.php new file mode 100755 index 0000000..b362618 --- /dev/null +++ b/lotgd-web/lotgd/lib/user/user_setupban.php @@ -0,0 +1,76 @@ +"); +output("Set up a new ban by IP or by ID (recommended IP, though if you have several different users behind a NAT, you can try ID which is easily defeated)`n"); +rawoutput(""); +output("IP: "); +rawoutput(""); +output_notl("`n"); +rawoutput(""); +output("ID: "); +rawoutput(""); +output("`nDuration: "); +rawoutput(""); +output("Days (0 for permanent)`n"); +$reason = httpget("reason"); +if ($reason == "") + $reason=translate_inline("Don't mess with me."); +output("Reason for the ban: "); +rawoutput(""); +output_notl("`n"); +$pban = translate_inline("Post ban"); +$conf = translate_inline("Are you sure you wish to issue a permanent ban?"); +rawoutput(""); +rawoutput(""); +output("For an IP ban, enter the beginning part of the IP you wish to ban if you wish to ban a range, or simply a full IP to ban a single IP`n`n"); +addnav("","user.php?op=saveban"); +if ($row['name']!=""){ + $id = $row['uniqueid']; + $ip = $row['lastip']; + $name = $row['name']; + output("`0To help locate similar users to `@%s`0, here are some other users who are close:`n", $name); + output("`bSame ID (%s):`b`n", $id); + $sql = "SELECT name, lastip, uniqueid, laston, gentimecount FROM " . db_prefix("accounts") . " WHERE uniqueid='".addslashes($id)."' ORDER BY lastip"; + $result = db_query($sql); + while ($row = db_fetch_assoc($result)){ + output("`0• (%s) `%%s`0 - %s hits, last: %s`n", $row['lastip'], + $row['name'], $row['gentimecount'], + reltime(strtotime($row['laston']))); + } + output_notl("`n"); + $oip = ""; + $dots = 0; + output("`bSimilar IP's`b`n"); + for ($x=strlen($ip); $x>0; $x--){ + if ($dots>1) break; + $thisip = substr($ip,0,$x); + $sql = "SELECT name, lastip, uniqueid, laston, gentimecount FROM " . db_prefix("accounts") . " WHERE lastip LIKE '$thisip%' AND NOT (lastip LIKE '$oip') ORDER BY uniqueid"; + //output("$sql`n"); + $result = db_query($sql); + if (db_num_rows($result)>0){ + output("• IP Filter: %s ", $thisip); + rawoutput(""); + output("Use this filter"); + rawoutput(""); + output_notl("`n"); + while ($row=db_fetch_assoc($result)){ + output("  ",true); + output("• (%s) [%s] `%%s`0 - %s hits, last: %s`n", + $row['lastip'], $row['uniqueid'], $row['name'], + $row['gentimecount'], + reltime(strtotime($row['laston']))); + } + output_notl("`n"); + } + if (substr($ip,$x-1,1)==".") { + $x--; + $dots++; + } + $oip = $thisip."%"; + } +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/user/user_special.php b/lotgd-web/lotgd/lib/user/user_special.php new file mode 100755 index 0000000..794b8c4 --- /dev/null +++ b/lotgd-web/lotgd/lib/user/user_special.php @@ -0,0 +1,19 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/lib/villagenav.php b/lotgd-web/lotgd/lib/villagenav.php new file mode 100755 index 0000000..525a960 --- /dev/null +++ b/lotgd-web/lotgd/lib/villagenav.php @@ -0,0 +1,21 @@ + diff --git a/lotgd-web/lotgd/list.php b/lotgd-web/lotgd/list.php new file mode 100755 index 0000000..a6e46b3 --- /dev/null +++ b/lotgd-web/lotgd/list.php @@ -0,0 +1,171 @@ +0){ + addnav("Online Clan Members","list.php?op=clan"); + if ($session['user']['alive']) { + addnav("Clan Hall","clan.php"); + } + } +}else{ + addnav("Login Screen","index.php"); + addnav("Currently Online","list.php"); +} + +$playersperpage=50; + +$sql = "SELECT count(acctid) AS c FROM " . db_prefix("accounts") . " WHERE locked=0"; +$result = db_query($sql); +$row = db_fetch_assoc($result); +$totalplayers = $row['c']; + +$op = httpget('op'); +$page = httpget('page'); +$search = ""; +$limit = ""; + +if ($op=="search"){ + $search="%"; + $n = httppost('name'); + for ($x=0;$x0) $pageoffset--; + $pageoffset*=$playersperpage; + $from = $pageoffset+1; + $to = min($pageoffset+$playersperpage,$totalplayers); + + $limit=" LIMIT $pageoffset,$playersperpage "; +} +addnav("Pages"); +for ($i=0;$i<$totalplayers;$i+=$playersperpage){ + $pnum = $i/$playersperpage+1; + if ($page == $pnum) { + addnav(array(" ?`b`#Page %s`0 (%s-%s)`b", $pnum, $i+1, min($i+$playersperpage,$totalplayers)), "list.php?page=$pnum"); + } else { + addnav(array(" ?Page %s (%s-%s)", $pnum, $i+1, min($i+$playersperpage,$totalplayers)), "list.php?page=$pnum"); + } +} + +// Order the list by level, dragonkills, name so that the ordering is total! +// Without this, some users would show up on multiple pages and some users +// wouldn't show up +if ($page=="" && $op==""){ + $title = translate_inline("Warriors Currently Online"); + $sql = "SELECT acctid,name,login,alive,location,race,sex,level,laston,loggedin,lastip,uniqueid FROM " . db_prefix("accounts") . " WHERE locked=0 AND loggedin=1 AND laston>'".date("Y-m-d H:i:s",strtotime("-".getsetting("LOGINTIMEOUT",900)." seconds"))."' ORDER BY level DESC, dragonkills DESC, login ASC"; + $result = db_query_cached($sql,"list.php-warsonline"); +}elseif($op=='clan'){ + $title = translate_inline("Clan Members Online"); + $sql = "SELECT acctid,name,login,alive,location,race,sex,level,laston,loggedin,lastip,uniqueid FROM " . db_prefix("accounts") . " WHERE locked=0 AND loggedin=1 AND laston>'".date("Y-m-d H:i:s",strtotime("-".getsetting("LOGINTIMEOUT",900)." seconds"))."' AND clanid='{$session['user']['clanid']}' ORDER BY level DESC, dragonkills DESC, login ASC"; + $result = db_query($sql); +}else{ + if ($totalplayers > $playersperpage && $op != "search") { + $title = sprintf_translate("Warriors of the realm (Page %s: %s-%s of %s)", ($pageoffset/$playersperpage+1), $from, $to, $totalplayers); + } else { + $title = sprintf_translate("Warriors of the realm"); + } + rawoutput(tlbutton_clear()); + $sql = "SELECT acctid,name,login,alive,hitpoints,location,race,sex,level,laston,loggedin,lastip,uniqueid FROM " . db_prefix("accounts") . " WHERE locked=0 $search ORDER BY level DESC, dragonkills DESC, login ASC $limit"; + $result = db_query($sql); +} +if ($session['user']['loggedin']){ + $search = translate_inline("Search by name: "); + $search2 = translate_inline("Search"); + + rawoutput("
$search
"); + addnav("","list.php?op=search"); +} + +$max = db_num_rows($result); +if ($max>getsetting("maxlistsize", 100)) { + output("`\$Too many names match that search. Showing only the first %s.`0`n", getsetting("maxlistsize", 100)); + $max = getsetting("maxlistsize", 100); +} + +if ($page=="" && $op==""){ + $title .= sprintf_translate(" (%s warriors)", $max); +} +output_notl("`c`b".$title."`b"); + +$alive = translate_inline("Alive"); +$level = translate_inline("Level"); +$name = translate_inline("Name"); +$loc = translate_inline("Location"); +$race = translate_inline("Race"); +$sex = translate_inline("Sex"); +$last = translate_inline("Last On"); + +rawoutput("",true); +rawoutput(""); +$writemail = translate_inline("Write Mail"); +$alive = translate_inline("`1Yes`0"); +$dead = translate_inline("`4No`0"); +$unconscious = translate_inline("`6Unconscious`0"); +for($i=0;$i<$max;$i++){ + $row = db_fetch_assoc($result); + rawoutput(""); +} +rawoutput("
$alive$level$name$loc$race$sex$last
",true); + if ($row['alive'] == true) { + $a = $alive; + } else if ($row['hitpoints'] > 0) { + $a = $unconscious; + } else { + $a = $dead; + } + //$a = translate_inline($row['alive']?"`1Yes`0":"`4No`0"); + output_notl("%s", $a); + rawoutput(""); + output_notl("`^%s`0", $row['level']); + rawoutput(""); + if ($session['user']['loggedin']) { + rawoutput(""); + rawoutput("$writemail"); + rawoutput(""); + addnav("","bio.php?char=".$row['acctid'].""); + } + output_notl("`&%s`0", $row['name']); + if ($session['user']['loggedin']) + rawoutput(""); + rawoutput(""); + $loggedin=(date("U") - strtotime($row['laston']) < getsetting("LOGINTIMEOUT",900) && $row['loggedin']); + output_notl("`&%s`0", $row['location']); + if ($loggedin) { + $online = translate_inline("`#(Online)"); + output_notl("%s", $online); + } + rawoutput(""); + if (!$row['race']) $row['race'] = RACE_UNKNOWN; + tlschema("race"); + output($row['race']); + tlschema(); + rawoutput(""); + $sex = translate_inline($row['sex']?"`%Female`0":"`!Male`0"); + output_notl("%s", $sex); + rawoutput(""); + $laston = relativedate($row['laston']); + output_notl("%s", $laston); + rawoutput("
"); +output_notl("`c"); +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lodge.php b/lotgd-web/lotgd/lodge.php new file mode 100755 index 0000000..f8423c9 --- /dev/null +++ b/lotgd-web/lotgd/lodge.php @@ -0,0 +1,90 @@ + 0) || ($session['user']['superuser'] & SU_EDIT_COMMENTS); +if ($pointsavailable < 0) $pointsavailable = 0; // something weird. + +page_header("Hunter's Lodge"); +addnav("Referrals", "referral.php"); +if ($op != "" && $entry) + addnav("L?Back to the Lodge", "lodge.php"); +addnav("Describe Points","lodge.php?op=points"); +villagenav(); + + +if ($op==""){ + output("`b`c`!The Hunter's Lodge`0`c`b"); + output("`7You follow a narrow path away from the stables and come across a rustic Hunter's Lodge."); + output("A guard stops you at the door and asks to see your membership card.`n`n"); + + if ($entry){ + output("Upon showing it to him, he says, `3\"Very good %s, welcome to the J. C. Petersen Hunting Lodge.", translate_inline($session['user']['sex']?"ma'am":"sir")); + output("You have earned `^%s`3 points and have `^%s`3 points available to spend,\"`7 and admits you in.`n`n", $session['user']['donation'], $pointsavailable); + output("You enter a room dominated by a large fireplace at the far end."); + output("The wood-panelled walls are covered with weapons, shields, and mounted hunting trophies, including the heads of several dragons that seem to move in the flickering light.`n`n"); + output("Many high-backed leather chairs fill the room."); + output("In the chair closest to the fire sits J. C. Petersen, reading a heavy tome entitled \"Alchemy Today.\"`n`n"); + output("As you approach, a large hunting dog at his feet raises her head and looks at you."); + output("Sensing that you belong, she lays down and goes back to sleep.`n`n"); + commentdisplay("Nearby some other rugged hunters talk:`n", "hunterlodge","Talk quietly",25); + addnav("Use Points"); + modulehook("lodge"); + }else{ + $iname = getsetting("innname", LOCATION_INN); + output("You pull out your Frequent Boozer Card from %s, with 9 out of the 10 slots punched out with a small profile of %s`0's Head.`n`n", $iname,getsetting('barkeep','`tCedrik')); + output("The guard glances at it, advises you not to drink so much, and directs you down the path."); + } +}else if ($op=="points"){ + output("`b`3Points:`b`n`n"); + $points_messages = modulehook( + "donator_point_messages", + array( + 'messages'=>array( + 'default'=>tl("`7For each $1 donated, the account which makes the donation will receive 100 contributor points in the game.") + ) + ) + ); + foreach($points_messages['messages'] as $id => $message){ + output_notl($message, true); + } + output("\"`&But what are points,`7\" you ask?"); + output("Points can be redeemed for various advantages in the game."); + output("You'll find access to these advantages in the Hunter's Lodge."); + output("As time goes on, more advantages will likely be added, which can be purchased when they are made available.`n`n"); + output("Donating even one dollar will gain you a membership card to the Hunter's Lodge, an area reserved exclusively for contributors."); + output("Donations are accepted in whole dollar increments only.`n`n"); + output("\"`&But I don't have access to a PayPal account, or I otherwise can't donate to your very wonderful project!`7\"`n"); + // yes, "referer" is misspelt here, but the game setting was also misspelt + if (getsetting("refereraward", 25)) { + output("Well, there is another way that you can obtain points: by referring other people to our site!"); + output("You'll get %s points for each person whom you've referred who makes it to level %s.", getsetting("refereraward", 25), getsetting("referminlevel", 4)); + output("Even one person making it to level %s will gain you access to the Hunter's Lodge.`n`n", getsetting("referminlevel", 4)); + } + output("You can also gain contributor points for contributing in other ways that the administration may specify."); + output("So, don't despair if you cannot send cash, there will always be non-cash ways of gaining contributor points.`n`n"); + output("`b`3Purchases that are currently available:`0`b`n"); + $args = modulehook("pointsdesc", array("format"=>"`#•`7 %s`n", "count"=>0)); + if ($args['count'] == 0) { + output("`#•`7None -- Please talk to your admin about creating some.`n", true); + } +} + +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/logdnet.php b/lotgd-web/lotgd/logdnet.php new file mode 100755 index 0000000..962e425 --- /dev/null +++ b/lotgd-web/lotgd/logdnet.php @@ -0,0 +1,277 @@ + $value) { + if (strncmp($aver, $value, strlen($value)) == 0) + if ($costa == 10000) $costa = $index; + if (strncmp($bver, $value, strlen($value)) == 0) + if ($costb == 10000) $costb = $index; + } + + // If both are the same prefix (or no prefix), just strcmp. + if ($costa == $costb) { + return strcmp($aver, $bver); + } + + return (($costa < $costb) ? -1 : 1); +} + +$op = httpget('op'); +if ($op==""){ + $addy = httpget('addy'); + $desc = httpget('desc'); + $vers = httpget('version'); + $admin = httpget('admin'); + $count = httpget('c')*1; + $lang = httpget('l'); + + if ($vers == "") $vers = "Unknown"; + if ($admin == "" || $admin=="postmaster@localhost.com") + $admin = "unknown"; + + // See if we know this server. + $sql = "SELECT lastupdate,serverid,lastping,recentips FROM " . db_prefix("logdnet") . " WHERE address='$addy'"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + + // Clean up the desc + $desc = logdnet_sanitize($desc); + $desc = soap($desc); + // Limit descs to 75 characters. + if (strlen($desc) > 75) $desc = substr($desc, 0, 75); + + $date = date("Y-m-d H:i:s"); + if (db_num_rows($result)>0){ + // This is an already known server. + + // Eric, this below code does NOT work and causes a server to NEVER + // get updated.. I'm commenting it out until you rethink it! + // the server addy doesn't *change* so by checking this we never + // update + // It seems as if you thought this was the IP of the user logging in. + // Also, nothing ever expires the IP from this list. + //$ips = array_flip(explode(",",$row['recentips'])); + //if (isset($ips[$_SERVER['REMOTE_ADDR']])){ + // //we've seen this user too recently. + //}else{ + // $ips = array_keys($ips); + // if (!isset($ips[$_SERVER['REMOTE_ADDR']])) + // array_push($ips,$_SERVER['REMOTE_ADDR']); + // $ips = addslashes(join(',',$ips)); + + // TEMP hack for IPs + $ips = $_SERVER['REMOTE_ADDR']; + // Only one update per minute allowed. + if (strtotime($row['lastping'])=2){ + $currency = getsetting("paypalcurrency", "USD"); + $info = array(); + $info[''] = ' +
+ + + + + + + + + + + +
'; + $info['image'] = join("",file("images/paypal1.gif")); + $info['content-type'] = "image/gif"; + + echo base64_encode(serialize($info)); + } +}elseif ($op=="net"){ + // Someone is requesting our list of servers, so give it to them. + + // I'm going to do a slightly niftier sort manually in a bit which always + // pops the most recent 'official' versions to the top of the list. + $sql = "SELECT address,description,version,admin,priority FROM " . db_prefix("logdnet") . " WHERE lastping > '".date("Y-m-d H:i:s",strtotime("-7 days"))."'"; + $result=db_query($sql); + $rows = array(); + $number=db_num_rows($result); + for ($i=0;$i<$number;$i++){ + $rows[] = db_fetch_assoc($result); + } + $rows = apply_logdnet_bans($rows); + usort($rows, "lotgdsort"); + + // Okay, they are now sorted, so output them + for ($i = 0; $i < count($rows); $i++) { + $row = serialize($rows[$i]); + echo $row."\n"; + } +}else{ + page_header("LoGD Net"); + addnav("Login page","index.php"); + output("`@Below are a list of other LoGD servers that have registered with the LoGD Net.`n"); + output("`2It should be noted that this list is subject to editing and culling by the administrators of logdnet.logd.com. "); + output("Normally this list is a comprehensive list of all servers that have elected to register with LoGDnet, but I'm making changes to that. "); + output("Because this list is a free service provided by logdnet.logd.com, we reserve the right to remove those who we don't want in the list.`n"); + output("Reasons we might remove a server:`n"); + output("• Altering our copyright statement outside of the provisions we have provided within the code,`n", true); + output("• Removing our PayPal link,`n", true); + output("• Providing deceptive, inappropriate, or false information in the server listing,`n", true); + output("• Not linking back to LoGDnet`n", true); + output("Or really, any other reason that we want.`n"); + output("If you've been banned already, chances are you know why, and chances are we've got no interest in removing the ban."); + output("We provide this free of charge, at the expense of considerable bandwidth and server load, so if you've had the gall to abuse our charity, don't expect it to be won back very easily.`n`n"); + output("If you are well behaved, we don't have an interest in blocking you from this listing. `0`n"); + rawoutput(""); + rawoutput(""); + require_once("lib/pullurl.php"); + $u = getsetting("logdnetserver", "http://logdnet.logd.com/"); + if (!preg_match("/\\/$/", $u)) { + $u = $u . "/"; + savesetting("logdnetserver", $u); + } + $servers=pullurl($u."logdnet.php?op=net"); + if (!$servers) $servers = array(); + $i = 0; + while (list($key,$val)=each($servers)){ + $row=unserialize($val); + + // If we aren't given an address, continue on. + if (substr($row['address'],0,7)!="http://" && + substr($row['address'],0,8) != "https://") { + continue; + } + + // Give undescribed servers a boring descriptionn + if (trim($row['description'])=="") + $row['description']="Another boring and undescribed LotGD server"; + + // Strip out any embedded html. + $row['description'] = + preg_replace("|<[a-zA-Z0-9/ =]+>|", "", $row['description']); + + // Clean up the desc + $row['description'] = logdnet_sanitize($row['description']); + $row['description'] = soap($row['description']); + // Limit descs to 75 characters. + if (strlen($row['description']) > 75) + $row['description'] = substr($row['description'], 0, 75); + + $row['description'] = htmlentities(stripslashes($row['description']), ENT_COMPAT, getsetting("charset", "ISO-8859-1")); + $row['description'] = str_replace("`&", "`&", $row['description']); + + // Correct for old logdnet servers + if ($row['version']=="") $row['version'] = translate_inline("Unknown"); + + // Output the information we have. + rawoutput(""); + rawoutput(""); + $i++; + } + rawoutput("
"); + output("Server"); + rawoutput(""); + output("Version"); + rawoutput("
"); + output_notl("`&%s`0",$row['description'], true); + rawoutput(""); + output_notl("`^%s`0", $row['version']); // so we are able to translate "`^Unknown`0" + rawoutput("
"); + page_footer(); +} + +function apply_logdnet_bans($logdnet){ + $sql = "SELECT * FROM ".db_prefix("logdnetbans"); + $result = db_query($sql,"logdnetbans"); + while ($row = db_fetch_assoc($result)){ + reset($logdnet); + while (list($i,$net)=each($logdnet)){ + if (preg_match("/{$row['banvalue']}/i",$net[$row['bantype']])){ + unset($logdnet[$i]); + } + } + } + return $logdnet; +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/login.php b/lotgd-web/lotgd/login.php new file mode 100755 index 0000000..d24a8dc --- /dev/null +++ b/lotgd-web/lotgd/login.php @@ -0,0 +1,188 @@ +" . $session['user']['restorepage'] . ""; + + $str = sprintf_translate("Sending you to %s, have a safe journey", $link); + header("Location: {$session['user']['restorepage']}"); + saveuser(); + echo $str; + exit(); + } + + db_query("UPDATE " . db_prefix("accounts") . " SET loggedin=".true.", laston='".date("Y-m-d H:i:s")."' WHERE acctid = ".$session['user']['acctid']); + + $session['user']['loggedin']=true; + $location = $session['user']['location']; + if ($session['user']['location']==$iname) + $session['user']['location']=$vname; + + if ($session['user']['restorepage']>""){ + redirect($session['user']['restorepage']); + }else{ + if ($location == $iname) { + redirect("inn.php?op=strolldown"); + }else{ + redirect("news.php"); + } + } + } + }else{ + $session['message']=translate_inline("`4Error, your login was incorrect`0"); + //now we'll log the failed attempt and begin to issue bans if + //there are too many, plus notify the admins. + $sql = "DELETE FROM " . db_prefix("faillog") . " WHERE date<'".date("Y-m-d H:i:s",strtotime("-".(getsetting("expirecontent",180)/4)." days"))."'"; + checkban(); + db_query($sql); + $sql = "SELECT acctid FROM " . db_prefix("accounts") . " WHERE login='$name'"; + $result = db_query($sql); + if (db_num_rows($result)>0){ + // just in case there manage to be multiple accounts on + // this name. + while ($row=db_fetch_assoc($result)){ + $post = httpallpost(); + $sql = "INSERT INTO " . db_prefix("faillog") . " VALUES (0,'".date("Y-m-d H:i:s")."','".addslashes(serialize($post))."','{$_SERVER['REMOTE_ADDR']}','{$row['acctid']}','{$_COOKIE['lgi']}')"; + db_query($sql); + $sql = "SELECT " . db_prefix("faillog") . ".*," . db_prefix("accounts") . ".superuser,name,login FROM " . db_prefix("faillog") . " INNER JOIN " . db_prefix("accounts") . " ON " . db_prefix("accounts") . ".acctid=" . db_prefix("faillog") . ".acctid WHERE ip='{$_SERVER['REMOTE_ADDR']}' AND date>'".date("Y-m-d H:i:s",strtotime("-1 day"))."'"; + $result2 = db_query($sql); + $c=0; + $alert=""; + $su=false; + while ($row2=db_fetch_assoc($result2)){ + if ($row2['superuser']>0) {$c+=1; $su=true;} + $c+=1; + $alert.="`3{$row2['date']}`7: Failed attempt from `&{$row2['ip']}`7 [`3{$row2['id']}`7] to log on to `^{$row2['login']}`7 ({$row2['name']}`7)`n"; + } + if ($c>=10){ + // 5 failed attempts for superuser, 10 for regular user + $banmessage=translate_inline("Automatic System Ban: Too many failed login attempts."); + $sql = "INSERT INTO " . db_prefix("bans") . " VALUES ('{$_SERVER['REMOTE_ADDR']}','','".date("Y-m-d H:i:s",strtotime("+".($c*3)." hours"))."','$banmessage','System','0000-00-00 00:00:00')"; + db_query($sql); + if ($su){ + // send a system message to admins regarding + // this failed attempt if it includes superusers. + $sql = "SELECT acctid FROM " . db_prefix("accounts") ." WHERE (superuser&".SU_EDIT_USERS.")"; + $result2 = db_query($sql); + $subj = translate_mail(array("`#%s failed to log in too many times!",$_SERVER['REMOTE_ADDR']),0); + $number=db_num_rows($result2); + for ($i=0;$i<$number;$i++){ + $row2 = db_fetch_assoc($result2); + //delete old messages that + $sql = "DELETE FROM " . db_prefix("mail") . " WHERE msgto={$row2['acctid']} AND msgfrom=0 AND subject = '".serialize($subj)."' AND seen=0"; + db_query($sql); + if (db_affected_rows()>0) $noemail = true; else $noemail = false; + $msg = translate_mail(array("This message is generated as a result of one or more of the accounts having been a superuser account. Log Follows:`n`n%s",$alert),0); + systemmail($row2['acctid'],$subj,$msg,0,$noemail); + }//end for + }//end if($su) + }//end if($c>=10) + }//end while + }//end if (db_num_rows) + redirect("index.php"); + } + } +}else if ($op=="logout"){ + if ($session['user']['loggedin']){ + $location = $session['user']['location']; + if ($location == $iname) { + $session['user']['restorepage']="inn.php?op=strolldown"; + } else { + $session['user']['restorepage']="news.php"; + } + $sql = "UPDATE " . db_prefix("accounts") . " SET loggedin=0,restorepage='{$session['user']['restorepage']}' WHERE acctid = ".$session['user']['acctid']; + db_query($sql); + invalidatedatacache("charlisthomepage"); + invalidatedatacache("list.php-warsonline"); + + // Handle the change in number of users online + translator_check_collect_texts(); + + // Let's throw a logout module hook in here so that modules + // like the stafflist which need to invalidate the cache + // when someone logs in or off can do so. + modulehook("player-logout"); + saveuser(); + } + $session=array(); + redirect("index.php"); +} +// If you enter an empty username, don't just say oops.. do something useful. +$session=array(); +$session['message']=translate_inline("`4Error, your login was incorrect`0"); +redirect("index.php"); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/lotgd.sql b/lotgd-web/lotgd/lotgd.sql new file mode 100755 index 0000000..5743087 --- /dev/null +++ b/lotgd-web/lotgd/lotgd.sql @@ -0,0 +1,1181 @@ +-- MySQL dump 10.17 Distrib 10.3.22-MariaDB, for debian-linux-gnu (x86_64) +-- +-- Host: localhost Database: lotgd +-- ------------------------------------------------------ +-- Server version 10.3.22-MariaDB-1ubuntu1 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Current Database: `lotgd` +-- + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `lotgd` /*!40100 DEFAULT CHARACTER SET utf8mb4 */; + +USE `lotgd`; + +-- +-- Table structure for table `accounts` +-- + +DROP TABLE IF EXISTS `accounts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `accounts` ( + `acctid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(60) NOT NULL, + `sex` tinyint(4) unsigned NOT NULL DEFAULT 0, + `specialty` varchar(20) NOT NULL, + `experience` int(11) unsigned NOT NULL DEFAULT 0, + `gold` int(11) unsigned NOT NULL DEFAULT 0, + `weapon` varchar(50) NOT NULL DEFAULT 'Fists', + `armor` varchar(50) NOT NULL DEFAULT 'T-Shirt', + `seenmaster` int(4) unsigned NOT NULL DEFAULT 0, + `level` int(11) unsigned NOT NULL DEFAULT 1, + `defense` int(11) unsigned NOT NULL DEFAULT 1, + `attack` int(11) unsigned NOT NULL DEFAULT 1, + `alive` int(11) unsigned NOT NULL DEFAULT 1, + `goldinbank` int(11) NOT NULL DEFAULT 0, + `marriedto` int(11) unsigned NOT NULL DEFAULT 0, + `spirits` int(4) NOT NULL DEFAULT 0, + `laston` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `hitpoints` int(11) NOT NULL DEFAULT 10, + `maxhitpoints` int(11) unsigned NOT NULL DEFAULT 10, + `gems` int(11) unsigned NOT NULL DEFAULT 0, + `weaponvalue` int(11) unsigned NOT NULL DEFAULT 0, + `armorvalue` int(11) unsigned NOT NULL DEFAULT 0, + `location` varchar(25) NOT NULL DEFAULT 'Degolburg', + `turns` int(11) unsigned NOT NULL DEFAULT 10, + `title` varchar(25) NOT NULL, + `password` varchar(32) NOT NULL, + `badguy` text NOT NULL, + `companions` text NOT NULL, + `allowednavs` mediumtext NOT NULL, + `loggedin` tinyint(4) unsigned NOT NULL DEFAULT 0, + `resurrections` int(11) unsigned NOT NULL DEFAULT 0, + `superuser` int(11) unsigned NOT NULL DEFAULT 1, + `weapondmg` int(11) NOT NULL DEFAULT 0, + `armordef` int(11) NOT NULL DEFAULT 0, + `age` int(11) unsigned NOT NULL DEFAULT 0, + `charm` int(11) unsigned NOT NULL DEFAULT 0, + `specialinc` varchar(50) NOT NULL, + `specialmisc` text NOT NULL, + `login` varchar(50) NOT NULL, + `lastmotd` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `playerfights` int(11) unsigned NOT NULL DEFAULT 3, + `lasthit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `seendragon` tinyint(4) unsigned NOT NULL DEFAULT 0, + `dragonkills` int(11) unsigned NOT NULL DEFAULT 0, + `locked` tinyint(4) unsigned NOT NULL DEFAULT 0, + `restorepage` varchar(128) DEFAULT NULL, + `hashorse` tinyint(4) unsigned NOT NULL DEFAULT 0, + `bufflist` text NOT NULL, + `gentime` double unsigned NOT NULL DEFAULT 0, + `gentimecount` int(11) unsigned NOT NULL DEFAULT 0, + `lastip` varchar(40) NOT NULL, + `uniqueid` varchar(32) DEFAULT NULL, + `dragonpoints` text NOT NULL, + `boughtroomtoday` tinyint(4) NOT NULL DEFAULT 0, + `emailaddress` varchar(128) NOT NULL, + `emailvalidation` varchar(32) NOT NULL, + `sentnotice` int(11) NOT NULL DEFAULT 0, + `prefs` text NOT NULL, + `pvpflag` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `transferredtoday` int(11) unsigned NOT NULL DEFAULT 0, + `soulpoints` int(11) unsigned NOT NULL DEFAULT 0, + `gravefights` int(11) unsigned NOT NULL DEFAULT 0, + `hauntedby` varchar(50) NOT NULL, + `deathpower` int(11) unsigned NOT NULL DEFAULT 0, + `gensize` int(11) unsigned NOT NULL DEFAULT 0, + `recentcomments` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `donation` int(11) unsigned NOT NULL DEFAULT 0, + `donationspent` int(11) unsigned NOT NULL DEFAULT 0, + `donationconfig` text NOT NULL, + `referer` int(11) unsigned NOT NULL DEFAULT 0, + `refererawarded` tinyint(1) NOT NULL DEFAULT 0, + `bio` varchar(255) NOT NULL, + `race` varchar(25) NOT NULL DEFAULT '0', + `biotime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `banoverride` tinyint(4) DEFAULT 0, + `buffbackup` text DEFAULT NULL, + `amountouttoday` int(11) unsigned NOT NULL DEFAULT 0, + `pk` tinyint(3) unsigned NOT NULL DEFAULT 0, + `dragonage` int(11) unsigned NOT NULL DEFAULT 0, + `bestdragonage` int(11) unsigned NOT NULL DEFAULT 0, + `ctitle` varchar(25) NOT NULL, + `beta` tinyint(3) unsigned NOT NULL DEFAULT 0, + `slaydragon` tinyint(4) unsigned NOT NULL DEFAULT 0, + `fedmount` tinyint(4) unsigned NOT NULL DEFAULT 0, + `regdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `clanid` int(11) unsigned NOT NULL DEFAULT 0, + `clanrank` tinyint(4) unsigned NOT NULL DEFAULT 0, + `clanjoindate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`acctid`), + KEY `name` (`name`), + KEY `level` (`level`), + KEY `login` (`login`), + KEY `alive` (`alive`), + KEY `laston` (`laston`), + KEY `lasthit` (`lasthit`), + KEY `emailaddress` (`emailaddress`), + KEY `clanid` (`clanid`), + KEY `locked` (`locked`,`loggedin`,`laston`), + KEY `referer` (`referer`), + KEY `uniqueid` (`uniqueid`), + KEY `emailvalidation` (`emailvalidation`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `accounts` +-- + +LOCK TABLES `accounts` WRITE; +/*!40000 ALTER TABLE `accounts` DISABLE KEYS */; +INSERT INTO `accounts` VALUES (1,'`%Admin `&admin`0',0,'MP',0,0,'Fists','T-Shirt',0,1,1,1,1,0,0,1,'2020-08-12 19:11:19',10,10,0,0,0,'Degolburg',11,'','a31e0f49d2dc4381072e30ee5a313237','','a:0:{}','a:0:{}',0,0,3923967,0,0,1,0,'','','admin','0000-00-00 00:00:00',3,'2020-08-12 19:08:59',0,0,0,'news.php',0,'a:0:{}',3.5302112102506,32,'192.168.1.133','8cec52f5b954fa644bc0bc91650fb69d','a:0:{}',0,'','',0,'a:1:{s:12:\"ihavenocheer\";i:0;}','0000-00-00 00:00:00',0,55,10,'',0,721701,'0000-00-00 00:00:00',0,0,'',0,0,'','Human','0000-00-00 00:00:00',0,NULL,0,0,0,0,'`%Admin',0,0,0,'2020-08-12 19:08:34',0,0,'0000-00-00 00:00:00'); +/*!40000 ALTER TABLE `accounts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `accounts_output` +-- + +DROP TABLE IF EXISTS `accounts_output`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `accounts_output` ( + `acctid` int(11) unsigned NOT NULL, + `output` mediumtext NOT NULL, + PRIMARY KEY (`acctid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `accounts_output` +-- + +LOCK TABLES `accounts_output` WRITE; +/*!40000 ALTER TABLE `accounts_output` DISABLE KEYS */; +INSERT INTO `accounts_output` VALUES (1,'\r\n\r\n\r\n\r\n Degolburg Square\r\n \r\n \r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\'\'\'\'\'\'
\'\'• Degolburg Square\'\'
\'\'\'\'\'\'
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\'\'\'\'\'\'
\'\'
\r\n—City Gates—
\r\n\r\nForest
\r\n\r\nSlay Other Players
\r\n\r\nQuit to the fields
\r\n\r\nMercenary Camp
\r\n\n\r\n—Blades Boulevard—
\r\n\r\nBluspring\'s Warrior Training
\r\n\r\nJCP\'s Hunter Lodge
\r\n\n\r\n—Market Street—
\r\n\r\nMightyE\'s Weaponry
\r\n\r\nPegasus Armor
\r\n\r\nYe Olde Bank
\r\n\r\nZe Gypsy Tent
\r\n\n\r\n—Tavern Street—
\r\n\r\nThe Boar\'s Head Inn
\r\n\r\nMerick\'s Stables
\r\n\r\nThe Gardens
\r\n\r\nCurious Looking Rock
\r\n\r\nClan Halls
\r\n\n\r\n—Info—
\r\n\r\n(?) F.A.Q. (newbies start here)
\r\n\r\nDaily News
\r\n\r\nList Warriors
\r\n\r\nHall o\' Fame
\r\n\n\r\n—Other—
\r\n\r\nPreferences
\r\n\n\r\n—Superuser—
\r\n\r\n(,) Comment Moderation
\r\n\r\n(X) Superuser Grotto
\r\n\r\n(/) New Day
\r\n\n
\'\'
\'\'\'\'\'\'
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\'\'\'\'\'\'
\'\'\r\n \r\n \r\n \r\n \r\n \r\n
\r\n\n\n
Degolburg Square
The village of Degolburg hustles and bustles. No one really notices that you\'re standing there. You see various shops and businesses along main street. There is a curious looking rock to one side. On every side the village is surrounded by deep dark forest.
\n
\n\nThe clock on the inn reads
4:45 am.
\n\n
\n
Nearby some villagers talk:
\n\n\n\n\n\n\n\n\n\n\n\n\n
\n
Speak
\n\n\n
\n\n\n\n\r\n \n\n\n
\n\r\n \r\n \n\n\n\n\n\n
\n\n
\n\n\n\n\n\n<< First Unseen < Previous\n Refresh \nNext > Last Page >>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\'\'\'\'\'\'
\'\'\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
Vital Info
NameAdmin admin
Level1
Hitpoints10/10
Turns11
Attack1
Defense1
SpiritsHigh
RaceHuman
Personal Info
Gold0
Gems0
Experience0
Equipment Info
WeaponFists
ArmorT-Shirt
Buffs:
None
\r\n

 

\n\n\n\n\n\n\n\n\n\n\n\n
\n\n\n\n\n\n\n\n\n\n\n\n
\'\'
\'\'\'\'\'\'
\r\n
\r\n
\'\'
\'\'\'\'\'\'
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\'\'\'\'\'\'
\'\'\r\n \r\n \r\n \r\n \r\n \r\n
\n\n\'Creative\nThis work is licensed under a Creative Commons License.
\n\n\nGame Design and Code: Copyright © 2002-2005, Eric Stevens & JT Traub, © 2006-2007, Dragonprime Development Team
Design: Jade Template © Josh Canning 2004 of HFS
View PHP Source
Version: 1.1.2 Dragonprime Edition
(Page gen: 0.592s / 314 queries (0.554s), Ave: 0.11s - 3.53/32)
\r\n
\'\'
\'\'\'\'\'\'
\r\n
\r\n\r\n\r\n'); +/*!40000 ALTER TABLE `accounts_output` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `armor` +-- + +DROP TABLE IF EXISTS `armor`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `armor` ( + `armorid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `armorname` varchar(128) DEFAULT NULL, + `value` int(11) NOT NULL DEFAULT 0, + `defense` int(11) NOT NULL DEFAULT 1, + `level` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`armorid`) +) ENGINE=InnoDB AUTO_INCREMENT=196 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `armor` +-- + +LOCK TABLES `armor` WRITE; +/*!40000 ALTER TABLE `armor` DISABLE KEYS */; +INSERT INTO `armor` VALUES (1,'Fuzzy Slippers',48,1,0),(2,'Flannel Pajamas',225,2,0),(3,'Homespun Longjohns',585,3,0),(4,'Homespun Undershirt',990,4,0),(5,'Knitted Socks',1575,5,0),(6,'Knitted Gloves',2250,6,0),(7,'Old Leather Boots',2790,7,0),(8,'Homespun Pants',3420,8,0),(9,'Homespun Tunic',4230,9,0),(10,'Gypsy Cape',5040,10,0),(11,'Old Leather Cap',5850,11,0),(12,'Old Leather Bracers',6840,12,0),(13,'Traveller\'s Shield',8010,13,0),(14,'Old Leather Pants',9000,14,0),(15,'Old Leather Tunic',10350,15,0),(16,'Flip-Flops',48,1,1),(17,'Swimsuit and Towel',225,2,1),(18,'Cotton Undershirt',585,3,1),(19,'Wool Socks',990,4,1),(20,'Wool Gloves',1575,5,1),(21,'Leather Boots',2250,6,1),(22,'Leather Cap',2790,7,1),(23,'Leather Bracers',3420,8,1),(24,'Leather Leggings',4230,9,1),(25,'Leather Tunic',5040,10,1),(26,'Hooded Leather Cape',5850,11,1),(27,'Deerskin Leggings',6840,12,1),(28,'Deerskin Belt',8010,13,1),(29,'Deerskin Tunic',9000,14,1),(30,'Small Rawhide Shield',10350,15,1),(31,'Workboots',48,1,2),(32,'Overalls',225,2,2),(33,'Sturdy Leather Gloves',585,3,2),(34,'Sturdy Leather Bracers',990,4,2),(35,'Sturdy Leather Boots',1575,5,2),(36,'Sturdy Leather Helm',2250,6,2),(37,'Sturdy Leather Pants',2790,7,2),(38,'Sturdy Leather Tunic',3420,8,2),(39,'Sturdy Leather Cloak',4230,9,2),(40,'Woodsman\'s Helm',5040,10,2),(41,'Woodsman\'s Gauntlets',5850,11,2),(42,'Woodsman\'s Bracers',6840,12,2),(43,'Woodsman\'s Greaves',8010,13,2),(44,'Woodsman\'s Tunic',9000,14,2),(45,'Woodsman\'s Kite Shield',10350,15,2),(46,'Showercap and Towel',48,1,3),(47,'Bathrobe',225,2,3),(48,'Wolfskin Gloves',585,3,3),(49,'Wolfskin-lined Boots',990,4,3),(50,'Wolfskin Bracers',1575,5,3),(51,'Wolfskin Pants',2250,6,3),(52,'Wolfskin Tunic',2790,7,3),(53,'Hooded Wolfskin Cape',3420,8,3),(54,'Wolfmaster\'s Bracers',4230,9,3),(55,'Wolfmaster\'s Gauntlets',5040,10,3),(56,'Wolfmasters Helm',5850,11,3),(57,'Wolfmaster\'s Leggings',6840,12,3),(58,'Wolfmaster\'s Belted Jerkin',8010,13,3),(59,'Wolfhide Cape',9000,14,3),(60,'Shield of the Wolf Master',10350,15,3),(61,'Sweat Pants',48,1,4),(62,'Sweat Shirt',225,2,4),(63,'Studded Leather Helm',585,3,4),(64,'Studded Leather Gauntlets',990,4,4),(65,'Hardened Leather Boots',1575,5,4),(66,'Studded Leather Leggings',2250,6,4),(67,'Studded Leather Tunic',2790,7,4),(68,'Tanner\'s Cape',3420,8,4),(69,'Rusty Chainmail Helm',4230,9,4),(70,'Rusty Chainmail Gauntlets',5040,10,4),(71,'Rusty Chainmail Bracers',5850,11,4),(72,'Rusty Chainmail Boots',6840,12,4),(73,'Rusty Chainmail Greaves',8010,13,4),(74,'Rusty Chainmail Tunic',9000,14,4),(75,'Large Iron Buckler',10350,15,4),(76,'Bunny Slippers',48,1,5),(77,'Feety Pajamas',225,2,5),(78,'Comfortable Leather Undergarments',585,3,5),(79,'Heavy Chainmail Helm',990,4,5),(80,'Heavy Chainmail Gauntlets',1575,5,5),(81,'Heavy Chainmail Bracers',2250,6,5),(82,'Heavy Chainmail Boots',2790,7,5),(83,'Heavy Chainmail Greaves',3420,8,5),(84,'Heavy Chainmail Tunic',4230,9,5),(85,'Dragon Soldier\'s Bracers',5040,10,5),(86,'Dragon Soldier\'s Gauntlets',5850,11,5),(87,'Dragon Soldier\'s Boots',6840,12,5),(88,'Dragon Soldier\'s Greaves',8010,13,5),(89,'Dragon Soldier\'s Chestplate',9000,14,5),(90,'Dragon Soldier\'s Shield',10350,15,5),(91,'Bluejeans',48,1,6),(92,'Flannel Shirt',225,2,6),(93,'Well Crafted Bronze Helm',585,3,6),(94,'Well Crafted Bronze Gauntlets',990,4,6),(95,'Well Crafted Bronze Bracers',1575,5,6),(96,'Well Crafted Bronze Boots',2250,6,6),(97,'Well Crafted Bronze Greaves',2790,7,6),(98,'Well Crafted Bronze Chestplate',3420,8,6),(99,'Enchanted Bronze Helm',4230,9,6),(100,'Enchanted Bronze Gauntlets',5040,10,6),(101,'Enchanted Bronze Bracers',5850,11,6),(102,'Enchanted Bronze Boots',6840,12,6),(103,'Enchanted Bronze Greaves',8010,13,6),(104,'Enchanted Bronze Chestplate',9000,14,6),(105,'Hooded Unicorn Skin Cloak',10350,15,6),(106,'Barrel',48,1,7),(107,'Lampshade',225,2,7),(108,'Perfectly Crafted Steel Helm',585,3,7),(109,'Perfectly Crafted Steel Gauntlets',990,4,7),(110,'Perfectly Crafted Steel Boots',1575,5,7),(111,'Perfectly Crafted Steel Bracers',2250,6,7),(112,'Perfectly Crafted Steel Greaves',2790,7,7),(113,'Perfectly Crafted Steel Chestplate',3420,8,7),(114,'Griffon-Feather Cloak',4230,9,7),(115,'Dwarven Chainmail Helm',5040,10,7),(116,'Dwarven Chainmail Gauntlets',5850,11,7),(117,'Dwarven Chainmail Boots',6840,12,7),(118,'Dwarven Chainmail Bracers',8010,13,7),(119,'Dwarven Chainmail Greaves',9000,14,7),(120,'Dwarven Chainmail Chestplate',10350,15,7),(121,'Fig Leaf',48,1,8),(122,'Kilt',225,2,8),(123,'Majestic Gold Helm',585,3,8),(124,'Majestic Gold Gauntlets',990,4,8),(125,'Majestic Gold Boots',1575,5,8),(126,'Bracers',2250,6,8),(127,'Majestic Gold Greaves',2790,7,8),(128,'Majestic Gold Chestplate',3420,8,8),(129,'Majestic Gold Shield',4230,9,8),(130,'Gold-Threaded Cloak',5040,10,8),(131,'Enchanted Ruby Ring',5850,11,8),(132,'Enchanted Sapphire Ring',6840,12,8),(133,'Enchanted Jade Ring',8010,13,8),(134,'Enchanted Amethyst Ring',9000,14,8),(135,'Enchanted Diamond Ring',10350,15,8),(136,'Button',48,1,9),(137,'Elven Silk Nightclothes',225,2,9),(138,'Elven Silk Gloves',585,3,9),(139,'Elven Silk Slippers',990,4,9),(140,'Elven Silk Wristband',1575,5,9),(141,'Leggings',2250,6,9),(142,'Elven Silk Tunic',2790,7,9),(143,'Elven Silk Cloak',3420,8,9),(144,'Ring of Night',4230,9,9),(145,'Ring of Day',5040,10,9),(146,'Ring of Solitude',5850,11,9),(147,'Ring of Peace',6840,12,9),(148,'Ring of Courage',8010,13,9),(149,'Ring of Virtue',9000,14,9),(150,'Ring of Life',10350,15,9),(151,'Pegasus\' Hooded Cloak',5040,10,10),(152,'Pegasus\' Chestplate',4230,9,10),(153,'Pegasus\' Greaves',3420,8,10),(154,'Pegasus\' Boots',2790,7,10),(155,'Pegasus\' Gorget',2250,6,10),(156,'Pegasus\' Bracers',1575,5,10),(157,'Pegasus\' Gauntlets',990,4,10),(158,'Pegasus\' Helm',585,3,10),(159,'Platform Shoes',225,2,10),(160,'Leisure Suit',48,1,10),(161,'Pegasus Feather Pendant',5850,11,10),(162,'Pegasus Feather Belt',6840,12,10),(163,'Pegasus\' Emblazoned Shield',8010,13,10),(164,'Pegasus\' Emblazoned Ring',9000,14,10),(165,'Pegasus\' Emblazoned Crown',10350,15,10),(166,'New Clothes',48,1,11),(167,'Chicken Suit',225,2,11),(168,'Gauntlets of Grace',585,3,11),(169,'Bracer of Beauty',990,4,11),(170,'Helm of Health',1575,5,11),(171,'Greaves of Good Fortune',2250,6,11),(172,'Boots of Bravery',2790,7,11),(173,'Tunic of Tolerance',3420,8,11),(174,'Cloak of Confidence',4230,9,11),(175,'Ring of Righteousness',5040,10,11),(176,'Necklace of Narcissism',5850,11,11),(177,'Pendant of Power',6840,12,11),(178,'Breastplate of Benevolence',8010,13,11),(179,'Shield of Superiority',9000,14,11),(180,'Scepter of Strength',10350,15,11),(181,'Dragon Skin Leather Helm',48,1,12),(182,'Dragon Skin Leather Gauntlets',225,2,12),(183,'Dragon Skin Leather Boots',585,3,12),(184,'Dragon Skin Leather Bracers',990,4,12),(185,'Dragon Skin Leather Leggings',1575,5,12),(186,'Dragon Skin Leather Tunic',2250,6,12),(187,'Dragon Skin Leather Cloak',2790,7,12),(188,'Dragon Scale Helm',3420,8,12),(189,'Dragon Scale Gauntlets',4230,9,12),(190,'Dragon Scale Boots',5040,10,12),(191,'Dragon Scale Bracers',5850,11,12),(192,'Dragon Scale Greaves',6840,12,12),(193,'Dragon Scale Chestplate',8010,13,12),(194,'Dragon Scale Cloak',9000,14,12),(195,'Dragon Talon Shield',10350,15,12); +/*!40000 ALTER TABLE `armor` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `bans` +-- + +DROP TABLE IF EXISTS `bans`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bans` ( + `ipfilter` varchar(15) NOT NULL, + `uniqueid` varchar(32) NOT NULL, + `banexpire` datetime DEFAULT NULL, + `banreason` text NOT NULL, + `banner` varchar(50) NOT NULL, + `lasthit` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + KEY `banexpire` (`banexpire`), + KEY `uniqueid` (`uniqueid`), + KEY `ipfilter` (`ipfilter`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `bans` +-- + +LOCK TABLES `bans` WRITE; +/*!40000 ALTER TABLE `bans` DISABLE KEYS */; +/*!40000 ALTER TABLE `bans` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `clans` +-- + +DROP TABLE IF EXISTS `clans`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `clans` ( + `clanid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `clanname` varchar(255) NOT NULL, + `clanshort` varchar(5) NOT NULL, + `clanmotd` text DEFAULT NULL, + `clandesc` text DEFAULT NULL, + `motdauthor` int(11) unsigned NOT NULL DEFAULT 0, + `descauthor` int(11) unsigned NOT NULL DEFAULT 0, + `customsay` varchar(15) NOT NULL, + PRIMARY KEY (`clanid`), + KEY `clanname` (`clanname`), + KEY `clanshort` (`clanshort`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `clans` +-- + +LOCK TABLES `clans` WRITE; +/*!40000 ALTER TABLE `clans` DISABLE KEYS */; +/*!40000 ALTER TABLE `clans` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `commentary` +-- + +DROP TABLE IF EXISTS `commentary`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `commentary` ( + `commentid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `section` varchar(20) DEFAULT NULL, + `author` int(11) unsigned NOT NULL DEFAULT 0, + `comment` varchar(200) NOT NULL, + `postdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`commentid`), + KEY `section` (`section`), + KEY `postdate` (`postdate`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `commentary` +-- + +LOCK TABLES `commentary` WRITE; +/*!40000 ALTER TABLE `commentary` DISABLE KEYS */; +/*!40000 ALTER TABLE `commentary` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `companions` +-- + +DROP TABLE IF EXISTS `companions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `companions` ( + `companionid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `category` varchar(255) NOT NULL, + `description` text NOT NULL, + `attack` int(6) unsigned NOT NULL DEFAULT 1, + `attackperlevel` int(6) unsigned NOT NULL DEFAULT 0, + `defense` int(6) unsigned NOT NULL DEFAULT 1, + `defenseperlevel` int(6) unsigned NOT NULL DEFAULT 0, + `maxhitpoints` int(6) unsigned NOT NULL DEFAULT 10, + `maxhitpointsperlevel` int(6) unsigned NOT NULL DEFAULT 10, + `abilities` text NOT NULL, + `cannotdie` tinyint(4) NOT NULL DEFAULT 0, + `cannotbehealed` tinyint(4) NOT NULL DEFAULT 1, + `companionlocation` varchar(25) NOT NULL DEFAULT 'all', + `companionactive` tinyint(25) NOT NULL DEFAULT 1, + `companioncostdks` tinyint(4) NOT NULL DEFAULT 0, + `companioncostgems` int(6) NOT NULL DEFAULT 0, + `companioncostgold` int(10) NOT NULL DEFAULT 0, + `jointext` text NOT NULL, + `dyingtext` varchar(255) NOT NULL, + `allowinshades` tinyint(4) NOT NULL DEFAULT 0, + `allowinpvp` tinyint(4) NOT NULL DEFAULT 0, + `allowintrain` tinyint(4) NOT NULL DEFAULT 0, + PRIMARY KEY (`companionid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `companions` +-- + +LOCK TABLES `companions` WRITE; +/*!40000 ALTER TABLE `companions` DISABLE KEYS */; +INSERT INTO `companions` VALUES (1,'Mortimer teh javelin man','Knight','A rough and ready warrior. Beneath his hardened exterior, one can detect a man of strong honour.',5,2,1,2,20,20,'a:4:{s:5:\"fight\";s:1:\"1\";s:4:\"heal\";s:1:\"0\";s:5:\"magic\";s:1:\"0\";s:6:\"defend\";b:0;}',0,0,'Degolburg',1,0,4,573,'`^Greetings unto thee, my friend. Let us go forth and conquer the evils of this world together!','`4Argggggh! I am slain! Shuffling off my mortal coil. Fare thee well, my friends.',1,0,0),(2,'Florenz','Healer','With a slight build, Florenz is better suited as a healer than a fighter.',1,1,5,5,15,10,'a:4:{s:4:\"heal\";s:1:\"2\";s:5:\"magic\";s:1:\"0\";s:5:\"fight\";b:0;s:6:\"defend\";b:0;}',0,0,'Degolburg',1,0,3,1000,'Thank ye for thy faith in my skills. I shall endeavour to keep ye away from Ramius\' claws.','O Discordia!',1,0,0),(3,'Grizzly Bear','Wild Beasts','You look at the beast knowing that this Grizzly Bear will provide an effective block against attack with its long curved claws and massive body of silver-tipped fur.',1,2,5,2,25,25,'a:4:{s:5:\"fight\";s:1:\"0\";s:4:\"heal\";s:1:\"0\";s:5:\"magic\";s:1:\"0\";s:6:\"defend\";s:1:\"1\";}',0,0,'Qexelcrag',1,0,4,600,'You hear a low, deep belly growl coming from a shadowed corner of the Bestiarium. Curious you walk over to investigate your purchase. As you approach a large form shuffles on all four legs towards the front of its hewn rock enclosure.`n`nThe hunched shoulders of the largest bear you have ever seen ripple as its front haunches push against the ground causing it to stand on its hind legs. It makes another low growl before dropping back on all four legs to follow you on your adventure.','The grizzly gets scared by the multitude of blows and hits he has to take and flees into the forest.',1,0,0); +/*!40000 ALTER TABLE `companions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `creatures` +-- + +DROP TABLE IF EXISTS `creatures`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `creatures` ( + `creatureid` int(11) NOT NULL AUTO_INCREMENT, + `creaturename` varchar(50) DEFAULT NULL, + `creaturelevel` int(11) DEFAULT NULL, + `creatureweapon` varchar(50) DEFAULT NULL, + `creaturelose` varchar(120) DEFAULT NULL, + `creaturewin` varchar(120) DEFAULT NULL, + `creaturegold` int(11) DEFAULT NULL, + `creatureexp` int(11) DEFAULT NULL, + `creaturehealth` int(11) DEFAULT NULL, + `creatureattack` int(11) DEFAULT NULL, + `creaturedefense` int(11) DEFAULT NULL, + `creatureaiscript` text DEFAULT NULL, + `createdby` varchar(50) DEFAULT NULL, + `forest` tinyint(4) NOT NULL DEFAULT 0, + `graveyard` tinyint(4) NOT NULL DEFAULT 0, + `oldcreatureexp` int(11) DEFAULT NULL, + PRIMARY KEY (`creatureid`), + KEY `creaturelevel` (`creaturelevel`) +) ENGINE=InnoDB AUTO_INCREMENT=321 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `creatures` +-- + +LOCK TABLES `creatures` WRITE; +/*!40000 ALTER TABLE `creatures` DISABLE KEYS */; +INSERT INTO `creatures` VALUES (1,'Thieving Kender',1,'Whirling Hoopak','You only wish you could pickpocket your money back from the thief.',NULL,36,14,10,1,1,NULL,'Appleshiner',1,0,NULL),(2,'Rude Student',1,'Worn Textbook','You have sent this student to permanent detention.','',36,14,10,1,1,'','Appleshiner',1,0,NULL),(3,'Baby Unicorn',1,'Blunt Horn','You feel like a real jerk killing something so pretty.','',36,14,10,1,1,'','Appleshiner',1,0,NULL),(4,'Small Purple Mouse',1,'Lashing pink tail','It is written in black and white: this strange technicolor mouse is no more.','',36,14,10,1,1,'','Appleshiner',1,0,NULL),(5,'Grunting Piggy',1,'Wiggly Snout','Mmm...Bacon',NULL,36,14,10,1,1,NULL,'Appleshiner',1,0,NULL),(6,'Dumb Old Eyesore',2,'Nagging complaints','All she ever did was nag...nag...nag...',NULL,97,24,21,3,3,NULL,'Appleshiner',1,0,NULL),(7,'Pygmy Marmoset',2,'Pieces of treebark','The strange little monkey falls from the trees and lies still.',NULL,97,24,21,3,3,NULL,'Appleshiner',1,0,NULL),(8,'Burly Man',15,'Amazing Absorbency','Fantasize, fantasize about Burly ...Eeeh, Eeeh, Eeeh!',NULL,531,189,155,29,21,NULL,'Bluspring',1,0,NULL),(9,'Screaming Banshee',2,'Hauntingly Beautiful Voice','You plunge your weapon into her breast, silencing her song.','',97,24,21,3,3,'','Appleshiner',1,1,NULL),(10,'Ursa Minor',2,'Twinkling Lights','After an astronomical battle, Ursa Minor is the one seeing stars',NULL,97,24,21,3,3,NULL,'Appleshiner',1,0,NULL),(11,'Stone Troll',2,'Gaping Maw','That troll is stone cold ugly.',NULL,97,24,21,3,3,NULL,'Appleshiner',1,0,NULL),(12,'Slithering Asp',2,'Hypnotic eyes','You break the deadly gaze of the snake to save your own life.','',97,24,21,3,3,'','Appleshiner',1,0,NULL),(13,'Windan The Barbarian',2,'Feathered Spear','He really was just a feather-weight',NULL,97,24,21,3,3,NULL,'Appleshiner',1,0,NULL),(14,'Studious Young Sorceror',2,'Newly memorized spells','Perhaps she should have studied harder.','',97,24,21,3,3,'','Appleshiner',1,0,NULL),(15,'Four and Twenty Blackbirds',3,'Freshly Baked Pies','Now isn\'t this a dainty dish to set before a king?',NULL,148,34,32,5,4,NULL,'Appleshiner',1,0,NULL),(16,'Amazon',3,'Bow and Arrow','The beautiful warrior lass has lost a battle for the first time.',NULL,148,34,32,5,4,NULL,'Appleshiner',1,0,NULL),(17,'Overbearing Mother',3,'9pm Curfew','With one fell swoop you save your social life!','',148,34,32,5,4,'','Appleshiner',1,0,NULL),(18,'Huge Bald Programmer',3,'Shining Forehead','You feel as if you have seen this man before in the village.','',148,34,32,5,4,'','Appleshiner',1,0,NULL),(19,'Someone\'s Grandfather',3,'Stories that go nowhere','This reminds you of the time you needed a new heel for your shoe.','',148,34,32,5,4,'','Appleshiner',1,0,NULL),(20,'Juvenile Delinquent',3,'Poor Attitude','With a satisfying thump, you knock the smirk right off his face.','',148,34,32,5,4,'','Appleshiner',1,0,NULL),(21,'Beautiful Woodland Sprite',3,'Kindness and tranquility','You really cut that wood sprite down to size.','',148,34,32,5,4,'','Appleshiner',1,0,NULL),(22,'Society Belle',3,'Southern Charm','Now she will never be on time for the ball!',NULL,148,34,32,5,4,NULL,'Appleshiner',1,0,NULL),(23,'Giant Goldfish Cracker',3,'Annoying Commercial Jingles','Now *there* is a fish that smiled till you bit his head off.',NULL,148,34,32,5,4,NULL,'Appleshiner',1,0,NULL),(24,'Angry Mob',4,'Torches','There is no justice for an angry mob.','',162,45,43,7,6,'','Appleshiner',1,0,NULL),(25,'Polar Bear',4,'Terrible claws','That bear really needed an attitude adjustment.','',162,45,43,7,6,'','Appleshiner',1,0,NULL),(26,'Decaying Skeleton',4,'Rusty Sword','His leg ought to make a good toy for your dog.',NULL,162,45,43,7,6,NULL,'Appleshiner',1,1,NULL),(27,'Willie the Wonder Hampster',4,'Nuclear Sunflower Seeds','You smile a grim smile at Willie and quietly munch on some seeds.','',162,45,43,7,6,'','Appleshiner',1,0,NULL),(28,'Winged Demon Of Death',4,'Red Glare','You cut off the Demon\'s head, to be sure of its death.',NULL,162,45,43,7,6,NULL,'foilwench',1,1,NULL),(29,'Small Dragon',4,'Hot air','For one moment you thought THIS was the Green Dragon, but alas not.',NULL,162,45,43,7,6,NULL,'Appleshiner',1,0,NULL),(30,'Monstrous Dustbunny',4,'Sneezing fits','You sweep the poor bunny under the rug when no one is looking.','',162,45,43,7,6,'','Appleshiner',1,0,NULL),(31,'Small Rabbit',4,'Sharp Pointy Teeth','To think you almost ran away!',NULL,162,45,43,7,6,NULL,'Appleshiner',1,0,NULL),(32,'Mature Unicorn',5,'Powerful Horn','A unicorn is a thing of beauty, even in death.','',198,55,53,9,7,'','Appleshiner',1,0,NULL),(33,'Gnome Necromancer',5,'Skeleton Familiar','Once you killed its familiar that Gnome was really weak.',NULL,198,55,53,9,7,NULL,'Appleshiner',1,1,NULL),(34,'Purple Dinosaur',5,'Helpful Nature','There seems to be a person inside that strange dino. You wonder why.',NULL,198,55,53,9,7,NULL,'Appleshiner',1,0,NULL),(35,'Orc Emmisary',5,'Diplomacy','You never were the diplomatic type.',NULL,198,55,53,9,7,NULL,'Appleshiner',1,0,NULL),(36,'Dark Spiritling',5,'Dark Magic','The spiritling gasps a final breath as you end its pitiful life.','',198,55,53,9,7,'','Appleshiner',1,1,NULL),(37,'Enchanted Toilet',5,'Ninja Flushing Action','That was just weird.','',198,55,53,9,7,'','Appleshiner',1,0,NULL),(38,'Giant Water Elemental',5,'Torrential Downpours','The giant creature is reduced a meager spring shower.','',198,55,53,9,7,'','Appleshiner',1,0,NULL),(39,'Violins',5,'Off-Key notes','Won\'t someone PLEASE stop the violins?',NULL,198,55,53,9,7,NULL,'Appleshiner',1,0,NULL),(40,'Whirled Peas',5,'Green Slime','We should all pray for whirled peas.',NULL,198,55,53,9,7,NULL,'Appleshiner',1,0,NULL),(41,'Magic Mushroom',6,'Swirling Colors','Guess you don\'t need to go ask Alice now.','',234,66,64,11,8,'','Appleshiner',1,0,NULL),(42,'Invisible Man',6,'Something Invisible and Sharp','You really aren\'t sure if it is dead, or just hiding...after all it is invisible.','',234,66,64,11,8,'','Appleshiner',1,0,NULL),(43,'Clown of Death',6,'Balloon Animals from Beyond','You give the clown\'s nose a honk just for fun before you leave.','',234,66,64,11,8,'','Appleshiner',1,1,NULL),(44,'Heart of Stone',6,'Unromantic Thoughts','Aww, now look, you broke its heart!',NULL,234,66,64,11,8,NULL,'Appleshiner',1,0,NULL),(45,'Troll Warrior',6,'Steel Broadsword','Wow, he smelled bad enough alive, can you imagine how he\'ll smell tomorrow?',NULL,234,66,64,11,8,NULL,'Appleshiner',1,0,NULL),(46,'Bettie the Amazing Kung-Fu Butterfly',6,'Stupendous Kung-Fu Wings','You survived a battle to the death with a butterfly. You must be so proud.',NULL,234,66,64,11,8,NULL,'Appleshiner',1,0,NULL),(47,'Golden Goose',6,'14 Karat Gold Eggs','You have slain the goose but it is too heavy to take back to town. All that wealth wasted.',NULL,234,66,64,11,8,NULL,'Appleshiner',1,0,NULL),(48,'Black Tiger',6,'Claws','You ponder the tiger\'s body thinking what a good rug it might make.','',234,66,64,11,8,'','Appleshiner',1,0,NULL),(49,'Lambert the Sheepish Lion',6,'Timid Growling','You marched in like a lion and he died like a lamb.','',234,66,64,11,8,'','Appleshiner',1,0,NULL),(50,'Marsha of the Jungle',7,'Trained Monkeys','Poor Marsha, she thought those monkeys were better trained.','',268,77,74,13,10,'','Appleshiner',1,0,NULL),(51,'Moe',7,'Two Knives','Maybe those knives weren\'t so great.','',268,77,74,13,10,'','Appleshiner',1,0,NULL),(52,'Coffin',7,'Terrifying Premonitions','Best way to get rid of the coffin is Robitussin.',NULL,268,77,74,13,10,NULL,'Appleshiner',1,1,NULL),(53,'Green Alligator',7,'Crushing Jaws','Crikey! That thing could have killed you!',NULL,268,77,74,13,10,NULL,'foilwench',1,0,NULL),(54,'Lindsey, Daughter of Erin the Ninja Squirrel',7,'A Peanut Shooter','All these squirrels are nuts.','',268,77,74,13,10,'','Appleshiner',1,0,NULL),(55,'Wizarding School Senior Student',7,'Memory Charm','Drat! He took your memory before you killed him. Who are you anyway?',NULL,268,77,74,13,10,NULL,'Appleshiner',1,0,NULL),(56,'Enchanted Laundry Basket',7,'Stinky Socks of Terror','So that\'s what happens to lost socks!',NULL,268,77,74,13,10,NULL,'Appleshiner',1,0,NULL),(57,'Carrot Top',7,'Phone Company Slogans','That has got to be the most satisfying kill you ever made.',NULL,268,77,74,13,10,NULL,'Appleshiner',1,0,NULL),(58,'Macintosh Computer',7,'Amazingly Bright Colors','So THAT\'S what happens when you right-click a Mac.',NULL,268,77,74,13,10,NULL,'Appleshiner',1,0,NULL),(59,'Interior Designer',8,'Color-coordinating Sword and Shield','You didn\'t like his style.','',302,89,84,15,11,'','Appleshiner',1,0,NULL),(60,'Daughter of the Devil',8,'Sinfully Good Looks','She is the girl your mom always warned you about.',NULL,302,89,84,15,11,NULL,'Appleshiner',1,1,NULL),(61,'Wild Horses',8,'Dragging','I guess the saying is true, wild horses can\'t drag you away.','',302,89,84,15,11,'','Appleshiner',1,0,NULL),(62,'Steam Elemental',8,'Scalding jets of air','There was just enough steam left to make an espresso.','',302,89,84,15,11,'','foilwench',1,0,NULL),(63,'Gordon the Cheese Eater',8,'Odiferous Nature','You sure cut that cheese....eater.','',302,89,84,15,11,'','Appleshiner',1,0,NULL),(64,'Narcoleptic',8,'Drowsiness','This narcoleptic won\'t be waking up anytime soon.','',302,89,84,15,11,'','Appleshiner',1,0,NULL),(65,'Swarm of Bees',8,'Stinging','You feel like a pincushion, but you are alive.','',302,89,84,15,11,'','Appleshiner',1,0,NULL),(66,'Halfling Mage',8,'Painful Spells','That fight wasn\'t half as difficult as you thought it would be.','',302,89,84,15,11,'','Appleshiner',1,0,NULL),(67,'Citizen of Eythgim Village',9,'Slurs','Geeze, what did you ever do to him?',NULL,336,101,94,17,13,NULL,'Appleshiner',1,0,NULL),(68,'Old Hag',9,'Red Red Rose','It is her turn to sleep an enchanted sleep.','',336,101,94,17,13,'','Appleshiner',1,0,NULL),(69,'Charging Buffalo',9,'Stampeding Hoofs','Do you know how to stop a charging buffalo? Take away his credit card!',NULL,336,101,94,17,13,NULL,'Appleshiner',1,0,NULL),(70,'Pawn',9,'Simple Tactics','Well, that was a bad move.','',336,101,94,17,13,'','Appleshiner',1,0,NULL),(71,'Romulan',9,'Wrong-Genre Confusion','You think to yourself they look tougher on TV.','',336,101,94,17,13,'','Appleshiner',1,0,NULL),(72,'Large Griffon',9,'Beak and Claws','The mythical creature is no more.','',336,101,94,17,13,'','Appleshiner',1,0,NULL),(73,'Cliche Bond Movie Villain',9,'Cell-phone of Death','Well, really, who throws a cell phone? I mean, that really, really hurt!','',336,101,94,17,13,'','Appleshiner',1,0,NULL),(74,'Fuzzy Ferret',9,'Disarming Cuteness','Who knew ferrets were so violent!',NULL,336,101,94,17,13,NULL,'Appleshiner',1,0,NULL),(75,'Starving Artist',9,'Pointy Paintbrushes','This guy really painted himself into a corner.','',336,101,94,17,13,'','Appleshiner',1,0,NULL),(76,'Guard from Eythgim Village',10,'Rapier','The people from that village seem angry!',NULL,369,114,105,19,14,NULL,'Appleshiner',1,0,NULL),(77,'Garden Gnome',10,'Painful Tackiness','Stupid garden gnomes. What are they doing in the forest anyway?','',369,114,105,19,14,'','Appleshiner',1,0,NULL),(78,'Chicken',10,'Squawking','Good fortune smiles upon you - you will eat well tonight.','',369,114,105,19,14,'','foilwench',1,0,NULL),(79,'Marksman',10,'Deadly Aim','He took so long to aim, you just walked up and kicked him.','',369,114,105,19,14,'','Appleshiner',1,0,NULL),(80,'Enchanted Tissue Box',10,'Cold Germs','You pick up the box and put it in your pocket. You never know when a tissue might come in handy.','',369,114,105,19,14,'','Appleshiner',1,0,NULL),(81,'Ghostly Woodsman',10,'Phantom Axe','You aren\'t sure how you did it, but you killed something that was already dead. Good for you.',NULL,369,114,105,19,14,NULL,'Appleshiner',1,1,NULL),(82,'Zombie',10,'Rotting Flesh','He really went to pieces, didn\'t he?',NULL,369,114,105,19,14,NULL,'foilwench',1,0,NULL),(83,'Fortula the Plains Cat',10,'Claws and Teeth','That plains cat is now plain dead.','',369,114,105,19,14,'','Appleshiner',1,0,NULL),(84,'Erin the Ninja Squirrel',10,'Acorn Tossing Madness','That squirrel was a little crazy.','',369,114,105,19,14,'','Appleshiner',1,0,NULL),(85,'Bluebird of Happiness',11,'Uplifting Melody','Happiness is over-rated anyway.','',402,127,115,21,15,'','Appleshiner',1,0,NULL),(86,'Potato Newscaster',11,'Personal Opinions','It\'s ok, he was just a common \'tater.','',402,127,115,21,15,'','Appleshiner',1,0,NULL),(87,'Pygmy Dragon',11,'Fire Breath','You hope he wasn\'t a relative of the Green Dragon.','',402,127,115,21,15,'','Appleshiner',1,0,NULL),(88,'Zealous Photographer',11,'Flashing Lights','The things beautiful people have to put up with.',NULL,402,127,115,21,15,NULL,'Appleshiner',1,0,NULL),(89,'Gary Larson',11,'Strange Cartoons','You still don\'t get it.',NULL,402,127,115,21,15,NULL,'Appleshiner',1,0,NULL),(90,'Soldier from Eythgim Village',11,'Battle Cry','Eythgim seems to be waging a personal war with you.','',402,127,115,21,15,'','Appleshiner',1,0,NULL),(91,'80\'s Glam Rocker',11,'Blinding Makeup','You know your motto, Live and let die.',NULL,402,127,115,21,15,NULL,'Appleshiner',1,0,NULL),(92,'Vigilante',11,'Sack of Doorknobs','This carnage disgusts you.','',402,127,115,21,15,'','Appleshiner',1,0,NULL),(93,'The Devil',11,'Eternal Damnation','For being the Devil, he really wasn\'t so hot.',NULL,402,127,115,21,15,NULL,'Appleshiner',1,1,NULL),(94,'Mercenary',12,'Blood-chilling Stare','You could use an ale.','',435,141,125,23,17,'','Appleshiner',1,0,NULL),(95,'Magic Mirror',12,'Flattering Remarks','Mirror, Mirror, on the Ground, it is your death that you have found.',NULL,435,141,125,23,17,NULL,'Appleshiner',1,0,NULL),(96,'Broadway Extra',12,'Memorable Showtunes','This extra is really on her own now.','',435,141,125,23,17,'','Appleshiner',1,0,NULL),(97,'Butter the Sprite',12,'Magic Pixie Dust','Butter? What kind of a name is Butter?',NULL,435,141,125,23,17,NULL,'Appleshiner',1,0,NULL),(98,'Father Time',12,'Old Age','Your victory is not comforting. You know he will still catch up to you.','',435,141,125,23,17,'','Appleshiner',1,0,NULL),(99,'Eythgim Village Archers',12,'Flaming Arrows','The tree is burning, you\'d better try to put it out.',NULL,435,141,125,23,17,NULL,'foilwench',1,0,NULL),(100,'Animate Stormcloud',12,'Lightning','The storm is no more. You can see the light of day peeking through the last of the clouds.','',435,141,125,23,17,'','Appleshiner',1,0,NULL),(101,'Three Toed Sloth',12,'Slow Responses','Your swift moves were too fast for this sloth.','',435,141,125,23,17,'','Appleshiner',1,0,NULL),(102,'Death',12,'Cold Grasp','There it is! Death!!!!!',NULL,435,141,125,23,17,NULL,'Appleshiner',1,1,NULL),(103,'Cerberus',13,'Three Drooling Maws','Each one\'s breath was worse than the last.','',467,156,135,25,18,'','Appleshiner',1,1,NULL),(104,'Man from deep, deep, dark, dark, deep, dark woods',13,'Snarling and Biting','The creature from the deep, deep, dark, dark, deep, dark woods is finally dead.','',467,156,135,25,18,'','Appleshiner',1,0,NULL),(105,'Devil in a Blue Dress',13,'Alluring Promises','You really prefer black dresses anyway.','',467,156,135,25,18,'','Appleshiner',1,1,NULL),(106,'Giant',13,'Smashing Club','Geeze, he almost fell on you!',NULL,467,156,135,25,18,NULL,'Appleshiner',1,0,NULL),(107,'Commander of the Eythgim Army',13,'Winning Tactics','You have bested their army by killing its master.',NULL,467,156,135,25,18,NULL,'Appleshiner',1,0,NULL),(108,'Ice Dragon',13,'Frost Breath','You defeated him, but caught a cold.',NULL,467,156,135,25,18,NULL,'Appleshiner',1,0,NULL),(109,'Pushmi Pullyew',13,'Conflictory Arguments','That strange creature couldn\'t tell if it was coming or going.',NULL,467,156,135,25,18,NULL,'Appleshiner',1,0,NULL),(110,'Whale',13,'Tail','You know Violet isn\'t going to believe a Whale attacked you in the forest.','',467,156,135,25,18,'','Appleshiner',1,0,NULL),(111,'Gorma The Leper',13,'Contagious Disease','It looks like the leper\'s fighting strategy has fallen apart...',NULL,467,156,135,25,18,NULL,'foilwench',1,0,NULL),(112,'Samurai Master',14,'Daisho','You bow to the fallen master before you walk away.','',499,172,145,27,20,'','Appleshiner',1,0,NULL),(113,'Bartender',14,'Duck','That\'s not a Duck! It\'s a Chicken!',NULL,499,172,145,27,20,NULL,'Appleshiner',1,0,NULL),(114,'Prince of Eythgim Village',14,'Bribes of Gold','You are not easily bribed, and he was a mortal enemy.','',499,172,145,27,20,'','Appleshiner',1,0,NULL),(115,'Loch Ness Monster',14,'Shocking Appearance','Why in the world would that monster be in this forest. You must have been dreaming!','',499,172,145,27,20,'','Appleshiner',1,0,NULL),(116,'Fuzzie Wuzzie',14,'Male Pattern Baldness','Fuzzie Wuzzie wasn\'t very fuzzie, was he?',NULL,499,172,145,27,20,NULL,'Appleshiner',1,0,NULL),(117,'Princess of Eythgim Village',15,'Beguiling Words','She tried to tempt you, but you resisted.',NULL,531,189,155,29,21,NULL,'Appleshiner',1,0,NULL),(118,'Ugly Harpy',14,'Poisonous Breath','Her breath was worse than her bite.','',499,172,145,27,20,'','Appleshiner',1,1,NULL),(119,'Field Mouse',14,'Chewing','That was some powerful mouse!',NULL,499,172,145,27,20,NULL,'Appleshiner',1,0,NULL),(120,'Monarch of Eythgim Village',16,'Royal Commands','I guess this makes you king of their Village.',NULL,563,207,166,31,22,NULL,'Appleshiner',1,0,NULL),(121,'Cyclops Warrior',15,'Fire Eye','The dead Cyclops\' one eye stares at you blankly.',NULL,531,189,155,29,21,NULL,'foilwench',1,0,NULL),(122,'Cupid',15,'Pink Arrows of Love','You have slain Cupid. You shall never find true love.','',531,189,155,29,21,'','Appleshiner',1,0,NULL),(123,'Tabloid Writer',15,'Far-fetched Stories','If you ask me, SHE was the six-armed alien who gave birth to the world\'s largest infant Elvis impersonator.','',531,189,155,29,21,'','Appleshiner',1,0,NULL),(124,'Evil Wizard',15,'Tormented Souls','You have set the tortured souls free.','',531,189,155,29,21,'','Appleshiner',1,0,NULL),(125,'Artemis, Goddess of the Hunt',15,'Winged Stags','The moon itself shall weep for the slain Artemis.','',531,189,155,29,21,'','Appleshiner',1,0,NULL),(126,'Centaur Archer',15,'Deadly Marksmanship','The twisted man-beast lies still.','',531,189,155,29,21,'','Appleshiner',1,0,NULL),(127,'Mime',15,'Something Imaginary','His death is a rather sad charade.','',531,189,155,29,21,'','Appleshiner',1,0,NULL),(128,'Chili Chef',15,'Insanity Peppers','Man, that\'s good chili!','',531,189,155,29,21,'','Appleshiner',1,0,NULL),(129,'Brownie',16,'Miniscule weapons','The tiny warrior dies with a faint squeal.','',563,207,166,31,22,'','Appleshiner',1,0,NULL),(130,'Darkness',16,'Self-induced Terror','You are afraid of the dark no longer.','',563,207,166,31,22,'','Appleshiner',1,1,NULL),(131,'Mountain King',16,'God-like Fury','The King has died, long live the King!','',563,207,166,31,22,'','Appleshiner',1,0,NULL),(134,'Loneliness',17,'Silence','What is the sound of one hand clapping?','What is the sound of one hand clapping?',36,0,1,0,0,NULL,NULL,1,0,NULL),(135,'Loneliness',18,'Silence','What is the sound of one hand clapping?','What is the sound of one hand clapping?',0,0,1,0,25,NULL,NULL,1,0,NULL),(136,'Le Chat dans le chapeau',15,'Rhyming Nonsense','In spanish, El Gato en el sombrero.','',531,189,155,29,21,'','Appleshiner',1,0,NULL),(138,'Whopper With Cheese',8,'Abundant Cholesterol','This is one whopper that won\'t show up on your hips tomorrow.',NULL,302,89,84,15,11,NULL,'foilwench',1,0,NULL),(139,'Swarming Ladybugs',3,'Stinking Residue','Those Ladybugs weren\'t very ladylike.',NULL,148,34,32,5,4,NULL,'foilwench',1,0,NULL),(140,'Football Fan',6,'Raucous Cheers','This fan doesn\'t have much to cheer about.',NULL,234,66,64,11,8,NULL,'foilwench',1,0,NULL),(141,'King Agrippa',13,'Flaming Wingnuts','As you stare at his smoking corpse, you marvel at the ineffectiveness of flaming wingnuts.',NULL,467,156,135,25,18,NULL,'foilwench',1,0,NULL),(142,'Cherubically Charming Child',1,'Curious Questions','You think it was the alliteration that did him in.',NULL,36,14,10,1,1,NULL,'foilwench',1,0,NULL),(143,'Haberdasher',5,'Heavy Hat','Hats have gone out of style anyway.',NULL,198,55,53,9,7,NULL,'foilwench',1,0,NULL),(144,'Rush Hour Driver',11,'Road Rage','It was a no-win situation, speeding on these forest paths. The driver had it coming.',NULL,402,127,115,21,15,NULL,'foilwench',1,0,NULL),(145,'Sorority Girl in Nightie',7,'Pillow Fighting Action','It\'s too bad she\'s dead... you liked her action.','',268,77,74,13,10,'','foilwench',1,0,NULL),(146,'Ulysses Wulfgang',14,'Ridiculous Lies','Death to lies! Death to Ulysses Wulfgang!','',499,172,145,27,20,'','Joe',1,0,NULL),(147,'Crazy Audrey',9,'Ravenous Kittens','With a well placed stomp, Audrey and the kittens are no more.',NULL,336,101,94,17,13,NULL,'Appleshiner',1,0,NULL),(148,'Shining Happy People',5,'Hand Holding Terror','They just wanted to be your friend. You meanie.',NULL,198,55,53,9,7,NULL,'foilwench',1,0,NULL),(149,'Elsabutt',8,'Gravitational Pull','This is indeed a grave situation.','',302,89,84,15,11,'','foilwench',1,0,NULL),(150,'Mr. Bear',2,'Overwhelming Sleepiness','Mr. Bear was too tired to finish playing with you and went back to napping.','',97,24,21,3,3,'','foilwench',1,0,NULL),(151,'Everquest Junkie',12,'1337 Sp34k','D00d U pwned that guy!',NULL,435,141,125,23,17,NULL,'foilwench',1,0,NULL),(152,'Little Cocobean',4,'Her Special Roast','She really made your heart race and pound, but now she has crumbled to the ground',NULL,162,45,43,7,6,NULL,'Appleshiner',1,0,NULL),(153,'Humongous Hairball',5,'Incredible Drain-Clogging Power','The hairball and all its accompanying gook have been washed out to sea!',NULL,198,55,53,9,7,NULL,'foilwench',1,0,NULL),(154,'Iron Chef',4,'Sizzling Eel Flambe!','You have rendered the Chef Ironless! He\'s now simply a copper/tin alloy!',NULL,162,45,43,7,6,NULL,'foilwench',1,0,NULL),(155,'The Government',7,'Taxes','That\'s a tax return you\'ll be taking to the bank!',NULL,268,77,74,13,10,NULL,'Bluspring',1,0,NULL),(156,'Bar Fly',1,'Alcoholism','Good thing you got him before cirrhosis did!',NULL,36,14,10,1,1,NULL,'Bluspring',1,0,NULL),(157,'Methane Man',7,'Unfriendly Gasses','Must have been that bean he ate!',NULL,268,77,74,13,10,NULL,'foilwench',1,0,NULL),(158,'Wooly Mammoth',8,'Wildebeest Sidekick','You climb atop the Mammoth\'s remains and declare yourself king (or queen) for a day!',NULL,302,89,84,15,11,NULL,'foilwench',1,0,NULL),(159,'Nasty Nevin',10,'Bossy Mom','Wrecked\'em? Darn near killed \'em!',NULL,369,114,105,19,14,NULL,'Joe',1,0,NULL),(160,'The Gar Man',3,'Jar of Cotton Balls','There is but one Gar Man! And now he\'s just fluff!','',148,34,32,5,4,'','foilwench',1,0,NULL),(161,'Hiker',1,'Walking Stick','His last words were \"...I must protect the dragon.\"','',36,14,10,1,1,'','Appleshiner',1,0,NULL),(162,'Camper',2,'Marshmallow-roasting Stick','With her dying breath she gasps \"...and I never saw the dragon.\"',NULL,97,24,21,3,3,NULL,'Appleshiner',1,0,NULL),(163,'Forest Ranger',3,'Hunting Rifle','In his pack you find a copy of \"Dragon Seeking for Dummies.\"','',148,34,32,5,4,'','Appleshiner',1,0,NULL),(164,'Tree-Hugger',4,'Propaganda Leaflets','The leaflet reads \"Who Will Protect The Helpless Dragon?\"','',162,45,43,7,6,'','Appleshiner',1,0,NULL),(165,'Forest Dwelling Hermit',5,'Hand-Made Sling','He speaks only these words as he dies: \"You must leave the Dragon\'s Forest.\"',NULL,198,55,53,9,7,NULL,'Appleshiner',1,0,NULL),(166,'Member of Dragon Lovers Anonymous',6,'Stuffed Dragon Toy','When one wears a pin saying \"Dragon Lovers Anonymous\" they really are not as anonymous as they might think.','',234,66,64,11,8,'','Appleshiner',1,0,NULL),(167,'Initiate Dragon Watcher',7,'Binoculars','All he could say was \"Shhh, you are scaring the dragons!\"',NULL,268,77,74,13,10,NULL,'Appleshiner',1,0,NULL),(168,'Dragon Watcher, Junior Class',8,'Annoyance','You find a dragon-watching textbook in his backpack.',NULL,302,89,84,15,11,NULL,'Appleshiner',1,0,NULL),(169,'Dragon-watcher Senior Class',9,'Spelunking Equipment','You find a copy of \"Cave-Dwelling Dragons, and Where to Find Them\" in his pack.','',336,101,94,17,13,'','Appleshiner',1,0,NULL),(170,'Master Dragon Watcher',10,'Stealth','You wonder who watches the watchers.','',369,114,105,19,14,'','Appleshiner',1,0,NULL),(171,'Initiate Dragon Tamer',11,'10-foot dragon pole','Good thing for you that pole only works on 10-foot dragons!',NULL,402,127,115,21,15,NULL,'Appleshiner',1,0,NULL),(172,'Junior Dragon Tamer',12,'Large Whip','If he cannot tell the difference between you and a dragon, he has much work to do.','',435,141,125,23,17,'','Appleshiner',1,0,NULL),(173,'Senior Dragon Tamer',13,'Very Large Hoop','You regret killing him. You wanted to see him make a dragon jump through that hoop.','',467,156,135,25,18,'','Appleshiner',1,0,NULL),(174,'Master Dragon Tamer',14,'Tame Dragon','Once you killed the master, the dragon ran away',NULL,499,172,145,27,20,NULL,'Appleshiner',1,0,NULL),(175,'Dragon Rider in Training',15,'Mechanical Bull','They learn to ride dragons using a mechanical bull?',NULL,531,189,155,29,21,NULL,'Appleshiner',1,0,NULL),(176,'Dragon Rider',16,'Flying Dragon','A well-aimed strike grounds the flying dragon and his rider.','',563,207,166,31,22,'','Appleshiner',1,0,NULL),(177,'Batling',1,'Tiny flapping wings','Silly batling!','',36,14,10,1,1,'','Appleshiner',1,1,NULL),(178,'Small Bat',2,'Slightly venomous fangs','The small mammal falls to the ground lifeless.','',97,24,21,3,3,'','Appleshiner',1,1,NULL),(179,'Medium Sized Bat',3,'Screeching Cries','You killed it just to shut it up.',NULL,148,34,32,5,4,NULL,'Appleshiner',1,1,NULL),(180,'Large Bat',4,'Guano','You feel the need to take a bath.','',162,45,43,7,6,'','Appleshiner',1,1,NULL),(181,'Giant Bat',5,'Clinging and Biting','Why do movie bats always fly at people\'s hair?',NULL,198,55,53,9,7,NULL,'Appleshiner',1,1,NULL),(182,'Vampire Batling',6,'Pricking teeth','He resembled a mosquito more than a vampire bat.','',234,66,64,11,8,'','Appleshiner',1,1,NULL),(183,'Small Vampire Bat',7,'Deadly Fangs','You kick at the annoying pest as it lies on the ground.','',268,77,74,13,10,'','Appleshiner',1,1,NULL),(184,'Medium Sized Vampire Bat',8,'Echoing Sounds','Who decides that this bat is a \"Medium\"? Maybe he is a giant bat who hasn\'t bloomed yet.',NULL,302,89,84,15,11,NULL,'Appleshiner',1,1,NULL),(185,'Huge Vampire Bat',9,'Blood-Sucking','You gave more blood to the Red Cross.','',336,101,94,17,13,'','Appleshiner',1,1,NULL),(186,'Vampire in Bat Form',10,'Bad Romanian Accent','\"I vant to suk your blooood!\"',NULL,369,114,105,19,14,NULL,'Appleshiner',1,1,NULL),(187,'Vampire-Bat Prince',11,'Death Grip','You thought bats were Republicans.','',402,127,115,21,15,'','Appleshiner',1,1,NULL),(188,'Vampire Bat King',12,'Red Eyes','You decide to leave before the rest of the bats come to find their king.','',435,141,125,23,17,'','Appleshiner',1,1,NULL),(189,'Sorcerous Vampire',13,'Petrifying Spells','A cold shiver goes down your spine. You would rather be with Violet.','',467,156,135,25,18,'','Appleshiner',1,1,NULL),(219,'Seductive Vampiress',14,'Sultry Moves','It was a shame to kill her.',NULL,499,172,145,27,20,NULL,'Appleshiner',1,1,NULL),(220,'Frenzied vampire bats',15,'Numerous attacks','Why are there so many darn bats in this forest?',NULL,531,189,155,29,21,NULL,'Appleshiner',1,1,NULL),(221,'Vampirus,the Bat God',16,'Godly Power','You are even more god-like then he!','',563,207,166,31,22,'','Appleshiner',1,1,NULL),(222,'Old Man Winter',9,'Bitter Cold','You shake your fist over his dead, pathetic corpse.',NULL,336,101,94,17,13,NULL,NULL,1,0,NULL),(223,'Deranged Gnome',1,'A Cloth Draped Mirror','What happens when I do THIS?',NULL,36,14,10,1,1,NULL,NULL,1,0,NULL),(224,'Water Sprite',1,'Burst of Water','That was refreshing.',NULL,36,14,10,1,1,NULL,NULL,1,0,NULL),(225,'Water Nymph',3,'A torrent of water','I didn\'t need a bath, thank you.',NULL,148,34,32,5,4,NULL,NULL,1,0,NULL),(226,'Lady of the Lake',10,'Excalibur','Take that, you watery tart!',NULL,369,114,105,19,14,NULL,NULL,1,0,NULL),(227,'Cunning Sapling',1,'Arrrr!','Ah Ha! A toothpick!',NULL,36,14,10,1,1,NULL,NULL,1,0,NULL),(228,'Pirate Tree',5,'A loud ARRRRR!','Arrrrrr! indeed.',NULL,198,55,53,9,7,NULL,NULL,1,0,NULL),(229,'Undead Centurion',5,'Bronze Spear','Hmm Not too good at combat the second time around, either.',NULL,198,55,53,9,7,NULL,NULL,1,1,NULL),(230,'Insane Bard',2,'Iambic Pentameter','Slings and Arrows of outrageous fortune? Nope. Just the can o\' Whoopass.',NULL,97,24,21,3,3,NULL,NULL,1,0,NULL),(231,'Twig Man',1,'Brambles and Briars','I snapped him like a.. well, twig.',NULL,36,14,10,1,1,NULL,'Hank',1,0,NULL),(232,'Rabid Mouse',1,'Little Bitty Teeth','Those little teeth HURT!',NULL,36,14,10,1,1,NULL,'Hank',1,0,NULL),(233,'Stray Cat',1,'A Midnight Serenade','Finally! Peace in the night!',NULL,36,14,10,1,1,NULL,'Hank',1,0,NULL),(234,'Big Hairy Spider',1,'Sticky stringy webs','I *HATE* spiders!',NULL,36,14,10,1,1,NULL,'Hank',1,0,NULL),(235,'Goblin Lackey',1,'Dull Knife','Who knew goblins had lackeys?',NULL,36,14,10,1,1,NULL,'Hank',1,0,NULL),(236,'Crazy Chihuahua',1,'Fast food cravings','Here taco, taco, taco.','',36,14,10,1,1,'','Hank',1,0,NULL),(237,'Looney Rabbit',1,'Wisecracks','Th- Th- That\'s all folks!',NULL,36,14,10,1,1,NULL,'Hank',1,0,NULL),(238,'Undead Oarsman',1,'Rotten Oar','Funny... I didn\'t see any water around here.','',36,14,10,1,1,'','Hank',1,1,NULL),(239,'Lost Ghostling',2,'Sad Weeping','Well, I\'m sure that helped him on his way...','',97,24,21,3,3,'','Hank',1,0,NULL),(240,'Angry Titmouse',2,'Incessant Chattering','You swat the little bird out of the air with little effort.','',97,24,21,3,3,'','Hank',1,0,NULL),(241,'Fabianist Youth Member',2,'Marxist Doctrine','Socialize THAT.',NULL,97,24,21,3,3,NULL,'Hank',1,0,NULL),(242,'Little Bogeyman',2,'Noises in the Dark','Hmm, not so scary when you have grown up...','',97,24,21,3,3,'','Hank',1,0,NULL),(243,'Big Bogeyman',3,'Fingers poking you as you sleep.','Ok... that was weird. But not scary... Nope not at all... I think I\'ll leave the light on at the inn tonight though.','',148,34,32,5,4,'','Hank',1,0,NULL),(244,'Coblynau',2,'Ill tempered tricks','Maybe I better leave him part of my lunch next time.','',97,24,21,3,3,'','Hank',1,0,NULL),(245,'Jack O\'Lantern',2,'Eternal Wandering','The light has gone out of his life.',NULL,97,24,21,3,3,NULL,'Hank',1,0,NULL),(246,'Fresh Ghoul',2,'Long Pointed Nails','You leave him to the mercies of the other ghouls.','',97,24,21,3,3,'','Hank',1,1,NULL),(247,'Dry Skeleton',2,'a Rusty Dagger','The skeleton crumbles into a pile of dust.',NULL,97,24,21,3,3,NULL,'Hank',1,1,NULL),(248,'Newly Dead Zombie',2,'Fists','Maybe now it can rest in peace.',NULL,97,24,21,3,3,NULL,'Hank',1,1,NULL),(249,'Faerie hound',2,'Glowing Eyes','The embers in the eye sockets dim and sputter out.',NULL,97,24,21,3,3,NULL,'Hank',1,1,NULL),(250,'Apprentice Necromancer',3,'Life Draining Spells','He gasps a final breath and melts into a tarry liquid.',NULL,148,34,32,5,4,NULL,'Hank',1,0,NULL),(251,'Doppleganger',3,'Shape changing','You kill the doppleganger and he returns to his true form.',NULL,148,34,32,5,4,NULL,'Hank',1,0,NULL),(252,'Forest Thief',3,'Poisoned Short Sword','His pockets were almost empty. I guess he wasn\'t much of a thief.','',148,34,32,5,4,'','Hank',1,0,NULL),(253,'Mouldy Skeleton',3,'Rotten Fists','Heeeeey, didn\'t you see him in town last week?',NULL,148,34,32,5,4,NULL,'Hank',1,1,NULL),(254,'Angry Fairy',3,'Furious Fairy Dust','He disappears in a cloud of fairy dust.',NULL,148,34,32,5,4,NULL,'Hank',1,0,NULL),(255,'Goblin Hunter',3,'a Shortbow','Only one? Don\'t they usually travel in packs?',NULL,148,34,32,5,4,NULL,'Hank',1,0,NULL),(256,'Bobcat Cub',3,'Sharp Claws','Even the cute fuzzy kittens are evil in this place.',NULL,148,34,32,5,4,NULL,'Hank',1,0,NULL),(257,'Animate Junkheap',3,'Stench of 1000 rotten potatoes','Just call you the De-Animator!',NULL,148,34,32,5,4,NULL,'Hank',1,0,NULL),(258,'Necromancer',4,'Strength Draining Touch','In a cloud of black smoke, his body wafts away on the breeze.','',162,45,43,7,6,'','Hank',1,0,NULL),(259,'Reed Golem',4,'Fists of Thorns','The only thing left was a tiny bale of hay.',NULL,162,45,43,7,6,NULL,'Hank',1,0,NULL),(260,'Goblin Shaman',4,'Primitive Magic','\"Oooga Booga,\" indeed.',NULL,162,45,43,7,6,NULL,'Hank',1,0,NULL),(261,'Steam Spirit',4,'Scalding Steam','Not so hot now, eh?',NULL,162,45,43,7,6,NULL,'Hank',1,0,NULL),(262,'Restless Zombie',4,'Broken Longsword','Finally he is at peace.',NULL,162,45,43,7,6,NULL,'Hank',1,1,NULL),(263,'Zombie Soldier',4,'Rusted Spear','His final orders were to march to hell.','',162,45,43,7,6,'','Hank',1,1,NULL),(264,'Dark Imp',4,'Nagging Doubts','The imp implodes in a ball of flame.',NULL,162,45,43,7,6,NULL,'Hank',1,1,NULL),(265,'Giant Spider',4,'Fangs that glisten with poison','I really, really hate spiders.','',162,45,43,7,6,'','Hank',1,0,NULL),(266,'Undead Kitten',4,'Mews of Doom','Another evil cat sent to hell C.O.D.',NULL,162,45,43,7,6,NULL,'Hank',1,1,NULL),(267,'Flying Dagger',4,'Sharpened Steel Point','The dagger shatters when it hits the ground.',NULL,162,45,43,7,6,NULL,'Hank',1,0,NULL),(268,'Goblin Warrior',5,'Bent Short Sword','Gone... and forgotten.','',198,55,53,9,7,'','Hank',1,0,NULL),(269,'Experienced Necromancer',5,'a small group of Zombies','The necromancer turns into a pile of black sand and blows away.',NULL,198,55,53,9,7,NULL,'Hank',1,0,NULL),(270,'Flame Sprite',5,'Searing Flame','You cooled him off in a hurry...',NULL,198,55,53,9,7,NULL,'Hank',1,0,NULL),(271,'Mud Man',5,'Enchanted Mud','Defeated, the Mud Man dries up in the warm sun.',NULL,198,55,53,9,7,NULL,'Hank',1,0,NULL),(272,'Lupe the Hypnotic Chihuahua',5,'The stare of doom','You manage to break free of those deep hypnotic eyes...',NULL,198,55,53,9,7,NULL,'Hank',1,0,NULL),(273,'Ghoul',5,'Hunger for Flesh','The ghoul falls to the ground, a bit of flesh between his teeth.',NULL,198,55,53,9,7,NULL,'Hank',1,1,NULL),(274,'Seedy Cutthroat',5,'Sharpened Daggers','One more bandit removed from this forest.',NULL,198,55,53,9,7,NULL,'Hank',1,0,NULL),(275,'Ogre',5,'Broken treebranch','Boy, thats a face not even a mother could love.',NULL,198,55,53,9,7,NULL,'Hank',1,0,NULL),(276,'Crazy Woodsman',5,'Dull axe','Chopped him down to size...',NULL,198,55,53,9,7,NULL,'Hank',1,0,NULL),(277,'Flying Drakeling',5,'a Lashing Tail','You swat the small, majestic beast out of the air.',NULL,198,55,53,9,7,NULL,'Hank',1,0,NULL),(278,'Forest Cat',6,'Menacing Claws','Here kitty, kitty, kitty.','',234,66,64,11,8,'','Hank',1,0,NULL),(279,'Journeyman Necromancer',6,'An Undead Giant','The necromancer drifts away on a cloud of black smoke.','',234,66,64,11,8,'','Hank',1,0,NULL),(280,'Frigid Skeleton',6,'The Cold of the Grave','I\'ll bet one of these guys could cool ale at the inn.','',234,66,64,11,8,'','Hank',1,1,NULL),(281,'Frost Spirit',6,'Bone Chilling Cold','Puttin down another cold one.','',234,66,64,11,8,'','Hank',1,0,NULL),(282,'Dragon Slayer\'s ghost',6,'Warnings of Doom','Everybody wondered what happened to him.',NULL,234,66,64,11,8,NULL,'Hank',1,0,NULL),(283,'Ettin Mage',6,'Double threat spells','Two heads are not better than one in this case. Just more to lop off.','',234,66,64,11,8,'','Hank',1,0,NULL),(284,'Insane Brownie',6,'Faerie spells','This one\'s nuts!',NULL,234,66,64,11,8,NULL,'Hank',1,0,NULL),(285,'Ghostly Wolfpack',6,'Ghostly Howls','Quiet settles in around you. Finally.',NULL,234,66,64,11,8,NULL,'Hank',1,1,NULL),(286,'Wood Golem',6,'Oaken Fists','The truth gave you life and the truth set you free.','',234,66,64,11,8,'','Hank',1,0,NULL),(287,'Diseased Ent',6,'Twisted Branches','There must be fifty ways to cut your lumber. (Groan)','',234,66,64,11,8,'','Hank',1,0,NULL),(288,'Dark Druid',7,'Corrupted Nature','He lost me at the corrupt it to save it part.',NULL,268,77,74,13,10,NULL,'Hank',1,0,NULL),(289,'Lizard Man Scout',7,'Marginal Archery','I know where I can get him made into a nice pair of boots.','',268,77,74,13,10,'','Hank',1,0,NULL),(290,'Diabolic Footman',7,'A Demon Forged Mace','His armor sizzles and he melts as he crumples to the ground.',NULL,268,77,74,13,10,NULL,'Hank',1,1,NULL),(291,'Gargantuan Tree Spider',7,'Projectile Webbing','After you lop him in half, you realize he\'s not so big.',NULL,268,77,74,13,10,NULL,'Hank',1,0,NULL),(292,'Flaming Zombie',7,'Fists covered in Flame','You extinguish the flame of life and the zombie falls to the ground, smoking.',NULL,268,77,74,13,10,NULL,'Hank',1,1,NULL),(293,'Eldritch Wizard',7,'Spells of Darkness','You slice him in two only to watch his body disappear, leaving an empty robe behind.',NULL,268,77,74,13,10,NULL,'Hank',1,0,NULL),(294,'Master Necromancer',7,'An Army of the Dead','You kill the necromancer and his minions disintegrate before your eyes.',NULL,268,77,74,13,10,NULL,'Hank',1,0,NULL),(295,'Animate Darkness',7,'The Darkness of a Thousand Nights','Light Slowly returns to this part of the forest.','',268,77,74,13,10,'','Hank',1,1,NULL),(296,'Temple Guardian Statue',7,'Marble Fists','So, where\'s the temple?',NULL,268,77,74,13,10,NULL,'Hank',1,0,NULL),(297,'Owlbear',7,'Claws and a bearhug','I don\'t even want to know how they breed these.','',268,77,74,13,10,'','Hank',1,0,NULL),(298,'The Man In Black',8,'Necromantic Spells','Finally, I got my chance to kill him.','',302,89,84,15,11,'','Hank',1,0,NULL),(299,'Gnome Illusionist',8,'Fearsome Illusions','It was all in his head.','',302,89,84,15,11,'','Hank',1,0,NULL),(300,'Demon Skeleton',8,'Diabolic Runes','The spirits of its victims drag the skeleton back to hell.','',302,89,84,15,11,'','Hank',1,1,NULL),(301,'Insane Master Druid',8,'The land Itself','His evil laughter dies with him.',NULL,302,89,84,15,11,NULL,'Hank',1,0,NULL),(302,'Water Elementalist',8,'Water Based Spells','He\'s all wet.',NULL,302,89,84,15,11,NULL,'Hank',1,0,NULL),(303,'Earth Elementalist',8,'Earth Based Spells','He fought kind of Dirty.','',302,89,84,15,11,'','Hank',1,0,NULL),(304,'Ettin Warrior',8,'Two Clubs of Iron','They did all right until they hit each other.',NULL,302,89,84,15,11,NULL,'Hank',1,0,NULL),(305,'Forest Giant',8,'An Uprooted Tree','Ho, Ho, Ho that, green man.',NULL,302,89,84,15,11,NULL,'Hank',1,0,NULL),(306,'Demoniac Knight',8,'A Diabolic Lance','Good night, Sir Knight.','',302,89,84,15,11,'','Hank',1,1,NULL),(307,'Giant Zombie',8,'Gigantic Fists','They DO smell worse when they are bigger!',NULL,302,89,84,15,11,NULL,'Hank',1,1,NULL),(308,'Frost Spectre',9,'The Chill Touch of the Grave','As you recover from the fight, the Spectre melts away into the shadows.',NULL,336,101,94,17,13,NULL,'Hank',1,1,NULL),(309,'Small Forest Dragon',9,'Snapping Jaws','Dragon? Check. Green? Check. Huge? Nope.','',336,101,94,17,13,'','Hank',1,0,NULL),(310,'A Pack of Carnivorous Lemurs',9,'Hoots and Howls','What the heck is a Lemur??',NULL,336,101,94,17,13,NULL,'Hank',1,0,NULL),(311,'Albino Crypt Bear',9,'Foul Stench and Claws','You dispatch the bear and wonder if there are more lurking about.',NULL,336,101,94,17,13,NULL,'Hank',1,0,NULL),(312,'Black Knight of The Vale',9,'Ebony Sword','As he dies, he curses you and tells you that you will never defeat the dragon.',NULL,336,101,94,17,13,NULL,'Hank',1,0,NULL),(313,'Elmearian Spy',9,'Small Dagger','He eats his information before he dies, so you learn nothing from him.',NULL,336,101,94,17,13,NULL,'Hank',1,0,NULL),(314,'Stalking Shadow',9,'Fingers of Darkness','You send the ceature back to where it came from.',NULL,336,101,94,17,13,NULL,'Hank',1,1,NULL),(315,'Necromantic Archmagus',9,'Screams of a Thousand Souls','With his dying breath he explodes into a pillar of black flame!',NULL,336,101,94,17,13,NULL,'Hank',1,0,NULL),(316,'Iron Golem',9,'Rusted Fists','The golem seizes up and you push him over.','',336,101,94,17,13,'','Hank',1,0,NULL),(317,'A Hell Hound',9,'Fiery Breath','He bursts into flames and is sucked into the earth.',NULL,336,101,94,17,13,NULL,'Hank',1,1,NULL),(318,'Corporate Lackey',7,'Buzzwords','Well, you sure reprioritized his downsizing.',NULL,268,77,74,13,10,NULL,'Moonchilde',1,0,NULL),(319,'SCO Lawyer',8,'Court Papers','There\'s one lawyer who\'ll never trouble you again!',NULL,302,89,84,15,11,NULL,'Moonchilde',1,1,NULL),(320,'Gypsy Bandit',14,'Gemmed Dagger','That will put an end to his thieving days.','You\'re dead, he\'s free to take what he will.',499,172,145,27,20,'global $badguy, $session;\r\n\r\nif (!isset($badguy[\'spellpoints\'])) {\r\n $badguy[\'spellpoints\'] = 1;\r\n}\r\n\r\n$gold = round($session[\'user\'][\'gold\'] * 0.2);\r\nif (e_rand(0,7) == 0 && $gold > 200 && $badguy[\'spellpoints\'] == 1) {\r\n rawoutput(\"
The pickpocket takes $gold gold!

\");\r\n $session[\'user\'][\'gold\'] -= $gold;\r\n $badguy[\'creaturegold\'] += $gold;\r\n $badguy[\'spellpoints\']--;\r\n}','Talisman',1,0,NULL); +/*!40000 ALTER TABLE `creatures` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `debuglog` +-- + +DROP TABLE IF EXISTS `debuglog`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `debuglog` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `actor` int(11) unsigned DEFAULT NULL, + `target` int(11) unsigned DEFAULT NULL, + `message` text NOT NULL, + `field` varchar(20) NOT NULL, + `value` float(9,2) NOT NULL DEFAULT 0.00, + PRIMARY KEY (`id`), + KEY `date` (`date`), + KEY `field` (`actor`,`field`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `debuglog` +-- + +LOCK TABLES `debuglog` WRITE; +/*!40000 ALTER TABLE `debuglog` DISABLE KEYS */; +INSERT INTO `debuglog` VALUES (1,'2020-08-12 19:08:59',1,0,'New Day Turns: Base: 10, Spirits: 1, DK: 0','',0.00); +/*!40000 ALTER TABLE `debuglog` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `faillog` +-- + +DROP TABLE IF EXISTS `faillog`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `faillog` ( + `eventid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `post` tinytext NOT NULL, + `ip` varchar(40) NOT NULL, + `acctid` int(11) unsigned DEFAULT NULL, + `id` varchar(32) NOT NULL, + PRIMARY KEY (`eventid`), + KEY `date` (`date`), + KEY `acctid` (`acctid`), + KEY `ip` (`ip`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `faillog` +-- + +LOCK TABLES `faillog` WRITE; +/*!40000 ALTER TABLE `faillog` DISABLE KEYS */; +/*!40000 ALTER TABLE `faillog` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gamelog` +-- + +DROP TABLE IF EXISTS `gamelog`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `gamelog` ( + `logid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `message` text NOT NULL, + `category` varchar(50) NOT NULL, + `filed` tinyint(4) NOT NULL DEFAULT 0, + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `who` int(11) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`logid`), + KEY `date` (`category`,`date`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `gamelog` +-- + +LOCK TABLES `gamelog` WRITE; +/*!40000 ALTER TABLE `gamelog` DISABLE KEYS */; +INSERT INTO `gamelog` VALUES (1,'Deleted 0 accounts:\n[0] with 0 dk avg lvl [0]\n[0] with 1 dk avg lvl [0]\nAvg DK: [0]\nAccounts: ','char expiration',0,'2020-08-12 19:08:59',1),(2,'Cleaned up 0 old values in module_userprefs that don\'t exist anymore','maintenance',0,'2020-08-12 19:08:59',1),(3,'Cleaned up 0 old values in module_settings that don\'t exist anymore','maintenance',0,'2020-08-12 19:08:59',1),(4,'Cleaned up 0 from debuglog older than 2020-07-25 19:08:59.','maintenance',0,'2020-08-12 19:08:59',1),(5,'Cleaned up gamelog table removing 0 older than 2020-07-12 19:08:59.','maintenance',0,'2020-08-12 19:08:59',1),(6,'Deleted 0 old comments.','comment expiration',0,'2020-08-12 19:08:59',1),(7,'Deleted 0 old moderated comments.','comment expiration',0,'2020-08-12 19:08:59',1); +/*!40000 ALTER TABLE `gamelog` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `logdnet` +-- + +DROP TABLE IF EXISTS `logdnet`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `logdnet` ( + `serverid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `address` varchar(255) NOT NULL, + `description` varchar(255) NOT NULL, + `priority` double NOT NULL DEFAULT 100, + `lastupdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `version` varchar(255) NOT NULL DEFAULT 'Unknown', + `admin` varchar(255) NOT NULL DEFAULT 'unknown', + `lastping` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `recentips` varchar(255) NOT NULL, + `count` int(11) unsigned NOT NULL DEFAULT 0, + `lang` varchar(20) NOT NULL, + PRIMARY KEY (`serverid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `logdnet` +-- + +LOCK TABLES `logdnet` WRITE; +/*!40000 ALTER TABLE `logdnet` DISABLE KEYS */; +/*!40000 ALTER TABLE `logdnet` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `logdnetbans` +-- + +DROP TABLE IF EXISTS `logdnetbans`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `logdnetbans` ( + `banid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `bantype` varchar(20) NOT NULL, + `banvalue` varchar(255) NOT NULL, + PRIMARY KEY (`banid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `logdnetbans` +-- + +LOCK TABLES `logdnetbans` WRITE; +/*!40000 ALTER TABLE `logdnetbans` DISABLE KEYS */; +/*!40000 ALTER TABLE `logdnetbans` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `mail` +-- + +DROP TABLE IF EXISTS `mail`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mail` ( + `messageid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `msgfrom` varchar(255) NOT NULL DEFAULT '0', + `msgto` int(11) unsigned NOT NULL DEFAULT 0, + `subject` varchar(255) NOT NULL, + `body` text NOT NULL, + `sent` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `seen` tinyint(1) NOT NULL DEFAULT 0, + `originator` int(11) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`messageid`), + KEY `msgto` (`msgto`), + KEY `seen` (`seen`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `mail` +-- + +LOCK TABLES `mail` WRITE; +/*!40000 ALTER TABLE `mail` DISABLE KEYS */; +/*!40000 ALTER TABLE `mail` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `masters` +-- + +DROP TABLE IF EXISTS `masters`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `masters` ( + `creatureid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `creaturename` varchar(50) DEFAULT NULL, + `creaturelevel` int(11) DEFAULT NULL, + `creatureweapon` varchar(50) DEFAULT NULL, + `creaturelose` varchar(120) DEFAULT NULL, + `creaturewin` varchar(120) DEFAULT NULL, + `creaturegold` int(11) DEFAULT NULL, + `creatureexp` int(11) DEFAULT NULL, + `creaturehealth` int(11) DEFAULT NULL, + `creatureattack` int(11) DEFAULT NULL, + `creaturedefense` int(11) DEFAULT NULL, + PRIMARY KEY (`creatureid`) +) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `masters` +-- + +LOCK TABLES `masters` WRITE; +/*!40000 ALTER TABLE `masters` DISABLE KEYS */; +INSERT INTO `masters` VALUES (1,'Mireraband',1,'Small Dagger','Well done %w`&, I should have guessed you\'d grown some.','As I thought, %w`^, your skills are no match for my own!',NULL,NULL,12,2,2),(2,'Fie',2,'Short Sword','Well done %w`&, you really know how to use your %x.','You should have known you were no match for my %X',NULL,NULL,22,4,4),(3,'Glynyc',3,'Hugely Spiked Mace','Aah, defeated by the likes of you! Next thing you know, Mireraband will be hunting me down!','Haha, maybe you should go back to Mireraband\'s class.',NULL,NULL,33,6,6),(4,'Guth',4,'Spiked Club','Ha! Hahaha, excellent fight %w`&! Haven\'t had a battle like that since I was in the RAF!','Back in the RAF, we\'d have eaten the likes of you alive! Go work on your skills some old boy!',NULL,NULL,44,8,8),(5,'Un�lith',5,'Thought Control','Your mind is greater than mine. I concede defeat.','Your mental powers are lacking. Meditate on this failure and perhaps some day you will defeat me.',NULL,NULL,55,10,10),(6,'Adwares',6,'Dwarven Battle Axe','Ach! Y\' do hold yer %x with skeel!','Har! Y\' do be needin moore praktise y\' wee cub!',NULL,NULL,66,12,12),(7,'Gerrard',7,'Battle Bow','Hmm, mayhaps I underestimated you.','As I thought.',NULL,NULL,77,14,14),(8,'Ceiloth',8,'Orkos Broadsword','Well done %w`&, I can see that great things lie in the future for you!','You are becoming powerful, but not yet that powerful.',NULL,NULL,88,16,16),(9,'Dwiredan',9,'Twin Swords','Perhaps I should have considered your %x...','Perhaps you\'ll reconsider my twin swords before you try that again?',NULL,NULL,99,18,18),(10,'Sensei Noetha',10,'Martial Arts Skills','Your style was superior, your form greater. I bow to you.','Learn to adapt your style, and you shall prevail.',NULL,NULL,110,20,20),(11,'Celith',11,'Throwing Halos','Wow, how did you dodge all those halos?','Watch out for that last halo, it\'s coming back this way!',NULL,NULL,121,22,22),(12,'Gadriel the Elven Ranger',12,'Elven Long Bow','I can accept that you defeated me, because after all elves are immortal while you are not, so the victory will be mine.','Do not forget that elves are immortal. Mortals will likely never defeat one of the fey.',NULL,NULL,132,24,24),(13,'Adoawyr',13,'Gargantuan Broad Sword','If I could have picked up this sword, I probably would have done better!','Haha, I couldn\'t even pick the sword UP and I still won!',NULL,NULL,143,26,26),(14,'Yoresh',14,'Death Touch','Well, you evaded my touch. I salute you!','Watch out for my touch next time!',NULL,NULL,154,28,28); +/*!40000 ALTER TABLE `masters` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `moderatedcomments` +-- + +DROP TABLE IF EXISTS `moderatedcomments`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `moderatedcomments` ( + `modid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `comment` text DEFAULT NULL, + `moderator` int(11) unsigned NOT NULL DEFAULT 0, + `moddate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`modid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `moderatedcomments` +-- + +LOCK TABLES `moderatedcomments` WRITE; +/*!40000 ALTER TABLE `moderatedcomments` DISABLE KEYS */; +/*!40000 ALTER TABLE `moderatedcomments` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `module_event_hooks` +-- + +DROP TABLE IF EXISTS `module_event_hooks`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `module_event_hooks` ( + `event_type` varchar(20) NOT NULL, + `modulename` varchar(50) NOT NULL, + `event_chance` text NOT NULL, + KEY `modulename` (`modulename`), + KEY `event_type` (`event_type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `module_event_hooks` +-- + +LOCK TABLES `module_event_hooks` WRITE; +/*!40000 ALTER TABLE `module_event_hooks` DISABLE KEYS */; +INSERT INTO `module_event_hooks` VALUES ('forest','fairy','return 100;'),('forest','findgem','return 100;'),('travel','findgem','return 20;'),('forest','foilwench','return 100;'),('forest','glowingstream','return 100;'),('travel','glowingstream','return 100;'),('forest','goldmine','return 100;'),('forest','findgold','return 100;'),('travel','findgold','return 20;'),('forest','crazyaudrey','return 100;'),('forest','darkhorse','require_once(\"modules/darkhorse.php\");\n return (darkhorse_tavernmount() ? 0 : 100);'),('travel','darkhorse','require_once(\"modules/darkhorse.php\");\n return (darkhorse_tavernmount() ? 0 : 100);'); +/*!40000 ALTER TABLE `module_event_hooks` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `module_hooks` +-- + +DROP TABLE IF EXISTS `module_hooks`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `module_hooks` ( + `modulename` varchar(50) NOT NULL, + `location` varchar(50) NOT NULL, + `function` varchar(50) NOT NULL, + `whenactive` text NOT NULL, + `priority` int(11) NOT NULL DEFAULT 50, + PRIMARY KEY (`modulename`,`location`,`function`), + KEY `location` (`location`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `module_hooks` +-- + +LOCK TABLES `module_hooks` WRITE; +/*!40000 ALTER TABLE `module_hooks` DISABLE KEYS */; +INSERT INTO `module_hooks` VALUES ('cedrikspotions','header-inn','cedrikspotions_dohook','',50),('cedrikspotions','hprecalc','cedrikspotions_dohook','',50),('cedrikspotions','newday-runonce','cedrikspotions_dohook','',50),('crazyaudrey','newday','crazyaudrey_dohook','',50),('crazyaudrey','newday-runonce','crazyaudrey_dohook','',50),('crazyaudrey','village','crazyaudrey_dohook','',50),('crazyaudrey','village-desc','crazyaudrey_dohook','',50),('dag','delete_character','dag_dohook','',50),('dag','dragonkill','dag_dohook','',50),('dag','inn','dag_dohook','',50),('dag','inn-desc','dag_dohook','',50),('dag','newday','dag_dohook','',50),('dag','pvpwin','dag_dohook','',50),('dag','showsettings','dag_dohook','',50),('dag','superuser','dag_dohook','',50),('darkhorse','forest','darkhorse_dohook','',50),('darkhorse','moderate','darkhorse_dohook','',50),('darkhorse','mountfeatures','darkhorse_dohook','',50),('drinks','ale','drinks_dohook','',50),('drinks','commentary','drinks_dohook','',50),('drinks','dragonkill','drinks_dohook','',50),('drinks','header-graveyard','drinks_dohook','',50),('drinks','newday','drinks_dohook','',50),('drinks','soberup','drinks_dohook','',50),('drinks','superuser','drinks_dohook','',50),('fairy','hprecalc','fairy_dohook','',50),('game_dice','darkhorsegame','game_dice_dohook','',50),('game_stones','darkhorsegame','game_stones_dohook','',50),('lovers','inn','lovers_dohook','',50),('lovers','newday','lovers_dohook','',50),('outhouse','forest','outhouse_dohook','',50),('outhouse','newday','outhouse_dohook','',50),('racedwarf','camplocs','racedwarf_dohook','',50),('racedwarf','changesetting','racedwarf_dohook','',50),('racedwarf','chooserace','racedwarf_dohook','',50),('racedwarf','creatureencounter','racedwarf_dohook','',50),('racedwarf','drinks-check','racedwarf_dohook','',50),('racedwarf','drinks-text','racedwarf_dohook','',50),('racedwarf','mercenarycamptext','racedwarf_dohook','',50),('racedwarf','moderate','racedwarf_dohook','',50),('racedwarf','raceminedeath','racedwarf_dohook','',50),('racedwarf','racenames','racedwarf_dohook','',50),('racedwarf','setrace','racedwarf_dohook','',50),('racedwarf','travel','racedwarf_dohook','',50),('racedwarf','validforestloc','racedwarf_dohook','',50),('racedwarf','validlocation','racedwarf_dohook','',50),('racedwarf','village','racedwarf_dohook','',50),('racedwarf','villagetext','racedwarf_dohook','',50),('raceelf','adjuststats','raceelf_dohook','',50),('raceelf','changesetting','raceelf_dohook','',50),('raceelf','chooserace','raceelf_dohook','',50),('raceelf','moderate','raceelf_dohook','',50),('raceelf','newday','raceelf_dohook','',50),('raceelf','pvpadjust','raceelf_dohook','',50),('raceelf','raceminedeath','raceelf_dohook','',50),('raceelf','racenames','raceelf_dohook','',50),('raceelf','setrace','raceelf_dohook','',50),('raceelf','travel','raceelf_dohook','',50),('raceelf','validforestloc','raceelf_dohook','',50),('raceelf','validlocation','raceelf_dohook','',50),('raceelf','villagetext','raceelf_dohook','',50),('raceelf','weaponstext','raceelf_dohook','',50),('racehuman','changesetting','racehuman_dohook','',50),('racehuman','chooserace','racehuman_dohook','',50),('racehuman','moderate','racehuman_dohook','',50),('racehuman','newday','racehuman_dohook','',50),('racehuman','raceminedeath','racehuman_dohook','',50),('racehuman','racenames','racehuman_dohook','',50),('racehuman','setrace','racehuman_dohook','',50),('racehuman','stablelocs','racehuman_dohook','',50),('racehuman','stabletext','racehuman_dohook','',50),('racehuman','travel','racehuman_dohook','',50),('racehuman','validforestloc','racehuman_dohook','',50),('racehuman','validlocation','racehuman_dohook','',50),('racehuman','villagetext','racehuman_dohook','',50),('racetroll','adjuststats','racetroll_dohook','',50),('racetroll','changesetting','racetroll_dohook','',50),('racetroll','chooserace','racetroll_dohook','',50),('racetroll','moderate','racetroll_dohook','',50),('racetroll','newday','racetroll_dohook','',50),('racetroll','pvpadjust','racetroll_dohook','',50),('racetroll','raceminedeath','racetroll_dohook','',50),('racetroll','racenames','racetroll_dohook','',50),('racetroll','setrace','racetroll_dohook','',50),('racetroll','travel','racetroll_dohook','',50),('racetroll','validforestloc','racetroll_dohook','',50),('racetroll','validlocation','racetroll_dohook','',50),('racetroll','villagetext','racetroll_dohook','',50),('sethsong','inn','sethsong_dohook','',50),('sethsong','newday','sethsong_dohook','',50),('specialtydarkarts','apply-specialties','specialtydarkarts_dohook','',50),('specialtydarkarts','choose-specialty','specialtydarkarts_dohook','',50),('specialtydarkarts','dragonkill','specialtydarkarts_dohook','',50),('specialtydarkarts','fightnav-specialties','specialtydarkarts_dohook','',50),('specialtydarkarts','incrementspecialty','specialtydarkarts_dohook','',50),('specialtydarkarts','newday','specialtydarkarts_dohook','',50),('specialtydarkarts','set-specialty','specialtydarkarts_dohook','',50),('specialtydarkarts','specialtycolor','specialtydarkarts_dohook','',50),('specialtydarkarts','specialtymodules','specialtydarkarts_dohook','',50),('specialtydarkarts','specialtynames','specialtydarkarts_dohook','',50),('specialtymysticpower','apply-specialties','specialtymysticpower_dohook','',50),('specialtymysticpower','choose-specialty','specialtymysticpower_dohook','',50),('specialtymysticpower','dragonkill','specialtymysticpower_dohook','',50),('specialtymysticpower','fightnav-specialties','specialtymysticpower_dohook','',50),('specialtymysticpower','incrementspecialty','specialtymysticpower_dohook','',50),('specialtymysticpower','newday','specialtymysticpower_dohook','',50),('specialtymysticpower','set-specialty','specialtymysticpower_dohook','',50),('specialtymysticpower','specialtycolor','specialtymysticpower_dohook','',50),('specialtymysticpower','specialtymodules','specialtymysticpower_dohook','',50),('specialtymysticpower','specialtynames','specialtymysticpower_dohook','',50),('specialtythiefskills','apply-specialties','specialtythiefskills_dohook','',50),('specialtythiefskills','choose-specialty','specialtythiefskills_dohook','',50),('specialtythiefskills','dragonkill','specialtythiefskills_dohook','',50),('specialtythiefskills','fightnav-specialties','specialtythiefskills_dohook','',50),('specialtythiefskills','incrementspecialty','specialtythiefskills_dohook','',50),('specialtythiefskills','newday','specialtythiefskills_dohook','',50),('specialtythiefskills','set-specialty','specialtythiefskills_dohook','',50),('specialtythiefskills','specialtycolor','specialtythiefskills_dohook','',50),('specialtythiefskills','specialtymodules','specialtythiefskills_dohook','',50),('specialtythiefskills','specialtynames','specialtythiefskills_dohook','',50); +/*!40000 ALTER TABLE `module_hooks` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `module_objprefs` +-- + +DROP TABLE IF EXISTS `module_objprefs`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `module_objprefs` ( + `modulename` varchar(50) NOT NULL, + `objtype` varchar(50) NOT NULL, + `setting` varchar(50) NOT NULL, + `objid` int(11) unsigned NOT NULL DEFAULT 0, + `value` text DEFAULT NULL, + PRIMARY KEY (`modulename`,`objtype`,`setting`,`objid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `module_objprefs` +-- + +LOCK TABLES `module_objprefs` WRITE; +/*!40000 ALTER TABLE `module_objprefs` DISABLE KEYS */; +/*!40000 ALTER TABLE `module_objprefs` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `module_settings` +-- + +DROP TABLE IF EXISTS `module_settings`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `module_settings` ( + `modulename` varchar(50) NOT NULL, + `setting` varchar(50) NOT NULL, + `value` text DEFAULT NULL, + PRIMARY KEY (`modulename`,`setting`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `module_settings` +-- + +LOCK TABLES `module_settings` WRITE; +/*!40000 ALTER TABLE `module_settings` DISABLE KEYS */; +INSERT INTO `module_settings` VALUES ('cedrikspotions','atkmod','.75'),('cedrikspotions','carrydk','1'),('cedrikspotions','charmcost','2'),('cedrikspotions','charmgain','1'),('cedrikspotions','defmod','.75'),('cedrikspotions','forgcost','2'),('cedrikspotions','ischarm','1'),('cedrikspotions','isforget','1'),('cedrikspotions','ismax','1'),('cedrikspotions','istemp','1'),('cedrikspotions','istrans','1'),('cedrikspotions','maxcost','2'),('cedrikspotions','maxrand','5'),('cedrikspotions','minrand','2'),('cedrikspotions','randcost','2'),('cedrikspotions','random','0'),('cedrikspotions','survive','1'),('cedrikspotions','tempcost','2'),('cedrikspotions','tempgain','20'),('cedrikspotions','transcost','2'),('cedrikspotions','transmuteturns','10'),('cedrikspotions','vitalgain','1'),('crazyaudrey','animal','Kitten'),('crazyaudrey','animals','Kittens'),('crazyaudrey','buffname','Warm Fuzzies'),('crazyaudrey','cost','5'),('crazyaudrey','defaultanimal','Kitten'),('crazyaudrey','defaultanimals','Kittens'),('crazyaudrey','defaultbuffname','Warm Fuzzies'),('crazyaudrey','defaultsound','mew'),('crazyaudrey','gamedaysremaining','-1'),('crazyaudrey','lanimal','kitten'),('crazyaudrey','lanimals','kittens'),('crazyaudrey','profit','5'),('crazyaudrey','sound','mew'),('crazyaudrey','villagepercent','20'),('dag','bountyfee','10'),('dag','bountylevel','3'),('dag','bountymax','200'),('dag','bountymin','50'),('dag','maxbounties','5'),('darkhorse','tavernname','Dark Horse Tavern'),('drinks','hardlimit','3'),('drinks','maxdrunk','66'),('fairy','carrydk','1'),('fairy','fftoaward','1'),('fairy','hptoaward','1'),('findgold','maxgold','50'),('findgold','mingold','10'),('goldmine','alwaystether','10'),('goldmine','percentgemloss','0'),('goldmine','percentgoldloss','0'),('outhouse','badmusthit','50'),('outhouse','cost','5'),('outhouse','giveback','3'),('outhouse','givegempercent','25'),('outhouse','giveturnchance','0'),('outhouse','goldinhand','1'),('outhouse','goodmusthit','60'),('outhouse','takeback','1'),('racedwarf','minedeathchance','5'),('racedwarf','villagename','Qexelcrag'),('raceelf','minedeathchance','90'),('raceelf','villagename','Glorfindal'),('racehuman','bonus','2'),('racehuman','minedeathchance','90'),('racehuman','villagename','Romar'),('racetroll','minedeathchance','90'),('racetroll','villagename','Glukmoore'),('sethsong','bhploss','10'),('sethsong','goldloss','5'),('sethsong','hpgain','20'),('sethsong','maxgems','1'),('sethsong','maxgold','50'),('sethsong','mingems','1'),('sethsong','mingold','10'),('sethsong','shploss','20'),('sethsong','visits','1'); +/*!40000 ALTER TABLE `module_settings` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `module_userprefs` +-- + +DROP TABLE IF EXISTS `module_userprefs`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `module_userprefs` ( + `modulename` varchar(50) NOT NULL, + `setting` varchar(50) NOT NULL, + `userid` int(11) unsigned NOT NULL DEFAULT 0, + `value` text DEFAULT NULL, + PRIMARY KEY (`modulename`,`setting`,`userid`), + KEY `modulename` (`modulename`,`userid`), + KEY `userid` (`userid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `module_userprefs` +-- + +LOCK TABLES `module_userprefs` WRITE; +/*!40000 ALTER TABLE `module_userprefs` DISABLE KEYS */; +/*!40000 ALTER TABLE `module_userprefs` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `modules` +-- + +DROP TABLE IF EXISTS `modules`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `modules` ( + `modulename` varchar(50) NOT NULL, + `formalname` varchar(255) NOT NULL, + `description` text NOT NULL, + `moduleauthor` varchar(255) NOT NULL, + `active` tinyint(4) NOT NULL DEFAULT 0, + `filename` varchar(255) NOT NULL, + `installdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `installedby` varchar(50) NOT NULL, + `filemoddate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `type` tinyint(4) NOT NULL DEFAULT 0, + `extras` text DEFAULT NULL, + `category` varchar(50) NOT NULL, + `infokeys` text NOT NULL, + `version` varchar(10) DEFAULT NULL, + `download` varchar(200) DEFAULT NULL, + PRIMARY KEY (`modulename`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `modules` +-- + +LOCK TABLES `modules` WRITE; +/*!40000 ALTER TABLE `modules` DISABLE KEYS */; +INSERT INTO `modules` VALUES ('cedrikspotions','Cedrik\'s Potion Shop','','Eric Stevens
Modifications by: Chris Vorndran',1,'cedrikspotions.php','2020-08-12 19:09:49','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Inn','|name|version|author|category|download|settings|prefs|description|requires|','2.6','core_module'),('crazyaudrey','Crazy Audrey\'s Petting Zoo','','Eric Stevens',1,'crazyaudrey.php','2020-08-12 19:09:49','`%Admin `&admin`0','2020-06-21 05:47:56',0,NULL,'Forest Specials','|name|version|author|category|download|settings|prefs|requires|description|','1.1','core_module'),('dag','Dag Durnick Bounties','','Darrel Morrone
Updates by Andrew Senger, JT Traub, and Eric Stevens',1,'dag.php','2020-08-12 19:09:49','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Inn','|name|author|version|category|download|settings|prefs|description|requires|','1.3','core_module'),('darkhorse','Dark Horse Tavern','','Eric Stevens',1,'darkhorse.php','2020-08-12 19:09:50','`%Admin `&admin`0','2020-06-21 05:47:56',0,NULL,'Forest Specials','|name|version|author|category|download|settings|prefs-mounts|requires|description|','1.1','core_module'),('drinks','Exotic Drinks','','John J. Collins
Heavily modified by JT Traub',1,'drinks.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Inn','|name|author|category|download|settings|prefs|version|description|requires|','1.1','core_module'),('fairy','Forest Fairy','','Eric Stevens',1,'fairy.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Forest Specials','|name|version|author|category|download|settings|prefs|description|requires|','1.1','core_module'),('findgem','Find Gems','','Eric Stevens',1,'findgem.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Forest Specials','|name|version|author|category|download|description|requires|','1.1','core_module'),('findgold','Find Gold','','Eric Stevens',1,'findgold.php','2020-08-12 19:09:57','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Forest Specials','|name|version|author|category|download|settings|description|requires|','1.1','core_module'),('foilwench','Foilwench','','Eric Stevens',1,'foilwench.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Forest Specials','|name|version|author|category|download|description|requires|','1.1','core_module'),('game_dice','Dice Game for DarkHorse','','Eric Stevens',1,'game_dice.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Darkhorse Game','|name|author|version|category|download|description|requires|','1.1','core_module'),('game_stones','Stones Game for DarkHorse','','Eric Stevens',1,'game_stones.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Darkhorse Game','|name|author|version|category|download|description|requires|','1.1','core_module'),('glowingstream','Glowing Stream','','Eric Stevens',1,'glowingstream.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Forest Specials','|name|version|author|category|download|description|requires|','1.1','core_module'),('goldmine','Gold Mine','','Ville Valtokari',1,'goldmine.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Forest Specials','|name|version|author|category|download|settings|prefs-mounts|description|requires|','1.0','core_module'),('lovers','Violet and Seth Lovers','','Eric Stevens',1,'lovers.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Inn','|name|author|version|category|download|prefs|description|requires|','1.0','core_module'),('outhouse','Gnomish Outhouse','','John Collins',1,'outhouse.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Forest','|name|author|version|category|download|prefs|settings|description|requires|','2.0','core_module'),('racedwarf','Race - Dwarf','','Eric Stevens',1,'racedwarf.php','2020-08-12 19:09:50','`%Admin `&admin`0','2020-06-21 05:47:57',0,NULL,'Races','|name|version|author|category|download|settings|prefs-drinks|requires|description|','1.1','core_module'),('raceelf','Race - Elf','','Eric Stevens',1,'raceelf.php','2020-08-12 19:09:50','`%Admin `&admin`0','2020-06-21 05:47:57',0,NULL,'Races','|name|version|author|category|download|settings|requires|description|','1.0','core_module'),('racehuman','Race - Human','','Eric Stevens',1,'racehuman.php','2020-08-12 19:09:50','`%Admin `&admin`0','2020-06-21 05:47:57',0,NULL,'Races','|name|version|author|category|download|settings|requires|description|','1.0','core_module'),('racetroll','Race - Troll','','Eric Stevens',1,'racetroll.php','2020-08-12 19:09:50','`%Admin `&admin`0','2020-06-21 05:47:57',0,NULL,'Races','|name|version|author|category|download|settings|requires|description|','1.0','core_module'),('sethsong','Seth the Bard\'s Songs','','Eric Stevens',1,'sethsong.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Inn','|name|version|author|category|download|settings|prefs|description|requires|','1.1','core_module'),('specialtydarkarts','Specialty - Dark Arts','','Eric Stevens',1,'specialtydarkarts.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Specialties','|name|author|version|download|category|prefs|description|requires|','1.1','core_module'),('specialtymysticpower','Specialty - Mystical Powers','','Eric Stevens',1,'specialtymysticpower.php','2020-08-12 19:09:50','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Specialties','|name|author|version|download|category|prefs|description|requires|','1.0','core_module'),('specialtythiefskills','Specialty - Thieving Skills','','Eric Stevens',1,'specialtythiefskills.php','2020-08-12 19:09:51','`%Admin `&admin`0','0000-00-00 00:00:00',0,NULL,'Specialties','|name|author|version|download|category|prefs|description|requires|','1.0','core_module'); +/*!40000 ALTER TABLE `modules` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `motd` +-- + +DROP TABLE IF EXISTS `motd`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `motd` ( + `motditem` int(11) unsigned NOT NULL AUTO_INCREMENT, + `motdtitle` varchar(200) DEFAULT NULL, + `motdbody` text DEFAULT NULL, + `motddate` datetime DEFAULT NULL, + `motdtype` tinyint(4) unsigned NOT NULL DEFAULT 0, + `motdauthor` int(11) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`motditem`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `motd` +-- + +LOCK TABLES `motd` WRITE; +/*!40000 ALTER TABLE `motd` DISABLE KEYS */; +/*!40000 ALTER TABLE `motd` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `mounts` +-- + +DROP TABLE IF EXISTS `mounts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `mounts` ( + `mountid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `mountname` varchar(50) NOT NULL, + `mountdesc` text DEFAULT NULL, + `mountcategory` varchar(50) NOT NULL, + `mountbuff` text DEFAULT NULL, + `mountcostgems` int(11) unsigned NOT NULL DEFAULT 0, + `mountcostgold` int(11) unsigned NOT NULL DEFAULT 0, + `mountactive` int(11) unsigned NOT NULL DEFAULT 1, + `mountforestfights` int(11) NOT NULL DEFAULT 0, + `newday` text NOT NULL, + `recharge` text NOT NULL, + `partrecharge` text NOT NULL, + `mountfeedcost` int(11) unsigned NOT NULL DEFAULT 20, + `mountlocation` varchar(25) NOT NULL DEFAULT 'all', + `mountdkcost` int(11) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`mountid`), + KEY `mountid` (`mountid`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `mounts` +-- + +LOCK TABLES `mounts` WRITE; +/*!40000 ALTER TABLE `mounts` DISABLE KEYS */; +INSERT INTO `mounts` VALUES (1,'Pony','This docile beast is young yet.','Horses','a:5:{s:4:\"name\";s:13:\"`&Pony Attack\";s:8:\"roundmsg\";s:26:\"Your pony fights with you!\";s:6:\"rounds\";s:2:\"20\";s:6:\"atkmod\";s:3:\"1.2\";s:8:\"activate\";s:7:\"offense\";}',6,0,1,1,'You strap your {weapon} to your pony\'s saddle bags, and head out for some adventure!','`&Remembering that is has been quite some time since you last fed your pony, you decide this is a perfect time to relax and allow it to graze the field a bit. You doze off enjoying this peaceful serenity.`0','`&You dismount in the field to allow your pony to graze for a moment even though it has recently been fully fed. As you lean back in the grass to watch the clouds, your pony whickers softly and trots off into the underbrush. You search for a while before returning to the fields hoping that it\'ll return. A short time later, your pony trots back into the clearing holding its head high, looking much more energized and with a very equine grin on its face.`0',20,'all',0),(2,'Gelding','This powerful beast is fiercely loyal.','Horses','a:5:{s:4:\"name\";s:16:\"`&Gelding Attack\";s:8:\"roundmsg\";s:29:\"Your gelding fights with you!\";s:6:\"rounds\";s:2:\"40\";s:6:\"atkmod\";s:3:\"1.2\";s:8:\"activate\";s:7:\"offense\";}',10,0,1,2,'You strap your {weapon} to your gelding\'s saddle bags, and head out for some adventure!','`&Remembering that is has been quite some time since you last fed your gelding, you decide this is a perfect time to relax and allow it to graze the field a bit. You doze off enjoying this peaceful serenity.`0','`&You dismount in the field to allow your gelding to graze for a moment even though it has recently been fully fed. As you lean back in the grass to watch the clouds, your gelding whickers softly and trots off into the underbrush. You search for a while before returning to the fields hoping that it\'ll return. A short time later, your gelding trots back into the clearing holding its head high, looking much more energized and with a very equine grin on its face.`n`nAnd here you thought geldings weren\'t equipped that way any longer!`0',25,'all',0),(3,'Stallion','This noble beast is huge and powerful!','Horses','a:5:{s:4:\"name\";s:17:\"`&Stallion Attack\";s:8:\"roundmsg\";s:30:\"Your stallion fights with you!\";s:6:\"rounds\";s:2:\"60\";s:6:\"atkmod\";s:3:\"1.2\";s:8:\"activate\";s:7:\"offense\";}',16,0,1,3,'You strap your {weapon} to your stallion\'s saddle bags, and head out for some adventure!','`&Remembering that is has been quite some time since you last fed your stallion, you decide this is a perfect time to relax and allow it to graze the field a bit. You doze off enjoying this peaceful serenity.`0','`&You dismount in the field to allow your stallion to graze for a moment even though it has recently been fully fed. As you lean back in the grass to watch the clouds, your stallion whickers softly and trots off into the underbrush. You search for a while before returning to the fields hoping that it\'ll return. A short time later, your stallion trots back into the clearing holding its head high, looking much more energized and with a very equine grin on its face.`0',30,'all',0); +/*!40000 ALTER TABLE `mounts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `nastywords` +-- + +DROP TABLE IF EXISTS `nastywords`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `nastywords` ( + `words` text DEFAULT NULL, + `type` varchar(10) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `nastywords` +-- + +LOCK TABLES `nastywords` WRITE; +/*!40000 ALTER TABLE `nastywords` DISABLE KEYS */; +INSERT INTO `nastywords` VALUES ('*damn* *dyke *fuck* *nigger* *phuck* *shit* amcik andskota arschloch arse* ass asshole atouche ayir bastard bitch* boiolas bollock* buceta butt* butt-pirate cabron cawk cazzo chink chraa chuj cipa clit cock* cum cunt* dago daygo dego dick* dike dildo dirsa dupa dziwka ejaculate ejackulate ekrem* ekto enculer faen fag* fanculo fanny fatass fcuk feces feg felcher ficken fitta fitte flikker foreskin phuck fuk* fut futkretzn fuxor gay gook guiena hell helvete hoer* honkey honky hor hore huevon hui injun jism jizz kanker* kawk kike klootzak knulle kraut kuk kuksuger kurac kurwa kusi* kyrp�* leitch lesbian lesbo mamhoon masturbat* merd merde mibun monkleigh mouliewop muie mulkku muschi nazis nepesaurio nigga* nigger nutsack orospu paska* pendejo penis perse phuck picka pierdol* pillu* pimmel pimpis piss* pizda poontsee poop porn preteen preud prick pron pula pule pusse pussy puta puto qahbeh queef* queer* qweef rautenberg schaffer scheiss* scheisse schlampe schmuck screw scrotum sharmuta sharmute shemale shipal shiz skribz skurwysyn slut smut sphencter shpincter spic spierdalaj splooge suka teets teez testicle tits titties titty twat twaty vittu votze wank* wetback* whoar whore wichser woose wop yed zabourah','nasty'); +/*!40000 ALTER TABLE `nastywords` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `news` +-- + +DROP TABLE IF EXISTS `news`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `news` ( + `newsid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `newstext` text NOT NULL, + `newsdate` date NOT NULL DEFAULT '0000-00-00', + `accountid` int(11) unsigned NOT NULL DEFAULT 0, + `arguments` text NOT NULL, + `tlschema` varchar(255) NOT NULL DEFAULT 'news', + PRIMARY KEY (`newsid`,`newsdate`), + KEY `accountid` (`accountid`), + KEY `newsdate` (`newsdate`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `news` +-- + +LOCK TABLES `news` WRITE; +/*!40000 ALTER TABLE `news` DISABLE KEYS */; +INSERT INTO `news` VALUES (1,'`^A strange awakening takes place in the world.`0','2020-08-12',0,'',''); +/*!40000 ALTER TABLE `news` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `paylog` +-- + +DROP TABLE IF EXISTS `paylog`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `paylog` ( + `payid` int(11) NOT NULL AUTO_INCREMENT, + `info` text NOT NULL, + `response` text NOT NULL, + `txnid` varchar(32) NOT NULL, + `amount` float(9,2) NOT NULL DEFAULT 0.00, + `name` varchar(50) NOT NULL, + `acctid` int(11) unsigned NOT NULL DEFAULT 0, + `processed` tinyint(4) unsigned NOT NULL DEFAULT 0, + `filed` tinyint(4) unsigned NOT NULL DEFAULT 0, + `txfee` float(9,2) NOT NULL DEFAULT 0.00, + `processdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`payid`), + KEY `txnid` (`txnid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `paylog` +-- + +LOCK TABLES `paylog` WRITE; +/*!40000 ALTER TABLE `paylog` DISABLE KEYS */; +/*!40000 ALTER TABLE `paylog` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `petitions` +-- + +DROP TABLE IF EXISTS `petitions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `petitions` ( + `petitionid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `author` int(11) unsigned NOT NULL DEFAULT 0, + `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `status` int(11) unsigned NOT NULL DEFAULT 0, + `body` text DEFAULT NULL, + `pageinfo` text DEFAULT NULL, + `closedate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `closeuserid` int(11) unsigned NOT NULL DEFAULT 0, + `ip` varchar(40) NOT NULL, + `id` varchar(32) NOT NULL, + PRIMARY KEY (`petitionid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `petitions` +-- + +LOCK TABLES `petitions` WRITE; +/*!40000 ALTER TABLE `petitions` DISABLE KEYS */; +/*!40000 ALTER TABLE `petitions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `pollresults` +-- + +DROP TABLE IF EXISTS `pollresults`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `pollresults` ( + `resultid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `choice` int(11) unsigned NOT NULL DEFAULT 0, + `account` int(11) unsigned NOT NULL DEFAULT 0, + `motditem` int(11) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`resultid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `pollresults` +-- + +LOCK TABLES `pollresults` WRITE; +/*!40000 ALTER TABLE `pollresults` DISABLE KEYS */; +/*!40000 ALTER TABLE `pollresults` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `referers` +-- + +DROP TABLE IF EXISTS `referers`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `referers` ( + `refererid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `uri` text DEFAULT NULL, + `count` int(11) DEFAULT NULL, + `last` datetime DEFAULT NULL, + `site` varchar(50) NOT NULL, + `dest` varchar(255) DEFAULT NULL, + `ip` varchar(40) DEFAULT NULL, + PRIMARY KEY (`refererid`), + KEY `uri` (`uri`(100)), + KEY `site` (`site`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `referers` +-- + +LOCK TABLES `referers` WRITE; +/*!40000 ALTER TABLE `referers` DISABLE KEYS */; +/*!40000 ALTER TABLE `referers` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `settings` +-- + +DROP TABLE IF EXISTS `settings`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `settings` ( + `setting` varchar(20) NOT NULL, + `value` varchar(255) NOT NULL, + PRIMARY KEY (`setting`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `settings` +-- + +LOCK TABLES `settings` WRITE; +/*!40000 ALTER TABLE `settings` DISABLE KEYS */; +INSERT INTO `settings` VALUES ('allowclans','1'),('allowspecialswitch','1'),('automaster','1'),('barkeep','`)Cedrik'),('beta','0'),('betaperplayer','1'),('cachetranslations','0'),('charset','ISO-8859-1'),('collecttexts','0'),('daysperday','4'),('defaultlanguage','en'),('defaultskin','jade.htm'),('enablecompanions','1'),('enabletranslation','1'),('expirecontent','180'),('expirenewacct','10'),('expireoldacct','45'),('expiretrashacct','1'),('fightsforinterest','4'),('gameoffsetseconds','0'),('game_epoch','2020-07-13 00:00:00 +0000'),('gravefightsperday','10'),('homecurtime','1'),('homenewdaytime','1'),('homenewestplayer','1'),('homeskinselect','1'),('innname','The Boar\'s Head Inn'),('installer_version','1.1.2 Dragonprime Edition'),('lastdboptimize','2020-08-11 19:08:59'),('last_char_expire','2020-08-12 19:08:59'),('logdnet','0'),('loginbanner','*BETA* This is a BETA of this website, things are likely to change now and again, as it is under active development *BETA*'),('LOGINTIMEOUT','900'),('maxinterest','10'),('maxonline','0'),('mininterest','1'),('newdaycron','0'),('newdaySemaphore','2020-08-12 19:08:59'),('newestplayer',''),('oldmail','14'),('OnlineCount','0'),('OnlineCountLast','1597259479'),('paypalcurrency','USD'),('paypalemail',''),('permacollect','0'),('pvp','1'),('pvpday','3'),('resurrectionturns','-6'),('serverlanguages','en,English,fr,Fran�ais,dk,Danish,de,Deutsch,es,Espa�ol,it,Italian'),('serverurl','http://_/'),('show_notices','0'),('tl_maxallowed','0'),('turns','10'),('villagechance','0'),('villagename','Degolburg'); +/*!40000 ALTER TABLE `settings` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `taunts` +-- + +DROP TABLE IF EXISTS `taunts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `taunts` ( + `tauntid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `taunt` text DEFAULT NULL, + `editor` varchar(50) DEFAULT NULL, + PRIMARY KEY (`tauntid`) +) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `taunts` +-- + +LOCK TABLES `taunts` WRITE; +/*!40000 ALTER TABLE `taunts` DISABLE KEYS */; +INSERT INTO `taunts` VALUES (1,'`5\"`6Just wait for my revenge, `4%W`6. It will be swift!`5\" %w declares.','Bluspring'),(2,'`5\"`6I\'m really going to enjoy this new `4%x`6 that %w`6 had,`5\" exclaimed %W.','joe'),(3,'`5\"`6Aah, so `bthat\'s`b what `4%X`6 is for!`5\" exclaimed %W','joe'),(4,'`5\"`6Oh man! I didn\'t think you had it in you, `5%W`6,`5\" %w exclaims.','Bluspring'),(5,'`5%W was overheard saying, \"`6%p `4%x`6 was no match for my `4%X`6!`5\"','Bluspring'),(6,'`5\"`6You know, you really shouldn\'t have a `4%x`6 unless you know how to use it,`5\" suggested %W.','Bluspring'),(7,'`5\"`6`bARRRGGGGGGG`b!!`5\" %w screams in frustration.','Bluspring'),(8,'`5\"`6How could I be so feeble?`5\" %w laments.','Bluspring'),(9,'`5\"`6I must not be as sturdy as I thought...!`5\" %w concedes.','Bluspring'),(10,'`5\"`6Watch your back, `4%W`6, I am coming for you!`5\" %w warns.','Bluspring'),(11,'`5\"`6This both sucks and blows!`5\" wails %w.','Bluspring'),(12,'`5\"`6I see London, I see France, I see `4%w\'s`6 underpants!`5\" reveals %W.','Bluspring'),(13,'`5\"`6The Healer\'s Hut can\'t help you now, `4%w`6!`5\" chides %W.','Bluspring'),(14,'`5%W smiles. \"`6You are too slow. You are too weak.`5\"','Bluspring'),(15,'`5%w bangs %p head against a stone...\"`6Stupid, stupid, stupid!`5\" %o was heard to say.','Bluspring'),(16,'`5\"`6My ego can\'t take much more of this bruising!`5\" exclaims %w.','Bluspring'),(17,'`5\"`6Why didn\'t I become a successful doctor like my father suggested?`5\" wonders %w aloud.','Bluspring'),(18,'`5\"`6Maybe `bnext`b time you won\'t be so cocky!`5\" laughs %W','Bluspring'),(19,'`5\"`6A baby could wield a `4%x `6better than that!`5\" %W proclaims.','Bluspring'),(20,'`5\"`6You should have just stayed in bed,`5\" %W suggests.','Bluspring'),(21,'`5\"`6Well isn\'t that a kick in the crotch?!`5\" %w observes.','Bluspring'),(22,'`5\"`6Come back when you learn how to fight,`5\" %W scoffs.','Bluspring'),(23,'`5\"`6Next time, eat your Wheaties,`5\" %W suggests.','Bluspring'),(24,'`5 \"`6You are dishonorable, `4%W`6!`5\" %w cries.','Bluspring'),(25,'`5\"`4%w`6, your lack of posture is a disgrace,`5\" %W states. ','Bluspring'),(26,'`5\"`6You know, `4%w`6 really had it coming to %s after all those things `bI`b said about `b%p`b mom`5,\" commented %W.','Joe'); +/*!40000 ALTER TABLE `taunts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `titles` +-- + +DROP TABLE IF EXISTS `titles`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `titles` ( + `titleid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `dk` int(11) NOT NULL DEFAULT 0, + `ref` varchar(100) NOT NULL, + `male` varchar(25) NOT NULL, + `female` varchar(25) NOT NULL, + PRIMARY KEY (`titleid`), + KEY `dk` (`dk`) +) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `titles` +-- + +LOCK TABLES `titles` WRITE; +/*!40000 ALTER TABLE `titles` DISABLE KEYS */; +INSERT INTO `titles` VALUES (1,0,'','Farmboy','Farmgirl'),(2,1,'','Page','Page'),(3,2,'','Squire','Squire'),(4,3,'','Gladiator','Gladiatrix'),(5,4,'','Legionnaire','Legioness'),(6,5,'','Centurion','Centurioness'),(7,6,'','Sir','Madam'),(8,7,'','Reeve','Reeve'),(9,8,'','Steward','Steward'),(10,9,'','Mayor','Mayoress'),(11,10,'','Baron','Baroness'),(12,11,'','Count','Countess'),(13,12,'','Viscount','Viscountess'),(14,13,'','Marquis','Marchioness'),(15,14,'','Chancellor','Chancelloress'),(16,15,'','Prince','Princess'),(17,16,'','King','Queen'),(18,17,'','Emperor','Empress'),(19,18,'','Angel','Angel'),(20,19,'','Archangel','Archangel'),(21,20,'','Principality','Principality'),(22,21,'','Power','Power'),(23,22,'','Virtue','Virtue'),(24,23,'','Dominion','Dominion'),(25,24,'','Throne','Throne'),(26,25,'','Cherub','Cherub'),(27,26,'','Seraph','Seraph'),(28,27,'','Demigod','Demigoddess'),(29,28,'','Titan','Titaness'),(30,29,'','Archtitan','Archtitaness'),(31,30,'','Undergod','Undergoddess'),(32,31,'','God','Goddess'); +/*!40000 ALTER TABLE `titles` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `translations` +-- + +DROP TABLE IF EXISTS `translations`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `translations` ( + `tid` int(11) NOT NULL AUTO_INCREMENT, + `language` varchar(10) NOT NULL, + `uri` varchar(255) NOT NULL, + `intext` blob NOT NULL, + `outtext` blob NOT NULL, + `author` varchar(50) DEFAULT NULL, + `version` varchar(50) DEFAULT NULL, + PRIMARY KEY (`tid`), + KEY `language` (`language`,`uri`), + KEY `uri` (`uri`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `translations` +-- + +LOCK TABLES `translations` WRITE; +/*!40000 ALTER TABLE `translations` DISABLE KEYS */; +/*!40000 ALTER TABLE `translations` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `untranslated` +-- + +DROP TABLE IF EXISTS `untranslated`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `untranslated` ( + `intext` blob NOT NULL, + `language` varchar(10) NOT NULL, + `namespace` varchar(255) NOT NULL, + PRIMARY KEY (`intext`(200),`language`,`namespace`), + KEY `language` (`language`), + KEY `intext1` (`intext`(200),`language`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `untranslated` +-- + +LOCK TABLES `untranslated` WRITE; +/*!40000 ALTER TABLE `untranslated` DISABLE KEYS */; +/*!40000 ALTER TABLE `untranslated` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `weapons` +-- + +DROP TABLE IF EXISTS `weapons`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `weapons` ( + `weaponid` int(11) unsigned NOT NULL AUTO_INCREMENT, + `weaponname` varchar(128) DEFAULT NULL, + `value` int(11) NOT NULL DEFAULT 0, + `damage` int(11) NOT NULL DEFAULT 1, + `level` int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`weaponid`) +) ENGINE=InnoDB AUTO_INCREMENT=196 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `weapons` +-- + +LOCK TABLES `weapons` WRITE; +/*!40000 ALTER TABLE `weapons` DISABLE KEYS */; +INSERT INTO `weapons` VALUES (1,'Rake',48,1,0),(2,'Trowel',225,2,0),(3,'Spade',585,3,0),(4,'Adze',990,4,0),(5,'Gardening Hoe',1575,5,0),(6,'Torch',2250,6,0),(7,'Pitchfork',2790,7,0),(8,'Shovel',3420,8,0),(9,'Hedge Trimmers',4230,9,0),(10,'Hatchet',5040,10,0),(11,'Carving Knife',5850,11,0),(12,'Rusty Iron Wood-Chopping Axe',6840,12,0),(13,'Dull Steel Wood-chopping Axe',8010,13,0),(14,'Sharp Steel Wood-chopping Axe',9000,14,0),(15,'Woodsman\'s Axe',10350,15,0),(16,'Pebbles',48,1,1),(17,'Stones',225,2,1),(18,'Rocks',585,3,1),(19,'Small Treebranch',990,4,1),(20,'Large Treebranch',1575,5,1),(21,'Thickly Padded Sparring Pole',2250,6,1),(22,'Thinly Padded Sparring Pole',2790,7,1),(23,'Wooden Stave',3420,8,1),(24,'Wooden Practice Sword',4230,9,1),(25,'Blunt Bronze Short Sword',5040,10,1),(26,'Well Crafted Bronze Short Sword',5850,11,1),(27,'Rusty Steel Short Sword',6840,12,1),(28,'Dull Steel Short Sword',8010,13,1),(29,'Sharp Steel Short Sword',9000,14,1),(30,'Pages\'s Short Sword',10350,15,1),(31,'Dull Bronze Sword',48,1,2),(32,'Bronze Sword',225,2,2),(33,'Well Crafted Bronze Sword',585,3,2),(34,'Dull Iron Sword',990,4,2),(35,'Iron Sword',1575,5,2),(36,'Enchanted Sword',9000,14,2),(37,'Well Crafted Iron Sword',2250,6,2),(38,'Rusty Steel Sword',2790,7,2),(39,'Dull Steel Sword',3420,8,2),(40,'Well Crafted Steel Sword',4230,9,2),(41,'Engraved Steel Sword',5040,10,2),(42,'Steel Sword with Jeweled Hilt',5850,11,2),(43,'Golden Hilted Sword',6840,12,2),(44,'Platinum Hilted Sword',8010,13,2),(45,'Adept\'s Sword',10350,15,2),(46,'Steel Longsword',48,1,3),(47,'Etched Steel Longsword',585,3,3),(48,'Polished Steel Longsword',225,2,3),(49,'Well Balanced Steel Longsword',990,4,3),(50,'Perfectly Balanced Steel Longsword',1575,5,3),(51,'Engraved Steel Longsword',2250,6,3),(52,'Longsword with Silver-plated Hilt',2790,7,3),(53,'Longsword with Gold-plated Hilt',3420,8,3),(54,'Longsword with Solid Gold Hilt',4230,9,3),(55,'Longsword with Solid Platinum Hilt',5040,10,3),(56,'Moonsilver Longsword',5850,11,3),(57,'Autumngold Longsword',6840,12,3),(58,'Elfsilver Longsword',8010,13,3),(59,'Enchanted Longsword',9000,14,3),(60,'Wolfmaster\'s Longsword',10350,15,3),(61,'Poorly Balanced Bastard Sword',48,1,4),(62,'Tarnished Bastard Sword',225,2,4),(63,'Iron Bastard Sword',585,3,4),(64,'Steel Bastard Sword',990,4,4),(65,'Well Balanced Steel Bastard Sword',1575,5,4),(66,'Perfectly Balanced Bastard Sword',2250,6,4),(67,'Rune-etched Bastard Sword',2790,7,4),(68,'Bronze-inlay Bastard Sword',3420,8,4),(69,'Silver-inlay Bastard Sword',4230,9,4),(70,'Gold-inlay Bastard Sword',5040,10,4),(71,'Nightsilver Bastard Sword',5850,11,4),(72,'Morning-gold Bastard Sword',6840,12,4),(73,'Truesplendor Bastard Sword',8010,13,4),(74,'Enchanted Elfgold Bastard Sword',9000,14,4),(75,'Noble\'s Bastard Sword',10350,15,4),(76,'Tarnished Iron Claymore',48,1,5),(77,'Polished Iron Claymore',225,2,5),(78,'Rusty Steel Claymore',585,3,5),(79,'Steel Claymore',990,4,5),(80,'Finely Crafted Steel Claymore',1575,5,5),(81,'Scottish Broadsword',2250,6,5),(82,'Viking War Sword',2790,7,5),(83,'Barbarian\'s Sword',3420,8,5),(84,'Scottish Basket-Hilt Claymore',4230,9,5),(85,'Agincourt Steel Sword',5040,10,5),(86,'Celtic Combat Sword',5850,11,5),(87,'Norseman\'s Sword',6840,12,5),(88,'Knight\'s Sword',8010,13,5),(89,'Heraldic Lion Claymore',9000,14,5),(90,'Dragon Soldier\'s Claymore',10350,15,5),(91,'Two Broken Short Swords',48,1,6),(92,'Two Short Swords',225,2,6),(93,'Iron Scimitars',585,3,6),(94,'Balanced Scimitars',990,4,6),(95,'Tarnished Steel Scimitars',1575,5,6),(96,'Rusty Steel Scimitars',2250,6,6),(97,'Steel Scimitars',2790,7,6),(98,'Bronze Hilted Steel Scimitars',3420,8,6),(99,'Gold Hilted Steel Scimitars',4230,9,6),(100,'Platinum Hilted Steel Scimitars',5040,10,6),(101,'Well Crafted Adamantite Scimitars',5850,11,6),(102,'Perfectly Crafted Adamantite Scimitars',6840,12,6),(103,'Enchanted Scimitars',8010,13,6),(104,'Drow Crafted Scimitars',9000,14,6),(105,'Unicorn Blood-Forged Scimitars',10350,15,6),(106,'Chipped Iron Axe',48,1,7),(107,'Iron Axe',225,2,7),(108,'Rusty Steel Axe',585,3,7),(109,'Fine Steel Axe',990,4,7),(110,'Lumberjack\'s Axe',1575,5,7),(111,'Low Quality Battle Axe',2250,6,7),(112,'Medium Quality Battle Axe',2790,7,7),(113,'High Quality Battle Axe',3420,8,7),(114,'Double Bladed Axe',4230,9,7),(115,'Double Bladed Battle Axe',5040,10,7),(116,'Gold Plated Battle Axe',5850,11,7),(117,'Platinum Hilted Battle Axe',6840,12,7),(118,'Enchanted Battle Axe',8010,13,7),(119,'Dwarf Smith\'s Battle Axe',9000,14,7),(120,'Dwarf Warrior\'s Battle Axe',10350,15,7),(121,'Broken Iron Mace',48,1,8),(122,'Tarnished Iron Mace',225,2,8),(123,'Polished Iron Mace',585,3,8),(124,'Well Crafted Iron Mace',990,4,8),(125,'Polished Steel Mace',1575,5,8),(126,'Well Crafted Steel Mace',2250,6,8),(127,'Poorly Balanced Double Mace',2790,7,8),(128,'Well Balanced Double Mace',3420,8,8),(129,'Battle Mace',4230,9,8),(130,'War Chieftain\'s Battle Mace',5040,10,8),(131,'War Chieftain\'s Morning Star',5850,11,8),(132,'Adamantite Morning Star',6840,12,8),(133,'Dwarf Crafted Morning Star',8010,13,8),(134,'Dwarf Warlord\'s Morning Star',9000,14,8),(135,'Enchanted Morning Star',10350,15,8),(136,'Boot Knife',48,1,9),(137,'Target Knife',225,2,9),(138,'Blackjack',585,3,9),(139,'Throwing Star',990,4,9),(140,'Hira-Shuriken',1575,5,9),(141,'Throwing Spike',2250,6,9),(142,'Atlatl',2790,7,9),(143,'Qilamitautit Bolo',3420,8,9),(144,'War Quoait',4230,9,9),(145,'Cha Kran',5040,10,9),(146,'Fei Piau',5850,11,9),(147,'Jen Piau',6840,12,9),(148,'Gau dim Piau',8010,13,9),(149,'Enchanted Throwing Axe',9000,14,9),(150,'Teksolo\'s Ninja Stars',10350,15,9),(151,'Farmer\'s Bow & Wooden Arrows',48,1,10),(152,'Farmer\'s Bow & Stone Tipped Arrows',225,2,10),(153,'Farmer\'s Bow & Steel Tipped Arrows',585,3,10),(154,'Hunter\'s Bow & Wooden Arrows',990,4,10),(155,'Hunter\'s Bow & Stone Tipped Arrows',1575,5,10),(156,'Hunter\'s Bow & Steel Tipped Arrows',2250,6,10),(157,'Ranger\'s Bow & Wooden Arrows',2790,7,10),(158,'Ranger\'s Bow & Stone Tipped Arrows',3420,8,10),(159,'Ranger\'s Bow & Steel Tipped Arrows',4230,9,10),(160,'Longbow',5040,10,10),(161,'Crossbow',5850,11,10),(162,'Elvish Longbow',6840,12,10),(163,'Elvish Longbow & Flame Tipped Arrows',8010,13,10),(164,'Elvish Longbow & Enchanted Arrows',9000,14,10),(165,'Longbow of the Elf King',10350,15,10),(166,'MightyE\'s Long Sword',225,2,11),(167,'MightyE\'s Short Sword',48,1,11),(168,'MightyE\'s Bastard Sword',585,3,11),(169,'MightyE\'s Scimitars',990,4,11),(170,'MightyE\'s Battle Axe',1575,5,11),(171,'MightyE\'s Throwing Hammer',2250,6,11),(172,'MightyE\'s Morning Star',2790,7,11),(173,'MightyE\'s Compound Bow',3420,8,11),(174,'MightyE\'s Rapier',4230,9,11),(175,'MightyE\'s Sabre',5040,10,11),(176,'MightyE\'s Light Sabre',5850,11,11),(177,'MightyE\'s Wakizashi',6840,12,11),(178,'MightyE\'s 2-Handed War Sword',8010,13,11),(179,'MightyE\'s 2-handed War Axe',9000,14,11),(180,'MightyE\'s Claymore',10350,15,11),(181,'Spell of Fire',48,1,12),(182,'Spell of Earthquake',225,2,12),(183,'Spell of Flood',585,3,12),(184,'Spell of Hurricane',990,4,12),(185,'Spell of Mind Control',1575,5,12),(186,'Spell of Lightning',2250,6,12),(187,'Spell of Weakness',2790,7,12),(188,'Spell of Fear',3420,8,12),(189,'Spell of Poison',4230,9,12),(190,'Spell of Spirit Possession',5040,10,12),(191,'Spell of Despair',5850,11,12),(192,'Spell of Bat Summoning',6840,12,12),(193,'Spell of Wolf Summoning',8010,13,12),(194,'Spell of Unicorn Summoning',9000,14,12),(195,'Spell of Dragon Summoning',10350,15,12); +/*!40000 ALTER TABLE `weapons` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2020-08-12 19:58:00 diff --git a/lotgd-web/lotgd/mail.php b/lotgd-web/lotgd/mail.php new file mode 100755 index 0000000..ff8d87a --- /dev/null +++ b/lotgd-web/lotgd/mail.php @@ -0,0 +1,91 @@ +"); +rawoutput(""); +$count_mailfunctions = count($mailfunctions); +for($i=0;$i<$count_mailfunctions;++$i) { + if (is_array($mailfunctions[$i])) { + if (count($mailfunctions[$i])==2) { + $page = $mailfunctions[$i][0]; + $name = $mailfunctions[$i][1]; // already translated + rawoutput("$name"); + // No need for addnav since mail function pages are (or should be) outside the page nav system. + } + } +} +rawoutput(""); +output_notl("`n`n"); + +if($op=="send"){ + require("lib/mail/case_send.php"); +} + +switch ($op) { +case "read": + require("lib/mail/case_read.php"); + break; +case "address": + require("lib/mail/case_address.php"); + break; +case "write": + require("lib/mail/case_write.php"); + break; +default: + require("lib/mail/case_default.php"); + break; +} +popup_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/masters.php b/lotgd-web/lotgd/masters.php new file mode 100755 index 0000000..ec9dec5 --- /dev/null +++ b/lotgd-web/lotgd/masters.php @@ -0,0 +1,144 @@ +1, + 'creaturename'=>'', + 'creatureweapon'=>'', + 'creaturewin'=>'', + 'creaturelose'=>'' + ); + } else { + $row = db_fetch_assoc($res); + } + addnav("","masters.php?op=save&id=$id"); + rawoutput("
"); + output("`^Master's level:`n"); + rawoutput(""); + output_notl("`n"); + output("`^Master's name:`n"); + rawoutput(""); + output_notl("`n"); + output("`^Master's weapon:`n"); + rawoutput(""); + output_notl("`n"); + output("`^Master's speech when player wins:`n"); + rawoutput(""); + output_notl("`n"); + output("`^Master's speech when player loses:`n"); + rawoutput(""); + output_notl("`n"); + $submit = translate_inline("Submit"); + rawoutput(""); + rawoutput("
"); + output_notl("`n`n"); + output("`#The following codes are supported in both the win and lose speeches (case matters):`n"); + output("%w = The players's name (can be specified as {goodguy}`n"); + output("%W = The masters's name (can be specified as {badguy}`n"); + output("%x = The players's weapon (can be specified as {weapon}`n"); + output("%X = The master's weapon (can be specified as {creatureweapon}`n"); + output("%a = The players's armor (can be specified as {armor}`n"); + output("%s = Subjective pronoun for the player (him her)`n"); + output("%p = Possessive pronoun for the player (his her)`n"); + output("%o = Objective pronoun for the player (he she)`n"); +} + +if ($op == "") { + addnav("Functions"); + addnav("Refresh list", "masters.php"); + addnav("Add master", "masters.php?op=edit&id=0"); + $sql = "SELECT * FROM ".db_prefix("masters")." ORDER BY creaturelevel"; + $res = db_query($sql); + $count = db_num_rows($res); + $ops = translate_inline("Ops"); + $edit = translate_inline("edit"); + $del = translate_inline("del"); + $delconfirm = translate_inline("Are you sure you wish to delete this master."); + $name = translate_inline("Name"); + $level = translate_inline ("Level"); + $lose = translate_inline("Lose to Master"); + $win = translate_inline("Win against Master"); + $weapon = translate_inline("Weapon"); + rawoutput(""); + rawoutput(""); + $i = 0; + while ($row = db_fetch_assoc($res)) { + $id = $row['creatureid']; + rawoutput(""); + $i++; + } + rawoutput("
$ops$level$name$weapon$win$lose
"); + rawoutput("[ "); + output_notl($edit); + rawoutput(" | "); + output_notl($del); + rawoutput("] "); + addnav("","masters.php?op=edit&id=$id"); + addnav("","masters.php?op=del&id=$id"); + rawoutput(""); + output_notl("`%%s`0",$row['creaturelevel']); + rawoutput(""); + output_notl("`#%s`0",stripslashes($row['creaturename'])); + rawoutput(""); + output_notl("`!%s`0",stripslashes($row['creatureweapon'])); + rawoutput(""); + output_notl("`&%s`0",stripslashes($row['creaturelose'])); + rawoutput(""); + output_notl("`^%s`0",stripslashes($row['creaturewin'])); + rawoutput("
"); + output("`n`#You can change the names, weapons and messages of all of the Training Masters."); + output("It is suggested, that you do not toy around with this, unless you know what you are doing.`0`n"); +} +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/mercenarycamp.php b/lotgd-web/lotgd/mercenarycamp.php new file mode 100755 index 0000000..5dc86da --- /dev/null +++ b/lotgd-web/lotgd/mercenarycamp.php @@ -0,0 +1,279 @@ + "A Mercenary Camp", + "desc" => array( + "`n`QYou step out of the gates of the village and stand for a moment to take a look around.", + "A slight breeze in the air stirs the pennants mounted above your head before it touches your skin.", + "Sounds of dogs barking draws your attention to the makeshift camp which is set slightly apart from the village.", + "You walk towards the encampment trying to avoid muddy puddles left from the rainfall the prior night.", + "The odor of cooking fires permeates the air.`n`n", + + "As you approach you notice two men seated on rough hewn logs in front of a tent.", + "Propped against one of the logs are a pair of long handled battle axes and a bastard sword.", + "One of the men turns his weatherbeaten face towards you.", + "You try to suppress a shudder as you recoil from the sight of his face.", + "A ragged scar marks his face from forehead to jaw, crossing an empty hole where his eye should be.", + "He spits into the campfire before him.`n`n", + + "\"`4Are you looking for someone?`Q\", he asks in a gravelly voice that comes from deep within.`n`n", + + "At that moment a slender elfin woman with her golden hair pulled back in a warrior's braid brushes past you.", + "Strapped across her back is a long bow and a leather quiver full of arrows fletched with turkey feathers.", + "She gives you a smirk as she passes.". + + "You turn as the elfin archer continues on her way.", + "That is when you notice a large mangy dog in a tug-of-war with a troll.", + "Clenched in the dog's teeth is a very large bone with bits of flesh still clinging to it.", + "You can't tell if the troll is growling louder than the dog as it tries to wrest the bone from its jaw.", + "Hanging from the troll's wide belt a gnarled club hangs against filthy breeches of animal skins.", + + "The sound of the man's voice brings your attention back to the matter at hand.`n`n", + "\"`PYes. As a matter of fact I am looking for someone.`Q\" you reply.", + "\"`PI have gold in my purse to pay for the best fighter willing to join me in ridding this realm of vermin.`Q\"`n`n", + ), + "buynav" => "Hire a mercenary", + "healnav" => "Heal a companion", + "healtext" => array( + "`QA surgeon takes a careful look at the many wounds of your companion.", + "After murmuring to himself as he makes the evaluation, he turns to you to name the price to care for the wounds.", + ), + "healnotenough" => array( + "`QThe surgeon shakes his head then shrugs before turning away.", + "You are left standing with your empty purse.", + "No healing for someone who cannot pay.", + ), + "healpaid" => array( + array("`QA surgeon is caring for the wounds of %s`Q and bandages them with learned skill.", $displayname), + "You gladly hand him the money owed for healing your companion and start heading back to the village.", + ), + "toomanycompanions"=> array( + "It seems no one is willing to follow you.", + "You simply lead too many companions at the moment." + ), + "manycompanions" => "Several mercenaries offer to join you:`n`n", + "onecompanion" => "One mercenary offers to join you:`n`n", + "nocompanions" => "No mercenaries off to join you.", +); + +$schemas = array( + "title"=>"mercenarycamp", + "desc"=>"mercenarycamp", + "buynav"=>"mercenarycamp", + "healnav"=>"mercenarycamp", + "healtext"=>"mercenarycamp", + "healnotenough"=>"mercenarycamp", + "healpaid"=>"mercenarycamp", + "toomanycompanions"=>"mercenarycamp", + "manycompanions"=>"mercenarycamp", + "onecompanion"=>"mercenarycamp", + "nocompanions"=>"mercenarycamp", +); + +$basetext['schemas'] = $schemas; +$texts = modulehook("mercenarycamptext",$basetext); +$schemas = $texts['schemas']; + +tlschema($schemas['title']); +page_header($texts['title']); +output("`c`b`&".$texts['title']."`0`b`c"); +tlschema(); + +$op = httpget("op"); + +if ($op==""){ + if (httpget('skip') != 1) { + tlschema($schemas['desc']); + if (is_array($texts['desc'])) { + foreach ($texts['desc'] as $description) { + output_notl(sprintf_translate($description)); + } + } else { + output($texts['desc']); + } + tlschema(); + } + + $sql = "SELECT * FROM " . db_prefix("companions") . " + WHERE companioncostdks<={$session['user']['dragonkills']} + AND (companionlocation = '{$session['user']['location']}' OR companionlocation = 'all') + AND companionactive = 1"; + $result = db_query($sql); + tlschema($schemas['buynav']); + addnav($texts['buynav']); + tlschema(); + switch (db_num_rows($result)) { + case 0: + if (is_array($texts['nocompanions'])) { + foreach ($texts['nocompanions'] as $description) { + output_notl(sprintf_translate($description)); + } + } else { + output($texts['nocompanions']); + } + break; + case 1: + if (is_array($texts['onecompanion'])) { + foreach ($texts['onecompanion'] as $description) { + output_notl(sprintf_translate($description)); + } + } else { + output($texts['onecompanion']); + } + break; + default: + if (is_array($texts['manycompanions'])) { + foreach ($texts['manycompanions'] as $description) { + output_notl(sprintf_translate($description)); + } + } else { + output($texts['manycompanions']); + } + break; + } + while ($row = db_fetch_assoc($result)) { + $row = modulehook("alter-companion", $row); + if ($row['companioncostgold'] && $row['companioncostgems']) { + if ($session['user']['gold'] >= $row['companioncostgold'] && $session['user']['gems'] >= $row['companioncostgems'] && !isset($companions[$row['name']])) { + addnav(array("%s`n`^%s Gold, `%%%s Gems`0",$row['name'], $row['companioncostgold'], $row['companioncostgems']), "mercenarycamp.php?op=buy&id={$row['companionid']}"); + } else { + addnav(array("%s`n`^%s Gold, `%%%s Gems`0",$row['name'], $row['companioncostgold'], $row['companioncostgems']), ""); + } + } else if ($row['companioncostgold']) { + if ($session['user']['gold'] >= $row['companioncostgold'] && !isset($companions[$row['name']])) { + addnav(array("%s`n`^%s Gold`0",$row['name'], $row['companioncostgold']), "mercenarycamp.php?op=buy&id={$row['companionid']}"); + } else { + addnav(array("%s`n`^%s Gold`0",$row['name'], $row['companioncostgold']), ""); + } + } else if ($row['companioncostgems']) { + if ($session['user']['gems'] >= $row['companioncostgems'] && !isset($companions[$row['name']])) { + addnav(array("%s`n`%%%s Gems`0",$row['name'], $row['companioncostgems']), "mercenarycamp.php?op=buy&id={$row['companionid']}"); + } else { + addnav(array("%s`n`%%%s Gems`0",$row['name'], $row['companioncostgems']), ""); + } + } else if (!isset($companions[$row['name']])) { + addnav(array("%s",$row['name']), "mercenarycamp.php?op=buy&id={$row['companionid']}"); + } + output("`#%s`n`7%s`n`n",$row['name'], $row['description']); + } + healnav($companions, $texts, $schemas); +} else if ($op == "heal") { + $cost = httpget('cost'); + if ($cost == 'notenough') { + tlschema($schemas['healpaid']); + if (is_array($texts['healnotenough'])) { + foreach ($texts['healnotenough'] as $healnotenough) { + output_notl(sprintf_translate($healnotenough)); + } + } else { + output($texts['healnotenough']); + } + tlschema(); + } else { + $companions[$name]['hitpoints'] = $companions[$name]['maxhitpoints']; + $session['user']['gold'] -= $cost; + debuglog("spent $cost gold on healing a companion", false, false, "healcompanion", $cost); + tlschema($schemas['healpaid']); + if (is_array($texts['healpaid'])) { + foreach ($texts['healpaid'] as $healpaid) { + output_notl(sprintf_translate($healpaid)); + } + } else { + output($texts['healpaid']); + } + tlschema(); + } + healnav($companions, $texts, $schemas); + addnav("Navigation"); + addnav("Return to the camp", "mercenarycamp.php?skip=1"); +} else if ($op == "buy") { + $id = httpget('id'); + $sql = "SELECT * FROM ".db_prefix("companions")." WHERE companionid = $id"; + $result = db_query($sql); + if ($row = db_fetch_assoc($result)) { + $row['attack'] = $row['attack'] + $row['attackperlevel'] * $session['user']['level']; + $row['defense'] = $row['defense'] + $row['defenseperlevel'] * $session['user']['level']; + $row['maxhitpoints'] = $row['maxhitpoints'] + $row['maxhitpointsperlevel'] * $session['user']['level']; + $row['hitpoints'] = $row['maxhitpoints']; + $row = modulehook("alter-companion", $row); + $row['abilities'] = @unserialize($row['abilities']); + require_once("lib/buffs.php"); + if (apply_companion($row['name'], $row)) { + output("`QYou hand over `^%s gold`Q and `%%s %s`Q.`n`n", (int)$row['companioncostgold'], (int)$row['companioncostgems'],translate_inline($row['companioncostgems'] == 1?"gem":"gems")); + if (isset($row['jointext']) && $row['jointext'] > "") { + output($row['jointext']); + } + $session['user']['gold'] -= $row['companioncostgold']; + $session['user']['gems'] -= $row['companioncostgems']; + debuglog("has spent {$row['companioncostgold']} gold and {$row['companioncostgems']} gems on hiring a mercenary ({$row['name']})."); + } else { + // applying the companion failed. Most likely they already have more than enough companions... + tlschema($schemas['toomanycompanions']); + if (is_array($texts['toomanycompanions'])) { + foreach ($texts['toomanycompanions'] as $toomanycompanions) { + output_notl(sprintf_translate($toomanycompanions)); + } + } else { + output($texts['toomanycompanions']); + } + tlschema(); + } + } + addnav("Navigation"); + addnav("Return to the camp", "mercenarycamp.php?skip=1"); +} +addnav("Navigation"); +villagenav(); +page_footer(); + + +function healnav($companions, $texts, $schemas) { + global $session; + tlschema($schemas['healnav']); + addnav($texts['healnav']); + tlschema(); + $healable = false; + foreach ($companions as $name => $companion) { + if (isset($companion['cannotbehealed']) && $companion['cannotbehealed'] == true) { + } else { + $pointstoheal = $companion['maxhitpoints'] - $companion['hitpoints']; + if ($pointstoheal > 0) { + $healable = true; + $costtoheal = round(log($session['user']['level']+1) * ($pointstoheal + 10)*1.33); + if ($session['user']['gold'] >= $costtoheal) { + addnav(array("%s`0 (`^%s Gold`0)", $companion['name'], $costtoheal), "mercenarycamp.php?op=heal&name=".rawurlencode($name)."&cost=$costtoheal"); + } else { + addnav(array("%s`0 (`\$Not enough gold`0)", $companion['name']), "mercenarycamp.php?op=heal&name=".rawurlencode($name)."&cost=notenough"); + } + } + } + } + if ($healable == true) { + tlschema($schemas['healtext']); + if (is_array($texts['healtext'])) { + foreach ($texts['healtext'] as $healtext) { + output_notl(sprintf_translate($healtext)); + } + } else { + output($texts['healtext']); + } + tlschema(); + } +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/moderate.php b/lotgd-web/lotgd/moderate.php new file mode 100755 index 0000000..a351045 --- /dev/null +++ b/lotgd-web/lotgd/moderate.php @@ -0,0 +1,291 @@ +''){ + $sql = "SELECT DISTINCT uniqueid,author FROM " . db_prefix("commentary") . " INNER JOIN " . db_prefix("accounts") . " ON acctid=author WHERE commentid IN ('" . join("','",array_keys($comment)) . "')"; + $result = db_query($sql); + $untildate = date("Y-m-d H:i:s",strtotime("+3 days")); + $reason = httppost("reason"); + $reason0 = httppost("reason0"); + $default = "Banned for comments you posted."; + if ($reason0 != $reason && $reason0 != $default) $reason = $reason0; + if ($reason=="") $reason = $default; + while ($row = db_fetch_assoc($result)){ + $sql = "SELECT * FROM " . db_prefix("bans") . " WHERE uniqueid = '{$row['uniqueid']}'"; + $result2 = db_query($sql); + $sql = "INSERT INTO " . db_prefix("bans") . " (uniqueid,banexpire,banreason,banner) VALUES ('{$row['uniqueid']}','$untildate','$reason','".addslashes($session['user']['name'])."')"; + $sql2 = "UPDATE " . db_prefix("accounts") . " SET loggedin=0 WHERE acctid={$row['author']}"; + if (db_num_rows($result2)>0){ + $row2 = db_fetch_assoc($result2); + if ($row2['banexpire'] < $untildate){ + //don't enter a new ban if a longer lasting one is + //already here. + db_query($sql); + db_query($sql2); + } + }else{ + db_query($sql); + db_query($sql2); + } + } + } + if (!isset($comment) || !is_array($comment)) $comment = array(); + $sql = "SELECT " . + db_prefix("commentary").".*,".db_prefix("accounts").".name,". + db_prefix("accounts").".login, ".db_prefix("accounts").".clanrank,". + db_prefix("clans").".clanshort FROM ".db_prefix("commentary"). + " INNER JOIN ".db_prefix("accounts")." ON ". + db_prefix("accounts").".acctid = " . db_prefix("commentary"). + ".author LEFT JOIN ".db_prefix("clans")." ON ". + db_prefix("clans").".clanid=".db_prefix("accounts"). + ".clanid WHERE commentid IN ('".join("','",array_keys($comment))."')"; + $result = db_query($sql); + $invalsections = array(); + while ($row = db_fetch_assoc($result)){ + $sql = "INSERT LOW_PRIORITY INTO ".db_prefix("moderatedcomments"). + " (moderator,moddate,comment) VALUES ('{$session['user']['acctid']}','".date("Y-m-d H:i:s")."','".addslashes(serialize($row))."')"; + db_query($sql); + $invalsections[$row['section']] = 1; + } + $sql = "DELETE FROM " . db_prefix("commentary") . " WHERE commentid IN ('" . join("','",array_keys($comment)) . "')"; + db_query($sql); + $return = httpget('return'); + $return = cmd_sanitize($return); + $return = substr($return,strrpos($return,"/")+1); + if (strpos($return,"?")===false && strpos($return,"&")!==false){ + $x = strpos($return,"&"); + $return = substr($return,0,$x-1)."?".substr($return,$x+1); + } + foreach($invalsections as $key=>$dummy) { + invalidatedatacache("comments-$key"); + } + //update moderation cache + invalidatedatacache("comments-or11"); + redirect($return); +} + +$seen = httpget("seen"); +if ($seen>""){ + $session['user']['recentcomments']=$seen; +} + +page_header("Comment Moderation"); + + +if ($op==""){ + $area = httpget('area'); + $link = "moderate.php" . ($area ? "?area=$area" : ""); + $refresh = translate_inline("Refresh"); + rawoutput("
"); + rawoutput(""); + rawoutput("
"); + addnav("", "$link"); + if ($area==""){ + talkform("X","says"); + commentdisplay("", "' or '1'='1","X",100); + }else{ + commentdisplay("", $area,"X",100); + talkform($area,"says"); + } +}elseif ($op=="audit"){ + $subop = httpget("subop"); + if ($subop=="undelete") { + $unkeys = httppost("mod"); + if ($unkeys && is_array($unkeys)) { + $sql = "SELECT * FROM ".db_prefix("moderatedcomments")." WHERE modid IN ('".join("','",array_keys($unkeys))."')"; + $result = db_query($sql); + while ($row = db_fetch_assoc($result)){ + $comment = unserialize($row['comment']); + $id = addslashes($comment['commentid']); + $postdate = addslashes($comment['postdate']); + $section = addslashes($comment['section']); + $author = addslashes($comment['author']); + $comment = addslashes($comment['comment']); + $sql = "INSERT LOW_PRIORITY INTO ".db_prefix("commentary")." (commentid,postdate,section,author,comment) VALUES ('$id','$postdate','$section','$author','$comment')"; + db_query($sql); + invalidatedatacache("comments-$section"); + } + $sql = "DELETE FROM ".db_prefix("moderatedcomments")." WHERE modid IN ('".join("','",array_keys($unkeys))."')"; + db_query($sql); + } else { + output("No items selected to undelete -- Please try again`n`n"); + } + } + $sql = "SELECT DISTINCT acctid, name FROM ".db_prefix("accounts"). + " INNER JOIN ".db_prefix("moderatedcomments"). + " ON acctid=moderator ORDER BY name"; + $result = db_query($sql); + addnav("Commentary"); + addnav("Sections"); + addnav("Modules"); + addnav("Clan Halls"); + addnav("Review by Moderator"); + tlschema("notranslate"); + while ($row = db_fetch_assoc($result)){ + addnav(" ?".$row['name'],"moderate.php?op=audit&moderator={$row['acctid']}"); + } + tlschema(); + addnav("Commentary"); + output("`c`bComment Auditing`b`c"); + $ops = translate_inline("Ops"); + $mod = translate_inline("Moderator"); + $when = translate_inline("When"); + $com = translate_inline("Comment"); + $unmod = translate_inline("Unmoderate"); + rawoutput("
"); + addnav("","moderate.php?op=audit&subop=undelete"); + rawoutput(""); + rawoutput(""); + $limit = "75"; + $where = "1=1 "; + $moderator = httpget("moderator"); + if ($moderator>"") $where.="AND moderator=$moderator "; + $sql = "SELECT name, ".db_prefix("moderatedcomments"). + ".* FROM ".db_prefix("moderatedcomments")." LEFT JOIN ". + db_prefix("accounts"). + " ON acctid=moderator WHERE $where ORDER BY moddate DESC LIMIT $limit"; + $result = db_query($sql); + $i=0; + $clanrankcolors=array("`!","`#","`^","`&"); + while ($row = db_fetch_assoc($result)){ + $i++; + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + } + rawoutput("
$ops$mod$when$com
"); + output_notl("%s", $row['name']); + rawoutput(""); + output_notl("%s", $row['moddate']); + rawoutput(""); + $comment = unserialize($row['comment']); + output_notl("`0(%s)", $comment['section']); + + if ($comment['clanrank']>0) + output_notl("%s<%s%s>`0", $clanrankcolors[ceil($comment['clanrank']/10)], + $comment['clanshort'], + $clanrankcolors[ceil($comment['clanrank']/10)]); + output_notl("%s", $comment['name']); + output_notl("-"); + output_notl("%s", comment_sanitize($comment['comment'])); + rawoutput("
"); + rawoutput(""); + rawoutput("
"); +} + + +addnav("Sections"); +tlschema("commentary"); +$vname = getsetting("villagename", LOCATION_FIELDS); +addnav(array("%s Square", $vname), "moderate.php?area=village"); + +if ($session['user']['superuser'] & ~SU_DOESNT_GIVE_GROTTO) { + addnav("Grotto","moderate.php?area=superuser"); +} + +addnav("Land of the Shades","moderate.php?area=shade"); +addnav("Grassy Field","moderate.php?area=grassyfield"); + +$iname = getsetting("innname", LOCATION_INN); +// the inn name is a proper name and shouldn't be translated. +tlschema("notranslate"); +addnav($iname,"moderate.php?area=inn"); +tlschema(); + +addnav("MotD","moderate.php?area=motd"); +addnav("Veterans Club","moderate.php?area=veterans"); +addnav("Hunter's Lodge","moderate.php?area=hunterlodge"); +addnav("Gardens","moderate.php?area=gardens"); +addnav("Clan Hall Waiting Area","moderate.php?area=waiting"); + +if (getsetting("betaperplayer", 1) == 1 && @file_exists("pavilion.php")) { + addnav("Beta Pavilion","moderate.php?area=beta"); +} +tlschema(); + +if ($session['user']['superuser'] & SU_MODERATE_CLANS){ + addnav("Clan Halls"); + $sql = "SELECT clanid,clanname,clanshort FROM " . db_prefix("clans") . " ORDER BY clanid"; + $result = db_query($sql); + // these are proper names and shouldn't be translated. + tlschema("notranslate"); + while ($row=db_fetch_assoc($result)){ + addnav(array("<%s> %s", $row['clanshort'], $row['clanname']), + "moderate.php?area=clan-{$row['clanid']}"); + } + tlschema(); +} elseif ($session['user']['superuser'] & SU_EDIT_COMMENTS && + getsetting("officermoderate", 0)) { + // the CLAN_OFFICER requirement was chosen so that moderators couldn't + // just get accepted as a member to any random clan and then proceed to + // wreak havoc. + // although this isn't really a big deal on most servers, the choice was + // made so that staff won't have to have another issue to take into + // consideration when choosing moderators. the issue is moot in most + // cases, as players that are trusted with moderator powers are also + // often trusted with at least the rank of officer in their respective + // clans. + if (($session['user']['clanid'] != 0) && + ($session['user']['clanrank'] >= CLAN_OFFICER)) { + addnav("Clan Halls"); + $sql = "SELECT clanid,clanname,clanshort FROM " . db_prefix("clans") . " WHERE clanid='" . $session['user']['clanid'] . "'"; + $result = db_query($sql); + // these are proper names and shouldn't be translated. + tlschema("notranslate"); + if ($row=db_fetch_assoc($result)){ + addnav(array("<%s> %s", $row['clanshort'], $row['clanname']), + "moderate.php?area=clan-{$row['clanid']}"); + } else { + debug ("There was an error while trying to access your clan."); + } + tlschema(); + } +} +addnav("Modules"); +$mods = array(); +$mods = modulehook("moderate", $mods); +reset($mods); + +// These are already translated in the module. +tlschema("notranslate"); +foreach ($mods as $area=>$name) { + addnav($name, "moderate.php?area=$area"); +} +tlschema(); + +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/modules.php b/lotgd-web/lotgd/modules.php new file mode 100755 index 0000000..39472c3 --- /dev/null +++ b/lotgd-web/lotgd/modules.php @@ -0,0 +1,310 @@ +$count) { + addnav(array(" ?%s - (%s modules)", $cat, $count), "modules.php?cat=$cat"); +} + +$cat = httpget('cat'); + +if ($op==""){ + if ($cat) { + $sortby=httpget('sortby'); + if (!$sortby) $sortby="installdate"; + $order=httpget('order'); + $tcat = translate_inline($cat); + output("`n`b%s Modules`b`n", $tcat); + $deactivate = translate_inline("Deactivate"); + $activate = translate_inline("Activate"); + $uninstall = translate_inline("Uninstall"); + $reinstall = translate_inline("Reinstall"); + $strsettings = translate_inline("Settings"); + $strnosettings = translate_inline("`\$No Settings`0"); + $uninstallconfirm = translate_inline("Are you sure you wish to uninstall this module? All user preferences and module settings will be lost. If you wish to temporarily remove access to the module, you may simply deactivate it."); + $status = translate_inline("Status"); + $mname = translate_inline("Module Name"); + $ops = translate_inline("Ops"); + $mauth = translate_inline("Module Author"); + $inon = translate_inline("Installed On"); + $installstr = translate_inline("by %s"); + $active = translate_inline("`@Active`0"); + $inactive = translate_inline("`\$Inactive`0"); + rawoutput("
"); + addnav("","modules.php?op=mass&cat=$cat"); + rawoutput("",true); + rawoutput(""); + addnav("","modules.php?cat=$cat&sortby=active&order=".($sortby=="active"?!$order:1)); + addnav("","modules.php?cat=$cat&sortby=formalname&order=".($sortby=="formalname"?!$order:1)); + addnav("","modules.php?cat=$cat&sortby=moduleauthor&order=".($sortby=="moduleauthor"?!$order:1)); + addnav("","modules.php?cat=$cat&sortby=installdate&order=".($sortby=="installdate"?$order:0)); + $sql = "SELECT * FROM " . db_prefix("modules") . " WHERE category='$cat' ORDER BY ".$sortby." ".($order?"ASC":"DESC"); + $result = db_query($sql); + if (db_num_rows($result)==0){ + rawoutput(""); + } + $number=db_num_rows($result); + for ($i=0;$i<$number;$i++){ + $row = db_fetch_assoc($result); + rawoutput("",true); + rawoutput(""); + } + rawoutput("
 $ops$status$mname$mauth$inon
"); + output("`i-- No Modules Installed--`i"); + rawoutput("
"); + rawoutput(""); + rawoutput("[ "); + if ($row['active']){ + rawoutput(""); + output_notl($deactivate); + rawoutput(""); + addnav("","modules.php?op=deactivate&module={$row['modulename']}&cat=$cat"); + }else{ + rawoutput(""); + output_notl($activate); + rawoutput(""); + addnav("","modules.php?op=activate&module={$row['modulename']}&cat=$cat"); + } + rawoutput(" |"); + output_notl($uninstall); + rawoutput(""); + addnav("","modules.php?op=uninstall&module={$row['modulename']}&cat=$cat"); + rawoutput(" | "); + output_notl($reinstall); + rawoutput(""); + addnav("","modules.php?op=reinstall&module={$row['modulename']}&cat=$cat"); + + if ($session['user']['superuser'] & SU_EDIT_CONFIG) { + if (strstr($row['infokeys'], "|settings|")) { + rawoutput(" | "); + output_notl($strsettings); + rawoutput(""); + addnav("","configuration.php?op=modulesettings&module={$row['modulename']}"); + } else { + output_notl(" | %s", $strnosettings); + } + } + + rawoutput(" ]"); + output_notl($row['active']?$active:$inactive); + require_once("lib/sanitize.php"); + rawoutput(""); + output_notl("%s %s", $row['formalname'], $row['version']); + rawoutput("
"); + output_notl("(%s) ", $row['modulename'], $row['version']); + rawoutput("
"); + output_notl("`#%s`0", $row['moduleauthor'], true); + rawoutput(""); + $line = sprintf($installstr, $row['installedby']); + output_notl("%s", $row['installdate']); + rawoutput("
"); + output_notl("%s", $line); + rawoutput("

"); + $activate = translate_inline("Activate"); + $deactivate = translate_inline("Deactivate"); + $reinstall = translate_inline("Reinstall"); + $uninstall = translate_inline("Uninstall"); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput("
"); + } else { + $sorting=httpget('sorting'); + if (!$sorting) $sorting="shortname"; + $order=httpget('order'); + output("`bUninstalled Modules`b`n"); + $install = translate_inline("Install"); + $mname = translate_inline("Module Name"); + $ops = translate_inline("Ops"); + $mauth = translate_inline("Module Author"); + $categ = translate_inline("Category"); + $fname = translate_inline("Filename"); + rawoutput("
"); + addnav("","modules.php?op=mass&cat=$cat"); + rawoutput("",true); + rawoutput(""); + addnav("","modules.php?sorting=name&order=".($sorting=="name"?!$order:0)); + addnav("","modules.php?sorting=author&order=".($sorting=="author"?!$order:0)); + addnav("","modules.php?sorting=category&order=".($sorting=="category"?!$order:0)); + addnav("","modules.php?sorting=shortname&order=".($sorting=="shortname"?!$order:0)); + if (count($uninstmodules) > 0) { + $count = 0; + $moduleinfo=array(); + $sortby=array(); + $numberarray=array(); + $invalidmodule = array( + "version"=>"", + "author"=>"", + "category"=>"", + "download"=>"", + "invalid"=>true, + ); + foreach($uninstmodules as $key=>$shortname) { + //test if the file is a valid module or a lib file/whatever that got in, maybe even malcode that does not have module form + $shortnamelower = strtolower($shortname); + $file = strtolower(file_get_contents("modules/$shortname.php")); + if (strpos($file,$shortnamelower."_getmoduleinfo")===false || + //strpos($file,$shortname."_dohook")===false || + //do_hook is not a necessity + strpos($file,$shortnamelower."_install")===false || + strpos($file,$shortnamelower."_uninstall")===false) { + //here the files has neither do_hook nor getinfo, which means it won't execute as a module here --> block it + notify the admin who is the manage modules section + $temp=array_merge($invalidmodule,array("name"=>$shortname.".php ".appoencode(translate_inline("(`\$Invalid Module! Contact Author or check file!`0)")))); + } else { + $temp= get_module_info($shortname); + } + //end of testing + if (!$temp || empty($temp)) continue; + $temp['shortname']=$shortname; + array_push($moduleinfo,$temp); + array_push($sortby,full_sanitize($temp[$sorting])); + array_push($numberarray,$count); + $count++; + } + array_multisort($sortby,($order?SORT_DESC:SORT_ASC),$numberarray,($order?SORT_DESC:SORT_ASC)); + for ($a=0;$a"); + if (isset($moduleinfo[$i]['invalid']) && $moduleinfo[$i]['invalid']===true) { + rawoutput(""); + } else { + rawoutput(""); + rawoutput(""); + addnav("","modules.php?op=install&module={$moduleinfo[$i]['shortname']}&cat={$moduleinfo[$i]['category']}"); + } + rawoutput(""); + rawoutput(""); + if (isset($moduleinfo[$i]['requires']) && count($moduleinfo[$i]['requires'])){ + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + } + $count++; + } + } else { + rawoutput(""); + } + rawoutput("
 $ops$mname$mauth$categ$fname
"); + output("Not installable"); + rawoutput(""); + rawoutput("[ "); + output_notl($install); + rawoutput("]"); + rawoutput($moduleinfo[$i]['name']." ".$moduleinfo[$i]['version']); + rawoutput(""); + output_notl("`#%s`0", $moduleinfo[$i]['author'], true); + rawoutput(""); + rawoutput($moduleinfo[$i]['category']); + rawoutput(""); + rawoutput($moduleinfo[$i]['shortname'] . ".php"); + rawoutput("
 "); + output("`bRequires:`b`n"); + reset($moduleinfo[$i]['requires']); + while (list($key,$val)=each($moduleinfo[$i]['requires'])){ + $info = explode("|",$val); + if (module_check_requirements(array($key=>$val))){ + output_notl("`@"); + }else{ + output_notl("`\$"); + } + if(isset($info[1])) output_notl("$key {$info[0]} -- {$info[1]}`n"); + else output_notl("$key {$info[0]}`n"); + } + rawoutput("
"); + output("`i--No uninstalled modules were found--`i"); + rawoutput("

"); + $install = translate_inline("Install"); + rawoutput(""); + } +} + +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/modules/cedrikspotions.php b/lotgd-web/lotgd/modules/cedrikspotions.php new file mode 100755 index 0000000..8d8668d --- /dev/null +++ b/lotgd-web/lotgd/modules/cedrikspotions.php @@ -0,0 +1,354 @@ +"Cedrik's Potion Shop", + "version"=>"2.6", + "author"=>"Eric Stevens
Modifications by: Chris Vorndran", + "category"=>"Inn", + "download"=>"core_module", + "settings"=>array( + "Cedrik's Potion Shop - Potion Availability,title", + "ischarm"=>"Is Charm potion available,bool|1", + "ismax"=>"Is Vitality potion available,bool|1", + "istemp"=>"Is Health potion available,bool|1", + "isforget"=>"Is Forgetfulness potion available,bool|1", + "istrans"=>"Is Transmutation potion available,bool|1", + "Cedrik's Potion Shop - Costs,title", + "charmcost"=>"Cost for Charm Potion,range,1,10,1|2", + "maxcost"=>"Cost for Vitality Potion,range,1,10,1|2", + "tempcost"=>"Cost for Health Potion,range,1,10,1|2", + "forgcost"=>"Cost for Forgetfulness Potion,range,1,10,1|2", + "transcost"=>"Cost for Transmutation Potion,range,1,10,1|2", + "random"=>"Is the cost per point of potion random,bool|0", + "minrand"=>"Minimum cost per point of effect,range,1,9,1|2", + "maxrand"=>"Maximum cost per point of effect,range,2,10,1|5", + "randcost"=>"Current random cost,rang,1,10,1|2", + "Note: Each amount of gems spent will give the effect the potion. The actual effects can vary based on configuration.,note", + "Cedrik's Potion Shop - Effects,title", + "transmuteturns"=>"How many turns will the transmutation sickness last?,range,1,20,1|10", + "defmod"=>"How much is the multiplier for Transmutation Sickness (defense)?,floatrange,.1,2,.05|.75", + "atkmod"=>"How much is the multiplier for Transmutation Sickness (attack)?,floatrange,.1,2,.05|.75", + "survive"=>"Will transmutation sickness carry over new days?,bool|1", + "charmgain"=>"How much charm do you get per potion,int|1", + "vitalgain"=>"How many maxhp do you get per potion,int|1", + "tempgain"=>"How many current hp do you get per potion,int|20", + "carrydk"=>"Do MaxHitpoint (vitality) potions carry across DKs?,bool|1", + ), + "prefs"=>array( + "Cedrik's Potion Shop User Preferences,title", + "extrahps"=>"How many extra hitpoints has the user bought?,int", + ), + ); + return $info; +} + +function cedrikspotions_install(){ + module_addhook("header-inn"); + module_addhook("newday-runonce"); + module_addhook("hprecalc"); + return true; +} + +function cedrikspotions_uninstall(){ + return true; +} + +function cedrikspotions_dohook($hookname,$args){ + switch($hookname){ + case "header-inn": + $op = httpget("op"); + $act = httpget("act"); + if($op=="bartender" && $act == "") { + addnav_notl(sanitize(getsetting("barkeep","`tCedrik"))); + addnav("Gems","runmodule.php?module=cedrikspotions&op=gems"); + } + break; + case "newday-runonce": + if (get_module_setting("random")){ + $min = get_module_setting("minrand"); + $max = get_module_setting("maxrand"); + $randcost = e_rand($min,$max); + set_module_setting("randcost",$randcost); + } + break; + case "hprecalc": + $args['total'] -= get_module_pref("extrahps"); + if (!get_module_setting("carrydk")) { + $args['extra'] -= get_module_pref("extrahps"); + set_module_pref("extrahps", 0); + } + } + return $args; +} + +function cedrikspotions_run(){ + global $session; + $wish = httppost('wish'); + $op = httpget("op"); + $iname = getsetting("innname", LOCATION_INN); + tlschema("inn"); + page_header($iname); + rawoutput(""); + output_notl("`c`b"); + output($iname); + output_notl("`b`c"); + tlschema(); + $barkeep = getsetting("barkeep","`tCedrik"); + $mincost = 0; + $maxcost = 0; + $cost = 0; + $gemcount = httppost('gemcount'); + if ($gemcount == "") { + if(get_module_setting("random")) { + $cost =get_module_setting("randcost"); + } else { + if (get_module_setting("ischarm")) { + $cm = get_module_setting("charmcost"); + if ($mincost==0 || $cm < $mincost) $mincost = $cm; + if ($maxcost==0 || $cm > $maxcost) $maxcost = $cm; + } + if (get_module_setting("ismax")) { + $cm = get_module_setting("maxcost"); + if ($mincost==0 || $cm < $mincost) $mincost = $cm; + if ($maxcost==0 || $cm > $maxcost) $maxcost = $cm; + } + if (get_module_setting("istemp")) { + $cm = get_module_setting("tempcost"); + if ($mincost==0 || $cm < $mincost) $mincost = $cm; + if ($maxcost==0 || $cm > $maxcost) $maxcost = $cm; + } + if (get_module_setting("isforget")) { + $cm = get_module_setting("forgcost"); + if ($mincost==0 || $cm < $mincost) $mincost = $cm; + if ($maxcost==0 || $cm > $maxcost) $maxcost = $cm; + } + if (get_module_setting("istrans")) { + $cm = get_module_setting("transcost"); + if ($mincost==0 || $cm < $mincost) $mincost = $cm; + if ($maxcost==0 || $cm > $maxcost) $maxcost = $cm; + } + if ($mincost == $maxcost) $cost = $mincost; + } + } + + if (!get_module_setting("random")){ + switch ($wish){ + case 1: + $cost = get_module_setting("charmcost"); + break; + case 2: + $cost = get_module_setting("maxcost"); + break; + case 3: + $cost = get_module_setting("tempcost"); + break; + case 4: + $cost = get_module_setting("forgcost"); + break; + case 5: + $cost = get_module_setting("transcost"); + break; + } + }else{ + $cost = get_module_setting("randcost"); + } + + if($op=="gems"){ + if ($gemcount==""){ + if (get_module_setting("random") || $mincost == $maxcost) { + output("\"`%You have gems, do ya?`0\" %s`0 asks. \"`%Well, I'll make you a magic elixir for `^ %s %s`%!`0\"",$barkeep,$cost, translate_inline($cost == 1?"gem" : "gems")); + } else { + output("\"`%You have gems, do ya?`0\" %s`0 asks. \"`%Well, I'll make you a magic elixir for between `^%s and %s gems`%, depending on which one you want!`0\"",$barkeep,$mincost, $maxcost); + } + output("`n`nGive him how many gems?"); + $give = translate_inline("Give"); + $link = appendcount("runmodule.php?module=cedrikspotions&op=gems"); + addnav("", $link); + rawoutput(""); + rawoutput(""); + rawoutput(""); + output("`nAnd what do you wish for?`n"); + if (get_module_setting("ischarm") == 1) { + rawoutput(""); + output("Charm"); + if ($mincost != $maxcost) { + $cm = get_module_setting("charmcost"); + output("(%s %s for %s charm)", $cm, translate_inline($cm==1?"gem":"gems"), get_module_setting("charmgain")); + } + output_notl("`n"); + } + if (get_module_setting("ismax") == 1) { + rawoutput(""); + output("Vitality"); + if ($mincost != $maxcost) { + $cm = get_module_setting("maxcost"); + $hm = get_module_setting("vitalgain"); + $hptype = "permanent"; + if (!get_module_setting("carrydk") || + (is_module_active("globalhp") && + !get_module_setting("carrydk", "globalhp"))) + $hptype = "temporary"; + $hptype = translate_inline($hptype); + + output("(%s %s for %s %s max %s)", $cm, + translate_inline($cm==1?"gem":"gems"), $hm, + $hptype, + translate_inline($hm==1?"hitpoint":"hitpoints")); + } + output_notl("`n"); + } + if (get_module_setting("istemp") == 1) { + rawoutput(""); + output("Health"); + if ($mincost != $maxcost) { + $cm = get_module_setting("tempcost"); + $hm = get_module_setting("tempgain"); + output("(%s %s for %s %s)", $cm, translate_inline($cm==1?"gem":"gems"), $hm, translate_inline($hm == 1? "hitpoint":"hitpoints")); + } + output_notl("`n"); + } + if (get_module_setting("isforget") == 1) { + rawoutput(""); + output("Forgetfulness"); + if ($mincost != $maxcost) { + $cm = get_module_setting("forgcost"); + output_notl("(%s %s)", $cm, translate_inline($cm==1?"gem":"gems")); + } + output_notl("`n"); + } + if (get_module_setting("istrans") == 1) { + rawoutput(""); + output("Transmutation"); + if ($mincost != $maxcost) { + $cm = get_module_setting("transcost"); + output_notl("(%s %s)", $cm, translate_inline($cm==1?"gem":"gems")); + } + output_notl("`n"); + } + rawoutput(""); + }else{ + $gemcount = abs((int)$gemcount); + if ($gemcount>$session['user']['gems']){ + output("%s`0 stares at you blankly.",$barkeep); + output("\"`%You don't have that many gems, `bgo get some more gems!`b`0\" he says."); + }else{ + output("`#You place %s %s on the counter.", $gemcount, translate_inline($gemcount==1?"gem":"gems")); + if (($wish == 4 || $wish == 5) && $gemcount > $cost) { + output("%s`0, feeling sorry for you, prevents you from paying for multiple doses of a potion that only needs a single dose.",$barkeep); + $gemcount = $cost; + } + $strength = ($gemcount/$cost); + if(!is_integer($strength)){ + output("%s`0, knowing about your fundamental misunderstanding of math, hands some of them back to you.",$barkeep); + $strength = floor($strength); + $gemcount=($strength * $cost); + } + if ($gemcount>0) { + output("You drink the potion %s`0 hands you in exchange for your %s, and.....`n`n",$barkeep, translate_inline($gemcount==1?"gem":"gems")); + $session['user']['gems']-=$gemcount; + switch($wish){ + case 1: + $session['user']['charm'] += ($strength * + get_module_setting("charmgain")); + output("`&You feel charming!"); + output("`^(You gain %s charm %s.)", + $strength*get_module_setting("charmgain"), + translate_inline($strength * + get_module_setting("charmgain")==1 ? + "point" : "points")); + $potiontype = "charm"; + break; + case 2: + $session['user']['maxhitpoints'] += + ($strength*get_module_setting("vitalgain")); + $session['user']['hitpoints'] += + ($strength*get_module_setting("vitalgain")); + output("`&You feel vigorous!"); + $hptype = "permanently"; + if (!get_module_setting("carrydk") || + (is_module_active("globalhp") && + !get_module_setting("carrydk", "globalhp"))) + $hptype = "temporarily"; + $hptype = translate_inline($hptype); + + output("`^(You %s gain %s max %s.)", $hptype, + $strength * get_module_setting("vitalgain"), + translate_inline($strength * + get_module_setting("vitalgain") == 1 ? + "hitpoint" : "hitpoints")); + $potiontype = "vitality"; + set_module_pref("extrahps", + get_module_pref("extrahps") + + ($strength * get_module_setting("vitalgain"))); + break; + case 3: + if ($session['user']['hitpoints'] < + $session['user']['maxhitpoints']) + $session['user']['hitpoints'] = + $session['user']['maxhitpoints']; + $session['user']['hitpoints'] += + ($strength * get_module_setting("tempgain")); + output("`&You feel healthy!"); + output("`^(You gain %s temporary %s.)", + $strength * get_module_setting("tempgain"), + translate_inline($strength * + get_module_setting("tempgain") == 1 ? + "hitpoint" : "hitpoints")); + $potiontype = "health"; + break; + case 4: + $session['user']['specialty']=""; + output("`&You feel completely directionless in life."); + output("You should rest and make some important decisions about your life!"); + output("`^(Your specialty has been reset.)"); + $potiontype = "forgetfulness"; + break; + case 5: + $session['user']['race']=RACE_UNKNOWN; + output("`@You double over retching from the effects of transformation potion as your bones turn to gelatin!`n"); + output("`^(Your race has been reset and you will be able to chose a new one tomorrow.)"); + strip_buff('racialbenefit'); + $potiontype = "transmutation"; + if (isset($session['bufflist']['transmute'])) { + $session['bufflist']['transmute']['rounds'] += get_module_setting("transmuteturns"); + } else { + apply_buff('transmute', + array("name"=>"`6Transmutation Sickness", + "rounds"=>get_module_setting("transmuteturns"), + "wearoff"=>"You stop puking your guts up. Literally.", + "atkmod"=>get_module_setting("atkmod"), + "defmod"=>get_module_setting("defmod"), + "roundmsg"=>"Bits of skin and bone reshape themselves like wax.", + "survivenewday"=>get_module_setting("survive"), + "newdaymessage"=>"`6Due to the effects of the Transmutation Potion, you still feel `2ill`6.", + "schema"=>"module-cedrikspotions" + ) + ); + } + break; + } + debuglog("used $gemcount gems on $potiontype potions"); + }else{ + output("`n`nYou feel as though your gems would be better used elsewhere, not on some smelly potion."); + } + } + } + addnav("I?Return to the Inn","inn.php"); + villagenav(); + } + rawoutput(""); + page_footer(); +} +?> diff --git a/lotgd-web/lotgd/modules/crazyaudrey.php b/lotgd-web/lotgd/modules/crazyaudrey.php new file mode 100755 index 0000000..7a93e88 --- /dev/null +++ b/lotgd-web/lotgd/modules/crazyaudrey.php @@ -0,0 +1,273 @@ +"Crazy Audrey's Petting Zoo", + "version"=>"1.1", + "author"=>"Eric Stevens", + "category"=>"Forest Specials", + "download"=>"core_module", + "settings"=>array( + "Crazy Audrey Settings,title", + "cost"=>"Cost to pet,int|5", + "animal"=>"Name of animal (should be singular)|Kitten", + "animals"=>"Plural name of animal|Kittens", + "lanimal"=>"Lowercase name of animal (should be singular)|kitten", + "lanimals"=>"Lowercase plural name of animal|kittens", + "The last ones only need to be different for languages which do not capitalize nouns,note", + "sound"=>"Sound that animal makes|mew", + "buffname"=>"Name of buff from animal|Warm Fuzzies", + "gamedaysremaining"=>"How many game days should the animal remain? (set to -1 for indefinite),int|-1", + "defaultanimal"=>"Name of default animal (should be singular)|Kitten", + "defaultanimals"=>"Plural name of default animal|Kittens", + "defaultsound"=>"Sound that default animal makes|mew", + "defaultbuffname"=>"Name of buff from default animal|Warm Fuzzies", + "profit"=>"How much profit has Audrey made?,int|5", + "villagepercent"=>"How often will you see Crazy Audrey sitting in the village square?,range,0,100,1|20", + + ), + "prefs"=>array( + "Crazy Audrey User Preferences,title", + "played"=>"Played Baskets Today?,bool|0", + ) + ); + return $info; +} + +function crazyaudrey_install(){ + module_addhook("village"); + module_addhook("village-desc"); + module_addhook("newday"); + module_addhook("newday-runonce"); + module_addeventhook("forest", "return 100;"); + return true; +} + +function crazyaudrey_uninstall(){ + return true; +} + +function crazyaudrey_dohook($hookname,$args){ + global $session; + $animals = get_module_setting("animals"); + $lcanimals = get_module_setting("lanimals"); + switch($hookname){ + case "village-desc": + if (e_rand(1, 100) <= get_module_setting("villagepercent")) { + output("`n`%Crazy Audrey is here with her `#%s`%!`n",$lcanimals); + $args['doaudrey'] = 1; + } + + case "village": + if (!array_key_exists("doaudrey",$args)) $args['doaudrey'] = false; + if ($args['doaudrey']) { + $cost = get_module_setting("cost"); + // And since the capital can change the texts + tlschema($args['schemas']['marketnav']); + addnav($args["marketnav"]); + tlschema(); + addnav(array(" ?Pet Crazy Audrey's %s`0 (`^%s gold`0)",$animals,$cost),"runmodule.php?module=crazyaudrey&op=pet"); + } + break; + case "newday": + set_module_pref("played",0); + break; + case "newday-runonce": + $daysremaining=get_module_setting("gamedaysremaining"); + if ($daysremaining>0){ + $daysremaining -= 1; + set_module_setting("gamedaysremaining",$daysremaining); + } + if($daysremaining==0){ + //This is intentionally not an elseif + set_module_setting("animal",get_module_setting("defaultanimal")); + set_module_setting("animals",get_module_setting("defaultanimals")); + set_module_setting("sound",get_module_setting("defaultsound")); + set_module_setting("buffname",get_module_setting("defaultbuffname")); + set_module_setting("gamedaysremaining",-1); + } + break; + + } + return $args; +} + +function crazyaudrey_runevent($type) +{ + // We act the same for all event types + crazyaudrey_baskets($type); +} + +function crazyaudrey_baskets($type) +{ + global $session; + + $from = "runmodule.php?module=crazyaudrey&"; + if ($type == "forest") + $from = "forest.php?"; + + if ($type == "forest") { + $session['user']['specialinc'] = "module:crazyaudrey"; + } + + $animal = get_module_setting("animal"); + $lcanimal = get_module_setting("lanimal"); + $lcplural = get_module_setting("lanimals"); + $sound = get_module_setting("sound"); + + $op = httpget('op'); + if ($op == "" || $op == "search" || $op == "baskets") { + if ($op == "baskets") { + output("`5You reach for the lid of one of Crazy Audrey's baskets when you think she is distracted, when out of nowhere, Crazy Audrey appears, ranting feverishly about colored %s, and pulls the baskets to her.`n`n", $lcplural); + } elseif ($type == "forest") { + output("`5You stumble across a clearing that is oddly quiet."); + output("To one side are three baskets, tightly lidded."); + output("Finding this curious, you cautiously approach them when you hear the faint %s`5 of a %s`5.", $sound, $lcanimal); + output("You reach for the lid of the first basket when out of nowhere, Crazy Audrey appears, ranting feverishly about colored %s`5, and pulls the baskets to her.`n`n", $lcplural); + } + output("Taken somewhat aback, you decide you had best question her about these %s.`n`n", $lcplural); + output("\"`#Tell me, good woman,`5\" you begin...`n`n"); + output("\"`%GOOD GOOD good good goodgoodgoodgoodgood...`5\" Audrey begins to repeat."); + output("Unflustered, you persist.`n`n"); + output("\"`#What are these %s`# you speak of?`5\"`n`n", $lcplural); + output("Amazingly, Crazy Audrey suddenly grows quiet and begins to speak in a regal accent both melodious and soft.`n`n"); + output("\"`%Of these baskets, have I three,`n"); + output("Four %s`% inside each there do be.`n`n", $lcplural); + output("Minds of their own, do they have,`n"); + output("Should two alike emerge, you'll get this salve.`n`n"); + output("Energy it gives, to fight your foes,`n"); + output("Merely rub it 'tween your toes.`n`n"); + output("Should no two alike show their head,`n"); + output("Earlier today, you'll see your bed.`n`n"); + output("That then is my proposition,`n"); + output("Shall thou take it, or from me run?`5\"`n`n"); + output("Will you play her game?"); + addnav("Play",$from."op=play"); + addnav("Run away from Crazy Audrey",$from."op=run"); + }else if($op=="run"){ + output("`5You run, very quickly, away from this mad woman."); + }else if($op=="play"){ + if ($type == "module-internal") { + set_module_pref("played",1); + } + $colors = array("`^C`&a`Ql`6i`7c`qo","`7T`&i`7g`&e`7r","`QGinger","`&White","`^`bHedgehog!`b"); + $colors = translate_inline($colors); + $c1 = e_rand(0,3); + $c2 = e_rand(0,3); + $c3 = e_rand(0,3); + if (e_rand(1,20)==1) { + $c1=4; $c2=4; $c3=4; + } + output("`5You agree to Crazy Audrey's preposterous game and she thumps the first basket on the lid."); + + if ($c1 == 4) { + output("A %s`5 peeks its head out.`n`n", $colors[$c1]); + } else { + output("A %s`5 %s`5 peeks its head out.`n`n", $colors[$c1], $lcanimal); + } + if ($c2 == 4) { + output("Crazy Audrey then thumps the second basket on the lid, and a %s`5 peeks its head out.`n`n", $colors[$c2]); + } else { + output("Crazy Audrey then thumps the second basket on the lid, and a %s`5 %s`5 peeks its head out.`n`n", $colors[$c2], $lcanimal); + } + if ($c3 == 4) { + output("She thumps the third basket on the lid, and a %s`5 hops out and bounds up to Crazy Audrey's shoulder.`n`n", $colors[$c3]); + } else { + output("She thumps the third basket on the lid, and a %s`5 %s`5 hops out and bounds up to Crazy Audrey's shoulder.`n`n", $colors[$c3], $lcanimal); + } + + if ($c1==$c2 && $c2==$c3){ + if ($c1==4){ + $where = translate_inline($type=="forest"?"forest":"crowd"); + output("\"`%Hedgehogs? HEDGEHOGS?? Hahahahaha, HEDGEHOGS!!!!`5\" shouts Crazy Audrey as she snatches them up in glee and runs cheering into the %s.", $where); + output("You notice that she has dropped a full BAG of those wonderful salves.`n`n"); + output("`^You gain FIVE forest fights!"); + $session['user']['turns']+=5; + }else{ + output("\"`%Argh, you are ALL very bad %s`%!`5\" shouts Crazy Audrey before hugging her shoulder %s`5 and putting it back in the basket.", $lcplural, $lcanimal); + output("\"`%Because my %s`% all were alike, I grant you TWO salves.`5\"`n`n", $lcplural); + output("You rub the salves on your toes.`n`n"); + output("`^You gain TWO forest fights!"); + $session['user']['turns']+=2; + } + }elseif ($c1==$c2 || $c2==$c3 || $c1==$c3){ + output("\"`%Garr, you crazy %s`%, what do you know? Why I ought to paint you all different colors!`5\"", $lcplural); + output("Despite her threatening words, Crazy Audrey pets the %s`5 on her shoulder and places it back in the basket, before giving you your salve, which you rub all over your toes.`n`n", $lcanimal); + output("`^You gain a forest fight!"); + $session['user']['turns']++; + }else{ + output("\"`%Well done my pretties!`5\" shouts Crazy Audrey."); + output("Just then her shoulder-mounted %s`5 leaps at you.", $lcanimal); + if ($session['user']['turns'] > 0) { + output("In fending it off, you lose some energy."); + $msg = "`^You lose a forest fight!"; + $session['user']['turns']--; + } else { + output("In fending it off, you get a nasty scratch along one side of your face."); + $msg = "`^You lose a charm point!"; + if ($session['user']['charm'] > 0) + $session['user']['charm']--; + } + output("Finally it hops back in its basket and all is quiet."); + output("Crazy Audrey cackles quietly and looks at you.`n`n"); + output($msg); + } + } + + if ($op == "run" || $op=="play") { + if ($type == "forest") { + $session['user']['specialinc'] = ""; + } + } +} + +function crazyaudrey_run(){ + global $session; + $op = httpget('op'); + if ($op=="pet"){ + page_header("Crazy Audrey's Zoo"); + $cost = get_module_setting("cost"); + $animal = get_module_setting("animal"); + $lcanimal = get_module_setting("lanimal"); + $plural = get_module_setting("animals"); + $lcplural = get_module_setting("lanimals"); + $profit = get_module_setting("profit"); + output("`5You cautiously approach Crazy Audrey."); + output("Next to her is a sign that reads, \"`#%s gold to pet %s`#,`5\" and a basket filled with `^%s`5 gold!",$cost,$lcplural,$profit); + if ($session['user']['gold']>=$cost){ + output("You place your `^%s`5 gold in the basket, and spend a few minutes petting one of the %s`5.", $cost, $lcplural); + output("Soon though, Crazy Audrey chases you off, and you stand at a distance admiring the %s`5.",$lcplural); + $session['user']['gold']-=$cost; + debuglog("spent $cost gold to pet audrey's pets"); + $profit += $cost; + set_module_setting("profit",$profit); + $buffname = get_module_setting("buffname"); + apply_buff('crazyaudrey',array("name"=>$buffname,"rounds"=>5,"activate"=>"defense","defmod"=>1.05, "schema"=>"module-crazyaudrey")); + output("`5After a few minutes, you once again try to approach in order to look into her baskets."); + if (get_module_pref("played")==0) { + addnav("Look at Crazy Audrey's baskets","runmodule.php?module=crazyaudrey&op=baskets"); + } else { + output("`5As you approach closer, Crazy Audrey looks up and screams at you. \"`%Hey!! I recognize you! You've already played with my %s`% today! Get away from here, you pervy %s`% fancier!`5\"", $lcplural, $lcanimal); + output("You quickly step back and admire the %s`5 from a safe distance.", $lcplural); + } + }else{ + output("Not having `^%s`5 gold, you wander sadly away.",$cost); + } + }elseif ($op=="baskets" || $op == "play" || $op == "run"){ + page_header("Crazy Audrey"); + crazyaudrey_baskets("module-internal", + "runmodule.php?module=crazyaudrey"); + } + if ($op != "baskets") { + require_once("lib/villagenav.php"); + villagenav(); + } + page_footer(); +} +?> diff --git a/lotgd-web/lotgd/modules/dag.php b/lotgd-web/lotgd/modules/dag.php new file mode 100755 index 0000000..85d70ab --- /dev/null +++ b/lotgd-web/lotgd/modules/dag.php @@ -0,0 +1,56 @@ +"Dag Durnick Bounties", + "author"=>"Darrel Morrone
Updates by Andrew Senger, JT Traub, and Eric Stevens", + "version"=>"1.3", + "category"=>"Inn", + "download"=>"core_module", + "settings"=>array( + "Dag Durnick Bounty Settings,title", + "bountymin"=>"Minimum amount per level of target for bounty,int|50", + "bountymax"=>"Maximum amount per level of target for bounty,int|200", + "bountylevel"=>"Minimum player level for being a bounty target,int|3", + "bountyfee"=>"Percentage of bounty kept by Dag Durnick,int|10", + "maxbounties"=>"How many bounties can a person set per day,int|5" + ), + "prefs"=>array( + "Dag Durnick Bounty User Preferences,title", + "bounties"=>"Bounties set today,int|0" + ) + ); + return $info; +} + +function dag_install(){ + require_once("modules/dag/install.php"); + $args = func_get_args(); + return call_user_func_array("dag_install_private",$args); +} + +function dag_uninstall(){ + output("Dropping bounty table"); + $sql = "DROP TABLE IF EXISTS " . db_prefix("bounty"); + db_query($sql); + return true; +} + +function dag_dohook($hookname, $args){ + require_once("modules/dag/dohook.php"); + $args = func_get_args(); + return call_user_func_array("dag_dohook_private",$args); +} + +function dag_run(){ + require_once("modules/dag/run.php"); + $args = func_get_args(); + return call_user_func_array("dag_run_private",$args); +} +?> diff --git a/lotgd-web/lotgd/modules/dag/dohook.php b/lotgd-web/lotgd/modules/dag/dohook.php new file mode 100755 index 0000000..b89a8e2 --- /dev/null +++ b/lotgd-web/lotgd/modules/dag/dohook.php @@ -0,0 +1,64 @@ + diff --git a/lotgd-web/lotgd/modules/dag/install.php b/lotgd-web/lotgd/modules/dag/install.php new file mode 100755 index 0000000..170f9dc --- /dev/null +++ b/lotgd-web/lotgd/modules/dag/install.php @@ -0,0 +1,72 @@ + 0"; + debug("The bounty column was found in your accounts table, migrating its values to the bounty table.`n"); + db_query($sql); + debug("Dropping accounts column from the user table.`n"); + $sql = "ALTER TABLE " . db_prefix("accounts") . " DROP bounty"; + db_query($sql); + //drop it from the user's session too. + unset($session['user']['bounty']); + }elseif ($row['Field']=="bounties"){ + $sql = "SELECT bounties,acctid FROM " . db_prefix("accounts") . " WHERE bounties>0"; + $result1 = db_query($sql); + debug("Migrating bounty counts.`n"); + while ($row1 = db_fetch_assoc($result1)){ + $sql = "INSERT INTO " . db_prefix("module_userprefs") . " (modulename,setting,userid,value) VALUES ('dag','bounties',{$row1['acctid']},{$row1['bounties']})"; + db_query($sql); + }//end while + debug("Dropping bounty count from the user table.`n"); + $sql = "ALTER TABLE " . db_prefix("accounts") . " DROP bounties"; + db_query($sql); + //drop it from the user's session too. + unset($session['user']['bounties']); + }//end if + }//end while + return true; +} \ No newline at end of file diff --git a/lotgd-web/lotgd/modules/dag/misc_functions.php b/lotgd-web/lotgd/modules/dag/misc_functions.php new file mode 100755 index 0000000..70e30cc --- /dev/null +++ b/lotgd-web/lotgd/modules/dag/misc_functions.php @@ -0,0 +1,546 @@ + $y['Amount']) { + return -1; + } elseif ($x['Amount'] < $y['Amount']) { + return 1; + } +} + +function dag_sortbountieslevel($x, $y) { + if ($x['Level'] == $y['Level']) { + return dag_sortbounties($x, $y); + } elseif ($x['Level'] > $y['Level']) { + return -1; + } elseif ($x['Level'] < $y['Level']) { + return 1; + } +} + +function dag_manage(){ + page_header("Dag's Bounty Lists"); + require_once("lib/superusernav.php"); + superusernav(); + + // Add some bounty expiration for closed bounties + $sql = "DELETE FROM " . db_prefix("bounty") . " WHERE status=1 AND windate <'".date("Y-m-d H:i:s",strtotime("-".(getsetting("expirecontent",180)/10)." days"))."'"; + db_query($sql); + + addnav("Actions"); + addnav("A?View All Bounties","runmodule.php?module=dag&manage=true&op=viewbounties&type=1&sort=1&dir=1&admin=true"); + addnav("O?View Open Bounties","runmodule.php?module=dag&manage=true&op=viewbounties&type=2&sort=1&dir=1&admin=true"); + addnav("C?View Closed Bounties","runmodule.php?module=dag&manage=true&op=viewbounties&type=3&sort=1&dir=1&admin=true"); + addnav("R?Refresh List","runmodule.php?module=dag&manage=true&admin=true"); + + rawoutput("
"); + addnav("","runmodule.php?module=dag&manage=true&op=viewbounties&type=search&admin=true"); + output("Setter: "); + rawoutput(""); + output(" Winner: "); + rawoutput(""); + output(" Target: "); + rawoutput(""); + output_notl("`n"); + output("Order by: "); + $id = translate_inline("ID"); + $amt = translate_inline("Amount"); + $targ = translate_inline("Target"); + $set = translate_inline("Setter"); + $sdate = translate_inline("Set Date"); + $stat = translate_inline("Status"); + $win = translate_inline("Winner"); + $wdate = translate_inline("Win Date"); + $desc = translate_inline("Descending"); + $asc = translate_inline("Ascending"); + $search = translate_inline("Search"); + rawoutput(""); + rawoutput(" $desc"); + rawoutput(" $asc"); + output_notl("`n"); + rawoutput(""); + rawoutput("
"); + + $op = httpget('op'); + if ($op == "") { + // ***ADDED*** + // By Andrew Senger + // Adding for new Bounty Code + output_notl("`n`n"); + output("`c`bThe Bounty List`b`c`n"); + $sql = "SELECT bountyid,amount,target,setter,setdate FROM " . db_prefix("bounty") . " WHERE status=0 ORDER BY bountyid ASC"; + $result = db_query($sql); + rawoutput(""); + $amt = translate_inline("Amount"); + $lev = translate_inline("Level"); + $name = translate_inline("Name"); + $loc = translate_inline("Location"); + $sex = translate_inline("Sex"); + $alive = translate_inline("Alive"); + $last = translate_inline("Last On"); + rawoutput(""); + $listing = array(); + $totlist = 0; + for($i=0;$i$amount,'Level'=>$row2['level'],'Name'=>$row2['name'],'Location'=>$row2['location'],'Sex'=>$row2['sex'],'Alive'=>$row2['alive'],'LastOn'=>$row2['laston']); + $totlist = $totlist + 1; + } + } + usort($listing, 'dag_sortbounties'); + for($i=0;$i<$totlist;$i++) { + rawoutput(""); + } + rawoutput("
$amt$lev$name$loc$sex$alive$last
"); + output_notl("`^%s`0", $listing[$i]['Amount']); + rawoutput(""); + output_notl("`^%s`0", $listing[$i]['Level']); + rawoutput(""); + output_notl("`^%s`0", $listing[$i]['Name']); + rawoutput(""); + output($loggedin ? "`#Online`0" : $listing[$i]['Location']); + rawoutput(""); + output($listing[$i]['Sex']?"`!Female`0":"`!Male`0"); + rawoutput(""); + output($listing[$i]['Alive']?"`1Yes`0":"`4No`0"); + rawoutput(""); + $laston= relativedate($listing[$i]['LastOn']); + if ($loggedin) $laston=translate_inline("Now"); + output_notl("%s", $laston); + rawoutput("
"); + output("`n`n`c`bAdd Bounty`b`c`n"); + rawoutput("
"); + output("`2Target: "); + rawoutput(""); + output_notl("`n"); + output("`2Amount to Place: "); + rawoutput(""); + output_notl("`n`n"); + $final = translate_inline("Finalize Contract"); + rawoutput(""); + rawoutput("
"); + addnav("","runmodule.php?module=dag&manage=true&op=addbounty&admin=true"); + }else if ($op == "addbounty") { + if (httpget('subfinal')==1){ + $sql = "SELECT acctid,name,login,level,locked,age,dragonkills,pk,experience FROM " . db_prefix("accounts") . " WHERE name='".addslashes(rawurldecode(stripslashes(httppost('contractname'))))."' AND locked=0"; + }else{ + $contractname = stripslashes(rawurldecode(httppost('contractname'))); + $name="%"; + for ($x=0;$x 100) { + output("Too many names!"); + } elseif(db_num_rows($result) > 1) { + output("Select the correct name:`n"); + rawoutput("
"); + output("`2Target: "); + rawoutput(""); + output_notl("`n`n"); + $amount = httppost('amount'); + output("`2Amount to Place: "); + rawoutput(""); + output_notl("`n`n"); + $final = translate_inline("Finalize Contract"); + rawoutput(""); + rawoutput("
"); + addnav("","runmodule.php?module=dag&manage=true&op=addbounty&subfinal=1"); + } else { + // Now, we have just the one, so check it. + $row = db_fetch_assoc($result); + if ($row['locked']) { + output("Target is a locked user."); + } + $amt = (int)httppost('amount'); + if ($amt <= 0) { + output("That bounty value make no sense."); + } else { + // All good! + $sql = "INSERT INTO " . db_prefix("bounty") . " (amount, target, setter, setdate) VALUES ($amt, ".$row['acctid'].", 0, '".date("Y-m-d H:i:s")."')"; + db_query($sql); + output("Bounty added!"); + } + } + } else if ($op == "viewbounties") { + $type = httpget('type'); + $sort = httpget('sort'); + $dir = httpget('dir'); + output("`c`bThe Bounty List`b`c`n"); + if ($type == 1) { + output("`c`bViewing: `3All Bounties`b`c"); + }elseif ($type == 2) { + output("`c`bViewing: `3Open Bounties`b`c"); + }elseif ($type == 3) { + output("`c`bViewing: `3Closed Bounties`b`c"); + } + addnav("Sorting"); + + if (($sort == 1) && ($dir == 1)) { + addnav("1?By BountyID - Asc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=1&dir=2&admin=true"); + output("`c`bSorting By: `3BountyID - Desc`b`c`n`n"); + }elseif (($sort == 1) && ($dir == 2)) { + addnav("1?By BountyID - Desc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=1&dir=1&admin=true"); + output("`c`bSorting By: `3BountyID - Asc`b`c`n`n"); + }else { + addnav("1?By BountyID - Desc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=1&dir=1&admin=true"); + } + if (($sort == 2) && ($dir == 1)) { + addnav("2?By Amount - Asc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=2&dir=2&admin=true"); + output("`c`bSorting By: `3Amount - Desc`b`c`n`n"); + }elseif (($sort == 2) && ($dir == 2)) { + addnav("2?By Amount - Desc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=2&dir=1&admin=true"); + output("`c`bSorting By: `3Amount - Asc`b`c`n`n"); + }else { + addnav("2?By Amount - Desc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=2&dir=1&admin=true"); + } + if (($sort == 3) && ($dir == 1)) { + addnav("3?By Target - Asc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=3&dir=2&admin=true"); + output("`c`bSorting By: `3Target - Desc`b`c`n`n"); + }elseif (($sort == 3) && ($dir == 2)) { + addnav("3?By Target - Desc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=3&dir=1&admin=true"); + output("`c`bSorting By: `3Target - Asc`b`c`n`n"); + }else { + addnav("3?By Target - Desc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=3&dir=1&admin=true"); + } + if (($sort == 4) && ($dir == 1)) { + addnav("4?By Setter - Asc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=4&dir=2&admin=true"); + output("`c`bSorting By: `3Setter - Desc`b`c`n`n"); + }elseif (($sort == 4) && ($dir == 2)) { + addnav("4?By Setter - Desc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=4&dir=1&admin=true"); + output("`c`bSorting By: `3Setter - Asc`b`c`n`n"); + }else { + addnav("4?By Setter - Desc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=4&dir=1&admin=true"); + } + if (($sort == 5) && ($dir == 1)) { + addnav("5?By Set Date - Asc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=5&dir=2&admin=true"); + output("`c`bSorting By: `3Set Date - Desc`b`c`n`n"); + }elseif (($sort == 5) && ($dir == 2)) { + addnav("5?By Set Date - Desc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=5&dir=1&admin=true"); + output("`c`bSorting By: `3Set Date - Asc`b`c`n`n"); + }else { + addnav("5?By Set Date - Desc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=5&dir=1&admin=true"); + } + if ($type == 1) { + if (($sort == 6) && ($dir == 1)) { + addnav("6?By Status - Asc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=6&dir=2&admin=true"); + output("`c`bSorting By: `3Status - Desc`b`c`n`n"); + }elseif (($sort == 6) && ($dir == 2)) { + addnav("6?By Status - Desc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=6&dir=1&admin=true"); + output("`c`bSorting By: `3Status - Asc`b`c`n`n"); + }else { + addnav("6?By Status - Desc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=6&dir=1&admin=true"); + } + } + if (($type == 1) || ($type == 3)) { + if (($sort == 7) && ($dir == 1)) { + addnav("7?By Winner - Asc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=7&dir=2&admin=true"); + output("`c`bSorting By: `3Winner - Desc`b`c`n`n"); + }elseif (($sort == 7) && ($dir == 2)) { + addnav("7?By Winner - Desc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=7&dir=1&admin=true"); + output("`c`bSorting By: `3Winner - Asc`b`c`n`n"); + }else { + addnav("7?By Winner - Desc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=7&dir=1&admin=true"); + } + + if (($sort == 8) && ($dir == 1)) { + addnav("8?By Win Date - Asc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=8&dir=2&admin=true"); + output("`c`bSorting By: `3Win Date - Desc`b`c`n`n"); + }elseif (($sort == 8) && ($dir == 2)) { + addnav("8?By Win Date - Desc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=8&dir=1&admin=true"); + output("`c`bSorting By: `3Win Date - Asc`b`c`n`n"); + }else { + addnav("8?By Win Date - Desc","runmodule.php?module=dag&manage=true&op=viewbounties&type=".$type."&sort=8&dir=1&admin=true"); + } + } + addnav("Return to Bounty Home","runmodule.php?module=dag&manage=true&op=bounties&admin=true"); + switch ($type) { + case 1: + $t = ""; + break; + case 2: + $t = " WHERE status=0"; + break; + case 3: + $t = " WHERE status=1"; + break; + } + switch ($sort) { + case 1: + $s = " ORDER BY bountyid"; + break; + case 2: + $s = " ORDER BY amount"; + break; + case 3: + $s = " ORDER BY target"; + break; + case 4: + $s = " ORDER BY setter"; + break; + case 5: + $s = " ORDER BY setdate"; + break; + case 6: + $s = " ORDER BY status"; + break; + case 7: + $s = " ORDER BY winner"; + break; + case 8: + $s = " ORDER BY windate"; + break; + } + switch ($dir) { + case 1: + $d = " DESC"; + break; + case 2: + $d = " ASC"; + break; + } + //override those options in favor of the search form if it exists + if ($type=='search'){ + switch(httppost('s')){ + case 1: $s = " ORDER BY bountyid"; break; + case 2: $s = " ORDER BY amount"; break; + case 3: $s = " ORDER BY target"; break; + case 4: $s = " ORDER BY setter"; break; + case 5: $s = " ORDER BY setdate"; break; + case 6: $s = " ORDER BY status"; break; + case 7: $s = " ORDER BY winner"; break; + case 8: $s = " ORDER BY windate"; break; + } + switch(httppost('d')){ + case 1: $d = " DESC"; break; + case 2: $d = " ASC"; break; + } + $t = ""; + if (httppost('setter')>'') { + if ($t>"") $t.=" AND"; + $a = httppost('setter'); + $setter = "%"; + for ($i=0;$i'') { + if ($t>"") $t.=" AND"; + $a = httppost('getter'); + $getter = "%"; + for ($i=0;$i'') { + if ($t>"") $t.=" AND"; + $a = httppost('target'); + $target = "%"; + for ($i=0;$i"") $t = " WHERE".$t; + } + $sql = "SELECT bountyid,amount,target,setter,setdate,status,winner,windate FROM " . db_prefix("bounty").$t.$s.$d; + $result = db_query($sql); + rawoutput(""); + $id = translate_inline("ID"); + $amt = translate_inline("Amt"); + $targ = translate_inline("Target"); + $set = translate_inline("Setter"); + $sdate = translate_inline("Set Date/Time"); + $stat = translate_inline("Status"); + $win = translate_inline("Winner"); + $wdate = translate_inline("Win Date/Time"); + $ops = translate_inline("Ops"); + + rawoutput(""); + for($i=0;$i"); + } + rawoutput("
$id$amt$targ$set$sdate$stat$win$wdate$ops
"); + output_notl("`^%s`0", $row['bountyid']); + rawoutput(""); + output_notl("`^%s`0", $row['amount']); + rawoutput(""); + output_notl("`&%s`0", $target['name']); + rawoutput(""); + output_notl("`^%s`0", $setter['name']); + rawoutput(""); + output_notl("`^%s`0", $row['setdate']); + rawoutput(""); + output($row['status']==0?"`^Open`0":"`^Closed`0"); + rawoutput(""); + output_notl("`^%s`0", $winner['name']); + rawoutput(""); + output_notl("`^%s`0", $row['status']?$row['windate']:""); + rawoutput(""); + if ($row['status'] == 0) { + $link = "runmodule.php?module=dag&manage=true&op=closebounty&id={$row['bountyid']}&admin=true"; + $close = translate_inline("Close"); + rawoutput("$close"); + addnav("",$link); + } else { + rawoutput(" "); + } + rawoutput("
"); + } else if ($op == "closebounty") { + $windate = date("Y-m-d H:i:s"); + $bountyid = (int)httpget('id'); + $sql = "UPDATE " . db_prefix("bounty") . " SET status=1,winner=0,windate=\"$windate\" WHERE bountyid=$bountyid"; + db_query($sql); + output("Bounty closed."); + // ***END ADD*** + } + page_footer(); +} + +function dag_pvpwin($args){ + global $badguy,$session; + // ***ADDED*** + // By Andrew Senger + // Added for Bounty Code + // Bounty Check - Andrew Senger + // Check for Bounty + $sql = "SELECT bountyid,amount,setter FROM " . db_prefix("bounty") . " WHERE status=0 AND setdate<='".date("Y-m-d H:i:s")."' AND target=".$badguy['acctid']; + $result = db_query($sql); + if (db_num_rows($result) > 0) { + $totgoodamt = 0; + $totbadamt = 0; + for($i=0;$i 0) { + output("\"`#I'm keeping `^%s`# of the total bounty on this soul's head, as ye' be the one that set it.`@\"", $totbadamt); + } + } + // End Check for Bounty + // Add Bounty Gold + if ($totgoodamt > 0) { + $session['user']['gold']+=$totgoodamt; + debuglog("gained ".$totgoodamt." gold bounty for killing ", $badguy['acctid']); + } + // End Add Bounty Gold + // Add Bounty Kill to News + if ($totgoodamt > 0) { + addnews("`4%s`3 collected `4%s`3 gold bounty by turning in `4%s`3's head!",$session['user']['name'],$totgoodamt,$badguy['creaturename']); + } + // End Add Bounty Kill to News + // End Bounty Check - Andrew + // ***END ADD*** + if ($totgoodamt > 0) { + $args['pvpmessageadd'] .= sprintf_translate("`nThey also received `^%s`2 in bounty gold.`n", $totgoodamt); + rawoutput(tlbutton_clear()); + } + return $args; +} +?> diff --git a/lotgd-web/lotgd/modules/dag/run.php b/lotgd-web/lotgd/modules/dag/run.php new file mode 100755 index 0000000..564c4ad --- /dev/null +++ b/lotgd-web/lotgd/modules/dag/run.php @@ -0,0 +1,245 @@ +",true); + output("`c`bDag Durnick's Table`b`c"); + }else{ + dag_manage(); + } + + $op = httpget('op'); + + addnav("Navigation"); + addnav("I?Return to the Inn","inn.php"); + if ($op != '') + addnav("Talk to Dag Durnick", "runmodule.php?module=dag"); + + if ($op=="list"){ + output("Dag fishes a small leather bound book out from under his cloak, flips through it to a certain page and holds it up for you to see."); + output("\"`7Deese ain't the most recent figgers, I ain't just had time to get th' other numbers put in.`0\"`n`n"); + // ***ADDED*** + // By Andrew Senger + // Added for new Bounty Code + output("`c`bThe Bounty List`b`c`n"); + $sql = "SELECT bountyid,amount,target,setter,setdate FROM " . db_prefix("bounty") . " WHERE status=0 AND setdate<='".date("Y-m-d H:i:s")."' ORDER BY bountyid ASC"; + $result = db_query($sql); + rawoutput(""); + $amount = translate_inline("Amount"); + $level = translate_inline("Level"); + $name = translate_inline("Name"); + $loc = translate_inline("Location"); + $sex = translate_inline("Sex"); + $alive = translate_inline("Alive"); + $last = translate_inline("Last On"); + rawoutput(""); + $listing = array(); + $totlist = 0; + for($i=0;$i$amount,'Level'=>$row2['level'],'Name'=>$row2['name'],'Location'=>$row2['location'],'Sex'=>$row2['sex'],'Alive'=>$row2['alive'],'LastOn'=>$row2['laston'], 'LoggedIn'=>$loggedin); + $totlist = $totlist + 1; + } + } + $sort = httpget("sort"); + if ($sort=="level") + usort($listing, 'dag_sortbountieslevel'); + elseif ($sort != "") + usort($listing, 'dag_sortbounties'); + else + usort($listing, 'dag_sortbountieslevel'); + for($i=0;$i<$totlist;$i++) { + rawoutput(""); + } + rawoutput("
$amount$level$name$loc$sex$alive$last
"); + output_notl("`^%s`0", $listing[$i]['Amount']); + rawoutput(""); + output_notl("`^%s`0", $listing[$i]['Level']); + rawoutput(""); + output_notl("`^%s`0", $listing[$i]['Name']); + rawoutput(""); + output($listing[$i]['LoggedIn']?"`#Online`0":$listing[$i]['Location']); + rawoutput(""); + output($listing[$i]['Sex']?"`!Female`0":"`!Male`0"); + rawoutput(""); + output($listing[$i]['Alive']?"`1Yes`0":"`4No`0"); + rawoutput(""); + $laston = relativedate($listing[$i]['LastOn']); + output_notl("%s", $laston); + rawoutput("
"); + // ***END ADDING*** + }else if ($op=="addbounty"){ + if (get_module_pref("bounties") >= get_module_setting("maxbounties")) { + output("Dag gives you a piercing look."); + output("`7\"Ye be thinkin' I be an assassin or somewhat? Ye already be placin' more than 'nuff bounties for t'day. Now, be ye gone before I stick a bounty on yer head fer annoyin' me.\"`n`n"); + } else { + $fee = get_module_setting("bountyfee"); + if ($fee < 0 || $fee > 100) { + $fee = 10; + set_module_setting("bountyfee",$fee); + } + $min = get_module_setting("bountymin"); + $max = get_module_setting("bountymax"); + output("Dag Durnick glances up at you and adjusts the pipe in his mouth with his teeth.`n"); + output("`7\"So, who ye be wantin' to place a hit on? Just so ye be knowing, they got to be legal to be killin', they got to be at least level %s, and they can't be having too much outstandin' bounty nor be getting hit too frequent like, so if they ain't be listed, they can't be contracted on! We don't run no slaughterhouse here, we run a.....business. Also, there be a %s%% listin' fee fer any hit ye be placin'.\"`n`n", get_module_setting("bountylevel"), get_module_setting("bountyfee")); + rawoutput("
"); + output("`2Target: "); + rawoutput(""); + output_notl("`n"); + output("`2Amount to Place: "); + rawoutput(""); + output_notl("`n`n"); + $final = translate_inline("Finalize Contract"); + rawoutput(""); + rawoutput("
"); + addnav("","runmodule.php?module=dag&op=finalize"); + } + }elseif ($op=="finalize") { + if (httpget('subfinal')==1){ + $sql = "SELECT acctid,name,login,level,locked,age,dragonkills,pk,experience FROM " . db_prefix("accounts") . " WHERE name='".addslashes(rawurldecode(stripslashes(httppost('contractname'))))."' AND locked=0"; + }else{ + $contractname = stripslashes(rawurldecode(httppost('contractname'))); + $name="%"; + for ($x=0;$x 100) { + output("Dag Durnick scratches his head in puzzlement, `7\"Ye be describing near half th' town, ye fool? Why don't ye be giving me a better name now?\""); + } elseif(db_num_rows($result) > 1) { + output("Dag Durnick searches through his list for a moment, `7\"There be a couple of 'em that ye could be talkin' about. Which one ye be meaning?\"`n"); + rawoutput("
"); + output("`2Target: "); + rawoutput(""); + output_notl("`n`n"); + $amount = httppost('amount'); + output("`2Amount to Place: "); + rawoutput(""); + output_notl("`n`n"); + $final = translate_inline("Finalize Contract"); + rawoutput(""); + rawoutput("
"); + addnav("","runmodule.php?module=dag&op=finalize&subfinal=1"); + } else { + // Now, we have just the one, so check it. + $row = db_fetch_assoc($result); + if ($row['locked']) { + output("Dag Durnick sneers at you, `7\"There not be anyone I be knowin' of by that name. Maybe ye should come back when ye got a real target in mind?\""); + } elseif ($row['login'] == $session['user']['login']) { + output("Dag Durnick slaps his knee laughing uproariously, `7\"Ye be wanting to take out a contract on yerself? I ain't be helping no suicider, now!\""); + } elseif ($row['level'] < get_module_setting("bountylevel") || + ($row['age'] < getsetting("pvpimmunity",5) && + $row['dragonkills'] == 0 && $row['pk'] == 0 && + $row['experience'] < getsetting("pvpminexp",1500))) { + output("Dag Durnick stares at you angrily, `7\"I told ye that I not be an assassin. That ain't a target worthy of a bounty. Now get outta me sight!\""); + } else { + // All good! + $amt = abs((int)httppost('amount')); + $min = get_module_setting("bountymin") * $row['level']; + $max = get_module_setting("bountymax") * $row['level']; + $fee = get_module_setting("bountyfee"); + $cost = round($amt*((100+$fee)/100), 0); + $curbounty = 0; + $sql = "SELECT sum(amount) AS total FROM " . db_prefix("bounty") . " WHERE status=0 AND target={$row['acctid']}"; + $result = db_query($sql); + if (db_num_rows($result) > 0) { + $nrow = db_fetch_assoc($result); + $curbounty = $nrow['total']; + } + if ($amt < $min) { + output("Dag Durnick scowls, `7\"Ye think I be workin' for that pittance? Be thinkin' again an come back when ye willing to spend some real coin. That mark be needin' at least %s gold to be worth me time.\"", $min); + } elseif ($session['user']['gold'] < $cost) { + output("Dag Durnick scowls, `7\"Ye don't be havin enough gold to be settin' that contract. Wastin' my time like this, I aught to be puttin' a contract on YE instead!"); + } elseif ($amt + $curbounty > $max) { + if ($curbounty) { + output("Dag looks down at the pile of coin and just leaves them there."); + output("`7\"I'll just be passin' on that contract. That's way more'n `^%s`7 be worth and ye know it. I ain't no durned assassin. A bounty o' %s already be on their head, what with the bounties I ain't figgered in to th' book already. I might be willin' t'up it to %s, after me %s%% listin' fee of course\"`n`n",$row['name'], $curbounty, $max, $fee); + } else { + output("Dag looks down at the pile of coin and just leaves them there."); + output("`7\"I'll just be passin' on that contract. That's way more'n `^%s`7 be worth and ye know it. I ain't no durned assassin. I might be willin' t'let y' set one of %s, after me %s%% listin' fee of course\"`n`n", $row['name'], $max, $fee); + } + } else { + output("You slide the coins towards Dag Durnick, who deftly palms them from the table."); + output("`7\"I'll just be takin' me %s%% listin' fee offa the top. The word be put out that ye be wantin' `^%s`7 taken care of. Be patient, and keep yer eyes on the news.\"`n`n", $fee, $row['name']); + set_module_pref("bounties",get_module_pref("bounties")+1); + $session['user']['gold']-=$cost; + // ***ADDED*** + // By Andrew Senger + // Adding for new Bounty Code + $setdate = time(); + // random set date up to 4 hours in the future. + $setdate += e_rand(0,14400); + $sql = "INSERT INTO ". db_prefix("bounty") . " (amount, target, setter, setdate) VALUES ($amt, ".$row['acctid'].", ".(int)$session['user']['acctid'].", '".date("Y-m-d H:i:s",$setdate)."')"; + db_query($sql); + // ***END ADD*** + debuglog("spent $cost to place a $amt bounty on {$row['name']}"); + } + } + } + }else{ + output("You stroll over to Dag Durnick, who doesn't even bother to look up at you."); + output("He takes a long pull on his pipe.`n"); + output("`7\"Ye probably be wantin' to know if there's a price on yer head, ain't ye.\"`n`n"); + // ***ADDED*** + // By Andrew Senger + // Adding for new Bounty Code + $sql = "SELECT sum(amount) as total FROM " . db_prefix("bounty") . " WHERE status=0 AND setdate<='".date("Y-m-d H:i:s")."' AND target=".$session['user']['acctid']; + $result = db_query($sql); + $curbounty = 0; + if (db_num_rows($result) != 0) { + $row = db_fetch_assoc($result); + $curbounty = $row['total']; + } + if ($curbounty == 0) { + output("\"`3Ye don't have no bounty on ya. I suggest ye be keepin' it that way.\""); + } else { + output("\"`3Well, it be lookin like ye have `^%s gold`3 on yer head currently. Ye might wanna be watchin yourself.\"", $curbounty); + } + // ***END ADD*** + addnav("Bounties"); + addnav("Check the Wanted List","runmodule.php?module=dag&op=list"); + addnav("Set a Bounty","runmodule.php?module=dag&op=addbounty"); + } + modulehook('dagnav'); + if ($op == "list") { + addnav("Sort List"); + addnav("View by Bounty", + "runmodule.php?module=dag&op=list&sort=bounty"); + addnav("View by Level", "runmodule.php?module=dag&op=list&sort=level"); + } + rawoutput(""); + page_footer(); +} +?> diff --git a/lotgd-web/lotgd/modules/darkhorse.php b/lotgd-web/lotgd/modules/darkhorse.php new file mode 100755 index 0000000..14dee1d --- /dev/null +++ b/lotgd-web/lotgd/modules/darkhorse.php @@ -0,0 +1,320 @@ +"Dark Horse Tavern", + "version"=>"1.1", + "author"=>"Eric Stevens", + "category"=>"Forest Specials", + "download"=>"core_module", + "settings"=>array( + "Dark Horse Tavern Settings,title", + "tavernname"=>"Name of the tavern|Dark Horse Tavern", + ), + "prefs-mounts"=>array( + "Dark Horse Tavern Mount Preferences,title", + "findtavern"=>"Can this mount find the tavern,bool|0", + ), + ); + return $info; +} + +function darkhorse_tavernmount() { + global $playermount; + if (isset($playermount) && is_array($playermount) && array_key_exists("mountid",$playermount)){ + $id = $playermount['mountid']; + }else{ + $id = 0; + } + // We need the module parameter here because this function can be + // called from the eventchance eval and this module might not be loaded + // at that point. + $tavern = get_module_objpref("mounts", $id, "findtavern", "darkhorse"); + return $tavern; +} + +function darkhorse_install(){ + module_addeventhook("forest", + "require_once(\"modules/darkhorse.php\"); + return (darkhorse_tavernmount() ? 0 : 100);"); + module_addeventhook("travel", + "require_once(\"modules/darkhorse.php\"); + return (darkhorse_tavernmount() ? 0 : 100);"); + $sql = "DESCRIBE " . db_prefix("mounts"); + $result = db_query($sql); + while($row = db_fetch_assoc($result)) { + if ($row['Field'] == "tavern") { + debug("Migrating tavern for all mounts"); + $sql = "INSERT INTO " . db_prefix("module_objprefs") . " (modulename,objtype,setting,objid,value) SELECT 'darkhorse','mounts','findtavern',mountid,tavern FROM " . db_prefix("mounts"); + db_query($sql); + debug("Dropping tavern field from mounts table"); + $sql = "ALTER TABLE " . db_prefix("mounts") . " DROP tavern"; + db_query($sql); + } + } + module_addhook("forest"); + module_addhook("mountfeatures"); + module_addhook("moderate"); + return true; +} + +function darkhorse_uninstall(){ + return true; +} + +function darkhorse_dohook($hookname,$args){ + switch($hookname) { + case "moderate": + $args['darkhorse'] = get_module_setting("tavernname"); + break; + case "mountfeatures": + $tavern = get_module_objpref("mounts", $args['id'], "findtavern"); + $args['features']['Darkhorse']=$tavern; + break; + case "forest": + if(darkhorse_tavernmount()) { + // add the nav + addnav("Other"); + $iname = get_module_setting("tavernname"); + require_once("lib/mountname.php"); + list($name, $lcname) = getmountname(); + addnav(array("D?Take %s`0 to %s", $lcname, $iname), + "runmodule.php?module=darkhorse&op=enter"); + } + break; + } + return $args; +} + +function darkhorse_checkday(){ + // Reset special-in just in case checkday kicks in. + $session['user']['specialinc']=""; + checkday(); + // And now set it back. + $session['user']['specialinc']="module:darkhorse"; +} + +function darkhorse_bartender($from){ + global $session; + $what = httpget('what'); + if ($what==""){ + output("The grizzled old man behind the bar reminds you very much of a strip of beef jerky.`n`n"); + $dname = translate_inline($session['user']['sex']?"lasshie":"shon"); + output("\"`7Shay, what can I do for you %s?`0\" inquires the toothless fellow.", $dname); + output("\"`7Don't shee the likesh of your short too offen 'round theshe partsh.`0\""); + addnav("Learn about my enemies",$from."op=bartender&what=enemies"); + addnav("Learn about colors",$from."op=bartender&what=colors"); + }elseif($what=="colors"){ + output("The old man leans on the bar."); + output("\"`%Sho you want to know about colorsh, do you?`0\" he asks.`n`n"); + output("You are about to answer when you realize the question was rhetorical.`n`n"); + output("He continues, \"`%To do colorsh, here'sh what you need to do. Firsht, you ushe a ` mark (found right above the tab key) followed by 1, 2, 3, 4, 5, 6, 7, !, @, #, $, %, ^, &, ), q or Q. Each of thoshe correshpondsh with a color to look like this: `n`1`1 `2`2 `3`3 `4`4 `5`5 `6`6 `7`7 `n`!`! `@`@ `#`# `\$`\$ `%`% `^`^ `&`& `n `)`) `q`q `Q`Q `n`% got it?`0\"`n You can practice below:", true); + rawoutput("
"); + $testtext = httppost('testtext'); + $try = translate_inline("Try"); + rawoutput("
"); + addnav("",$from."op=bartender&what=colors"); + rawoutput(""); + if ($testtext) { + output("`0You entered %s`n", prevent_colors(HTMLEntities($testtext, ENT_COMPAT, getsetting("charset", "ISO-8859-1"))),true); + output("It looks like %s`n", $testtext); + } + output("`0`n`nThese colors can be used in your name, and in any conversations you have."); + }else if($what=="enemies"){ + $who = httpget('who'); + if ($who==""){ + output("\"`7Sho, you want to learn about your enemiesh, do you? Who do you want to know about? Well? Shpeak up! It only costs `^100`7 gold per person for information.`0\""); + $subop = httpget('subop'); + if ($subop!="search"){ + $search = translate_inline("Search"); + rawoutput("
"); + addnav("",$from."op=bartender&what=enemies&subop=search"); + rawoutput(""); + }else{ + addnav("Search Again",$from."op=bartender&what=enemies"); + $search = "%"; + $name = httppost('name'); + for ($i=0;$i 100) { + output("`n`n\"`7Hey, whatsh you think yoush doin'. That'sh too many namesh to shay. I'll jusht tell you 'bout shome of them.`0`n"); + $max = 100; + } + $n = translate_inline("Name"); + $lev = translate_inline("Level"); + rawoutput(""); + for ($i=0;$i<$max;$i++){ + $row = db_fetch_assoc($result); + rawoutput(""); + addnav("",$from."op=bartender&what=enemies&who=".rawurlencode($row['login'])); + } + rawoutput("
$n$lev
"); + output_notl("%s", $row['name']); + rawoutput("{$row['level']}
"); + } + }else{ + if ($session['user']['gold']>=100){ + $sql = "SELECT name,acctid,alive,location,maxhitpoints,gold,sex,level,weapon,armor,attack,race,defense,charm FROM " . db_prefix("accounts") . " WHERE login='$who'"; + $result = db_query($sql); + if (db_num_rows($result)>0){ + $row = db_fetch_assoc($result); + $row = modulehook("adjuststats", $row); + $name = str_replace("s", "sh", $row['name']); + $name = str_replace("S", "Sh", $name); + output("\"`7Well... letsh shee what I know about %s`7,`0\" he says...`n`n", $name); + output("`4`bName:`b`6 %s`n", $row['name']); + output("`4`bRace:`b`6 %s`n", + translate_inline($row['race'],"race")); + output("`4`bLevel:`b`6 %s`n", $row['level']); + output("`4`bHitpoints:`b`6 %s`n", $row['maxhitpoints']); + output("`4`bGold:`b`6 %s`n", $row['gold']); + output("`4`bWeapon:`b`6 %s`n", $row['weapon']); + output("`4`bArmor:`b`6 %s`n", $row['armor']); + output("`4`bAttack:`b`6 %s`n", $row['attack']); + output("`4`bDefense:`b`6 %s`n", $row['defense']); + output("`n`^%s7 ish alsho ", $row['name']); + $amt=$session['user']['charm']; + if ($amt == $row['charm']) { + output("ash ugly ash you are.`n"); + } else if ($amt-10 > $row['charm']) { + output("`bmuch`b uglier shan you!`n"); + } else if ($amt > $row['charm']) { + output("uglier shan you.`n"); + } else if ($amt+10 < $row['charm']) { + output("`bmuch`b more beautiful shan you!`n"); + } else { + output("more beautiful shan you.`n"); + } + $session['user']['gold']-=100; + debuglog("spent 100 gold to learn about an enemy"); + }else{ + output("\"`7Eh..? I don't know anyone named that.`0\""); + } + }else{ + output("\"`7Well... letsh shee what I know about cheapshkates like you,`0\" he says...`n`n"); + output("`4`bName:`b`6 Get some money`n"); + output("`4`bLevel:`b`6 You're too broke`n"); + output("`4`bHitpoints:`b`6 Probably more than you`n"); + output("`4`bGold:`b`6 Definately richer than you`n"); + output("`4`bWeapon:`b`6 Something good enough to lay the smackdown on you`n"); + output("`4`bArmor:`b`6 Probably something more fashionable than you`n"); + output("`4`bAttack:`b`6 Eleventy billion`n"); + output("`4`bDefense:`b`6 Super Duper`n"); + } + } + } + addnav("Return to the Main Room",$from."op=tavern"); +} + +function darkhorse_runevent($type, $link){ + global $session; + $from = $link; + $gameret = substr($link, 0, -1); + $session['user']['specialinc']="module:darkhorse"; + + require_once("lib/sanitize.php"); + $iname = get_module_setting("tavernname"); + + rawoutput(""); + output_notl("`c`b%s`b`c",$iname); + $op = httpget('op'); + switch($op){ + case "": + case "search": + darkhorse_checkday(); + output("A cluster of trees nearby looks familiar..."); + output("You're sure you've seen this place before."); + output("As you approach the grove, a strange mist creeps in around you; your mind begins to buzz, and you're no longer sure exactly how you got here."); + if(darkhorse_tavernmount()) { + require_once("lib/mountname.php"); + list($name, $lcname) = getmountname(); + output("%s`0 seems to have known the way, however.", $name); + } + output("`n`nThe mist clears, and before you is a log building with smoke trailing from its chimney."); + output("A sign over the door says `7\"%s.\"`0", $iname); + addnav("Enter the tavern",$from."op=tavern"); + addnav("Leave this place",$from."op=leaveleave"); + break; + case "tavern": + darkhorse_checkday(); + output("You stand near the entrance of the tavern and survey the scene before you."); + output("Whereas most taverns are noisy and raucous, this one is quiet and nearly empty."); + output("In the corner, an old man plays with some dice."); + output("You notice that the tables have been etched on by previous adventurers who have found this place before, and behind the bar, a stick of an old man hobbles around, polishing glasses, as though there were anyone here to use them."); + addnav("Talk to the old man",$from."op=oldman"); + addnav("Talk to the bartender",$from."op=bartender"); + + // Special case here. go and see if the comment area is blocked and + // if so, don't put the link in. + $args = modulehook("blockcommentarea", array("section"=>"darkhorse")); + if (!isset($args['block']) || $args['block'] != 'yes') { + addnav("Examine the tables",$from."op=tables"); + } + addnav("Exit the tavern",$from."op=leave"); + break; + case "tables": + require_once("lib/commentary.php"); + addcommentary(); + commentdisplay("You examine the etchings in the table:`n`n", + "darkhorse","Add your own etching:"); + addnav("Return to the Main Room",$from."op=tavern"); + break; + case "bartender": + darkhorse_bartender($from); + break; + case "oldman": + darkhorse_checkday(); + addnav("Old Man"); + modulehook("darkhorsegame", array("return"=>$gameret)); + output("The old man looks up at you, his eyes sunken and hollow."); + output("His red eyes make it seem that he may have been crying recently so you ask him what is bothering him."); + if ($session['user']['sex'] == SEX_MALE) { + output("\"`7Aah, I met an adventurer in the woods, and figured I'd play a little game with her, but she won and took almost all of my money.`0\"`n`n"); + } else { + output("\"`7Aah, I met an adventurer in the woods, and figured I'd play a little game with him, but he won and took almost all of my money.`0\"`n`n"); + } + $c = navcount(); + if ($c != 0) { + output("`0\"`7Say... why not do an old man a favor and let me try to win some of it back from you?"); + if ($c > 1) output(" I can play several games!`0\""); + else output(" Shall we play a game?`0\""); + } + $session['user']['specialmisc']=""; + addnav("Return to the Main Room",$from."op=tavern"); + break; + case "leave": + output("You duck out of the tavern, and wander into the thick foliage around you."); + output("That strange mist revisits you, making your mind buzz."); + output("The mist clears, and you find yourself again where you were before the mist first covered you."); + if(!darkhorse_tavernmount()) { + output(" How exactly you got to the tavern is not exactly clear."); + } + $session['user']['specialinc']=""; + break; + case "leaveleave": + output("You decide that the tavern holds no appeal for you today."); + $session['user']['specialinc']=""; + break; + } + rawoutput(""); +} + +function darkhorse_run(){ + $op = httpget('op'); + if ($op == "enter") { + httpset("op", "tavern"); + page_header(get_module_setting("tavernname")); + darkhorse_runevent("forest", "forest.php?"); + // Clear the specialinc, just in case. + $session['user']['specialinc']=""; + page_footer(); + } +} +?> diff --git a/lotgd-web/lotgd/modules/drinks.php b/lotgd-web/lotgd/modules/drinks.php new file mode 100755 index 0000000..1d0327f --- /dev/null +++ b/lotgd-web/lotgd/modules/drinks.php @@ -0,0 +1,77 @@ +"Exotic Drinks", + "author"=>"John J. Collins
Heavily modified by JT Traub", + "category"=>"Inn", + "download"=>"core_module", + "settings"=>array( + "Drink Module Settings,title", + "hardlimit"=>"How many hard drinks can a user buy in a day?,int|3", + "maxdrunk"=>array("How drunk before %s`0 won't serve you?,range,0,100,1|66", getsetting("barkeep", "`)Cedrik")), + ), + "prefs"=>array( + "Drink Module User Preferences,title", + "drunkeness"=>"Drunkeness,range,0,100,1|0", + "harddrinks"=>"How many hard drinks has the user bought today?,int|0", + "canedit"=>"Has access to the drinks editor,bool|0", + "noslur"=>"Don't slur speach when drunk,bool|0", + ), + "version"=>"1.1" + ); + return $info; +} + +function drinks_install(){ + require_once("modules/drinks/install.php"); + $args = func_get_args(); + return call_user_func_array("drinks_install_private",$args); +} + +function drinks_uninstall() { + debug("Dropping table drinks"); + $sql = "DROP TABLE IF EXISTS " . db_prefix("drinks"); + db_query($sql); + debug("Dropping objprefs related to drinks"); + $sql = "DELETE FROM " . db_prefix("module_objprefs") . + " WHERE objtype='drinks'"; + db_query($sql); + return true; +} + +function drinks_dohook(){ + require_once("modules/drinks/dohook.php"); + $args = func_get_args(); + return call_user_func_array("drinks_dohook_private",$args); +} + +function drinks_run(){ + require_once("modules/drinks/run.php"); + $args = func_get_args(); + return call_user_func_array("drinks_run_private",$args); +} + + +?> diff --git a/lotgd-web/lotgd/modules/drinks/dohook.php b/lotgd-web/lotgd/modules/drinks/dohook.php new file mode 100755 index 0000000..c7bd6f2 --- /dev/null +++ b/lotgd-web/lotgd/modules/drinks/dohook.php @@ -0,0 +1,113 @@ +"stone cold sober", + 0=>"quite sober", + 1=>"barely buzzed", + 2=>"pleasantly buzzed", + 3=>"almost drunk", + 4=>"barely drunk", + 5=>"solidly drunk", + 6=>"sloshed", + 7=>"hammered", + 8=>"really hammered", + 9=>"almost unconscious", + 10=>"about to pass out"); + $drunklist = translate_inline($drunklist); + $drunk = round($drunk/10-.5, 0); + if ($drunk > 10) $drunk = 10; + $hard = ""; + if (get_module_pref('harddrinks')>=get_module_setting('hardlimit')) { + tlschema($drinktexts['schemas']['toomany']); + output_notl("`n`n"); + $remark = translate_inline($drinktexts['toomany']); + $remark = str_replace("{lover}",$partner."`0", $remark); + $remark = str_replace("{barkeep}", $drinktext['barkeep']."`0", $remark); + output_notl("%s`n", $remark); + output($drinktexts['toomany']); + output_notl("`n"); + $hard = "AND harddrink=0"; + } + output("`n`n`7You now feel %s.`n`n", $drunklist[$drunk]); + $sql = "SELECT * FROM " . db_prefix("drinks") . " WHERE active=1 $hard ORDER BY costperlevel"; + $result = db_query($sql); + while ($row = db_fetch_assoc($result)) { + $row['allowdrink'] = 1; + $row = modulehook("drinks-check", $row); + if ($row['allowdrink']) { + $drinkcost = $row['costperlevel']*$session['user']['level']; + // No hotkeys on drinks. Too easy for them to interfere + // with and modify stock navs randomly. + addnav(array(" ?%s (`^%s`0 gold)", $row['name'], $drinkcost), + "runmodule.php?module=drinks&act=buy&id={$row['drinkid']}"); + } + } + break; + case "newday": + set_module_pref("harddrinks", 0); + $drunk = get_module_pref("drunkeness"); + if ($drunk > 66) { + output("`n`&Waking up in the gutter after your last little 'adventure with alcohol', you `\$lose 1`& turn crawling back to your normal lodging.`n"); + $args['turnstoday'] .= ", Hangover: -1"; + $session['user']['turns']--; + // Sanity check + if ($session['user']['turns'] < 0) $session['user']['turns'] = 0; + } + set_module_pref("drunkeness",0); + break; + case "header-graveyard": + set_module_pref("drunkeness",0); + break; + case "soberup": + $soberval = $args['soberval']; + $sobermsg = $args['sobermsg']; + $drunk = get_module_pref("drunkeness"); + if ($drunk > 0) { + $drunk = round($drunk * $soberval, 0); + set_module_pref("drunkeness", $drunk); + if ($sobermsg) { + if ($args['schema']) tlschema($args['schema']); + output($sobermsg); + if ($args['schema']) tlschema(); + } + } + break; + case "commentary": + if (($session['user']['superuser'] & SU_IS_GAMEMASTER) && substr($args['commentline'], 0, 5) == "/game") break; + require_once("modules/drinks/drunkenize.php"); + $drunk = get_module_pref("drunkeness"); + if ($drunk > 50) { + $args['commenttalk'] = "drunkenly {$args['commenttalk']}"; + } + $commentline = $args['commentline']; + if (substr($commentline, 0, 1) != ":" && + substr($commentline, 0, 2) != "::" && + substr($commentline, 0, 3) != "/me" && + $drunk > 0) { + $args['commentline'] = drinks_drunkenize($commentline, $drunk); + } + break; + case "superuser": + if (($session['user']['superuser'] & SU_EDIT_USERS) || get_module_pref("canedit")) { + addnav("Module Configurations"); + // Stick the admin=true on so that when we call runmodule it'll + // work to let us edit drinks even when the module is deactivated. + addnav("Drinks Editor","runmodule.php?module=drinks&act=editor&admin=true"); + } + break; + }//end select + return $args; +}//end function +?> diff --git a/lotgd-web/lotgd/modules/drinks/drunkenize.php b/lotgd-web/lotgd/modules/drinks/drunkenize.php new file mode 100755 index 0000000..65f2fe1 --- /dev/null +++ b/lotgd-web/lotgd/modules/drinks/drunkenize.php @@ -0,0 +1,44 @@ +"aa","e"=>"ee","f"=>"ff","h"=>"hh","i"=>"iy","l"=>"ll","m"=>"mm","n"=>"nn","o"=>"oo","r"=>"rr","s"=>"sss","u"=>"oo","v"=>"vv","w"=>"ww","y"=>"yy","z"=>"zz"); + if (e_rand(0,9)) { + $letter = array_rand($slurs); + $x = strpos(strtolower($commentary),$letter); + if ($x!==false && + substr($commentary,$x,5)!="*hic*" && + substr($commentary,max($x-1,0),5)!="*hic*" && + substr($commentary,max($x-2,0),5)!="*hic*" && + substr($commentary,max($x-3,0),5)!="*hic*" && + substr($commentary,max($x-4,0),5)!="*hic*") { + if (substr($commentary,$x,1)<>strtolower($letter)) + $slurs[$letter] = strtoupper($slurs[$letter]); + else + $slurs[$letter] = strtolower($slurs[$letter]); + $commentary = substr($commentary,0,$x). + $slurs[$letter].substr($commentary,$x+1); + $replacements++; + } + }else{ + $x = e_rand(0,strlen($commentary)); + // Skip the ` followed by a letter + if (substr($commentary,$x-1,1)=="`") {$x += 1; } + if (substr($commentary,$x,5)=="*hic*") {$x+=5; } + if (substr($commentary,max($x-1,0),5)=="*hic*") {$x+=4; } + if (substr($commentary,max($x-2,0),5)=="*hic*") {$x+=3; } + if (substr($commentary,max($x-3,0),5)=="*hic*") {$x+=2; } + if (substr($commentary,max($x-4,0),5)=="*hic*") {$x+=1; } + $commentary = substr($commentary,0,$x). + "*hic*".substr($commentary,$x); + $replacements++; + }//end if + }//end while + //get rid of spare *'s in *hic**hic* + while (strpos($commentary,"*hic**hic*")) + $commentary = str_replace("*hic**hic*","*hic*hic*",$commentary); + return $commentary; +} +?> diff --git a/lotgd-web/lotgd/modules/drinks/install.php b/lotgd-web/lotgd/modules/drinks/install.php new file mode 100755 index 0000000..563c63b --- /dev/null +++ b/lotgd-web/lotgd/modules/drinks/install.php @@ -0,0 +1,83 @@ + diff --git a/lotgd-web/lotgd/modules/drinks/misc_functions.php b/lotgd-web/lotgd/modules/drinks/misc_functions.php new file mode 100755 index 0000000..f8e4abf --- /dev/null +++ b/lotgd-web/lotgd/modules/drinks/misc_functions.php @@ -0,0 +1,247 @@ +"$iname", + "barkeep"=>getsetting("barkeep", "`tCedrik"), + "return"=>"", + "demand"=>"Pounding your fist on the bar, you demand another drink", + "toodrunk"=>" but {barkeep} continues to clean the glass he was working on. \"`%You've had enough ".($session['user']['sex']?"lass":"lad").",`0\" he declares.", + "toomany"=>"{barkeep} eyes you critically. \"`%Ya've had enough of the hard stuff, my friend. No more of that for you today.`0\"", + "drinksubs"=>array(), + ); + $schemas = array( + 'title'=>"module-drinks", + 'barkeep'=>"module-drinks", + 'return'=>"module-drinks", + 'demand'=>"module-drinks", + 'toodrunk'=>"module-drinks", + 'toomany'=>"module-drinks", + 'drinksubs'=>"module-drinks", + ); + $drinktext['schemas'] = $schemas; + return $drinktext; +} + + +// Support functions +function drinks_editor(){ + global $mostrecentmodule; + if (!get_module_pref("canedit")) check_su_access(SU_EDIT_USERS); + + page_header("Drink Editor"); + require_once("lib/superusernav.php"); + superusernav(); + addnav("Drink Editor"); + addnav("Add a drink","runmodule.php?module=drinks&act=editor&op=add&admin=true"); + $op = httpget('op'); + $drinkid = httpget('drinkid'); + $header = ""; + if ($op != "") { + addnav("Drink Editor Main","runmodule.php?module=drinks&act=editor&admin=true"); + if ($op == 'add') { + $header = translate_inline("Adding a new drink"); + } else if ($op == 'edit') { + $header = translate_inline("Editing a drink"); + } + } else { + $header = translate_inline("Current drinks"); + } + output_notl("`&

$header`0

", true); + $drinksarray=array( + "Drink,title", + "drinkid"=>"Drink ID,hidden", + "name"=>"Drink Name", + "costperlevel"=>"Cost per level,int", + "hpchance"=>"Chance of modifying HP (see below),range,0,10,1", + "turnchance"=>"Chance of modifying turns (see below),range,0,10,1", + "alwayshp"=>"Always modify hitpoints,bool", + "alwaysturn"=>"Always modify turns,bool", + "drunkeness"=>"Drunkeness,range,1,100,1", + "harddrink"=>"Is drink hard alchohol?,bool", + "hpmin"=>"Min HP to add (see below),range,-20,20,1", + "hpmax"=>"Max HP to add (see below),range,-20,20,1", + "hppercent"=>"Modify HP by some percent (see below),range,-25,25,5", + "turnmin"=>"Min turns to add (see below),range,-5,5,1", + "turnmax"=>"Max turns to add (see below),range,-5,5,1", + "remarks"=>"Remarks", + "buffname"=>"Name of the buff", + "buffrounds"=>"Rounds buff lasts,range,1,20,1", + "buffroundmsg"=>"Message each round of buff", + "buffwearoff"=>"Message when buff wears off", + "buffatkmod"=>"Attack modifier of buff", + "buffdefmod"=>"Defense modifier of buff", + "buffdmgmod"=>"Damage modifier of buff", + "buffdmgshield"=>"Damage shield modifier of buff", + "buffeffectfailmsg"=>"Effect failure message (see below)", + "buffeffectnodmgmsg"=>"No damage message (see below)", + "buffeffectmsg"=>"Effect message (see below)", + ); + if($op=="del"){ + $sql = "DELETE FROM " . db_prefix("drinks") . " WHERE drinkid='$drinkid'"; + module_delete_objprefs('drinks', $drinkid); + db_query($sql); + $op = ""; + httpset('op', ""); + } + if($op=="save"){ + $subop = httpget("subop"); + if ($subop=="") { + $drinkid = httppost("drinkid"); + list($sql, $keys, $vals) = postparse($drinksarray); + if ($drinkid > 0) { + $sql = "UPDATE " . db_prefix("drinks") . " SET $sql WHERE drinkid='$drinkid'"; + } else { + $sql = "INSERT INTO " . db_prefix("drinks") . " ($keys) VALUES ($vals)"; + } + db_query($sql); + if (db_affected_rows()> 0) { + output("`^Drink saved!"); + } else { + $str = db_error(); + if ($str == "") { + output("`^Drink not saved: no changes detected."); + } else { + output("`^Drink not saved: `\$%s`0", $sql); + } + } + } elseif ($subop == "module") { + $drinkid = httpget("drinkid"); + // Save module settings + $module = httpget("editmodule"); + // This should obey the same rules as the configuration editor + // So disabling + //$sql = "DELETE FROM " . db_prefix("module_objprefs") . " WHERE objtype='drinks' AND objid='$drinkid' AND modulename='$module'"; + //db_query($sql); + $post = httpallpost(); + reset($post); + while(list($key, $val)=each($post)) { + set_module_objpref("drinks", $drinkid,$key, $val, $module); + } + output("`^Saved."); + } + if ($drinkid) { + $op = "edit"; + httpset("drinkid", $drinkid, true); + } else { + $op = ""; + } + httpset('op', $op); + } + if ($op == "activate") { + $sql = "UPDATE " . db_prefix("drinks") . " SET active=1 WHERE drinkid='$drinkid'"; + db_query($sql); + $op = ""; + httpset('op', ""); + } + if ($op == "deactivate") { + $sql = "UPDATE " . db_prefix("drinks") . " SET active=0 WHERE drinkid='$drinkid'"; + db_query($sql); + $op = ""; + httpset('op', ""); + } + if ($op==""){ + $op = translate_inline("Ops"); + $id = translate_inline("Id"); + $nm = translate_inline("Name"); + $dkn = translate_inline("Drunkeness"); + $hard = translate_inline("Hard Alchohol?"); + $edit = translate_inline("Edit"); + $deac = translate_inline("Deactivate"); + $act = translate_inline("Activate"); + $conf = translate_inline("Are you sure you wish to delete this drink?"); + $del = translate_inline("Del"); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + $sql = "SELECT drinkid,active,name,drunkeness,harddrink FROM " . db_prefix("drinks") . " ORDER BY drinkid"; + $result= db_query($sql); + for ($i=0;$i"); + rawoutput(""); + addnav("","runmodule.php?module=drinks&act=editor&op=del&drinkid=$id&admin=true"); + output_notl("`0", $id, true); + output_notl("", $row['name'], true); + output_notl("", $row['drunkeness'], true); + $hard = translate_inline("`^No"); + if ($row['harddrink']) $hard = translate_inline("`\$Yes"); + output_notl("", $hard, true); + rawoutput(""); + } + rawoutput("
$op$id$nm$dkn$hard
[ $edit"); + addnav("","runmodule.php?module=drinks&act=editor&op=edit&drinkid=$id&admin=true"); + if ($row['active']) { + rawoutput(" | $deac"); + addnav("","runmodule.php?module=drinks&act=editor&op=deactivate&drinkid=$id&admin=true"); + } else { + rawoutput(" | $act"); + addnav("","runmodule.php?module=drinks&act=editor&op=activate&drinkid=$id&admin=true"); + } + + rawoutput(" | $del ]`^%s`&%s`0`^%s`0%s`0
"); + } + $subop= httpget("subop"); + if($op=="edit"){ + addnav("Drink properties", "runmodule.php?module=drinks&act=editor&op=edit&drinkid=$drinkid&admin=true"); + module_editor_navs("prefs-drinks", "runmodule.php?module=drinks&act=editor&drinkid=$drinkid&op=edit&subop=module&editmodule="); + if ($subop=="module") { + $module = httpget("editmodule"); + $oldmodule = $mostrecentmodule; + rawoutput("
"); + module_objpref_edit('drinks', $module, $drinkid); + $mostrecentmodule = $oldmodule; + rawoutput("
"); + addnav("", "runmodule.php?module=drinks&act=editor&op=save&subop=module&editmodule=$module&drinkid=$drinkid&admin=true"); + } elseif ($subop=="") { + $sql = "SELECT * FROM " . db_prefix("drinks") . " WHERE drinkid='".httpget('drinkid')."'"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + } + }elseif ($op=="add"){ + /* We're adding a new drink, make an empty row */ + $row = array(); + $row['drinkid'] = 0; + } + + if (($op == "edit" || $op == "add") && $subop=="") { + rawoutput("
"); + addnav("","runmodule.php?module=drinks&act=editor&op=save&admin=true"); + showform($drinksarray,$row); + rawoutput("
"); + output("`\$NOTE:`7 Make sure that you know what you are doing when modifying or adding drinks.`n"); + output("Just because the drinks have a lot of options, doesn't mean you have to use all of them`n`n"); + output("`2Drink ID: `7This field is used internally and should be unique.`n"); + output("`2Name: `7The name of the drink the user will see.`n"); + output("`2Cost per level: `7This value times the users level is the drink cost.`n"); + output("`2Chance of modifying HP: `7If set, this is the number of chances out of the total of this and the turn chance for HP getting modified.`n"); + output("`2Chance of modifying turns: `7If set, this is the number of chances out of the total of this and the HP chance for turns getting modified.`n"); + output("`2Always modify HP: `7If set, hitpoints will be modified. Should not be set alongside HP chance above.`n"); + output("`2Always modify turns: `7If set, turns will be modified. Should not be set alongside turn chance above.`n"); + output("`2Drunkeness: `7How drunk will this make the player.`n"); + output("`2Hard Drink: `7Users are only allowed a certain number of hard drinks per day regardless of drunkeness.`n"); + output("`2Min HP to add: `7If we are modifying hitpoints, and if HP percent isn't set, use this and the HP max value to pick a random amount of HP to add. Can be negative.`n"); + output("`2Max HP to add: `7If we are modifying hitpoints and if HP percent isn't set, use this and the HP min value to pick a random amount of HP to add. Can be negative.`n"); + output("`2HP percent: `7If we are modifying hitpoints and if this is set, the users hitpoints are modified by this percentage. Can be negative.`n"); + output("`2Min turns to add: `7If we are modifying turns, use this and the turn max value to pick a random amount of turns to add. Can be negative.`n"); + output("`2Max turns to add: `7If we are modifying turns, use this and the turn min value to pick a random amount of turns to add. Can be negative.`n"); + output("`2Remarks: `7Text displayed to the user when they order the drink.`n"); + output("`2Buff name: `7What is this buff called.`n"); + output("`2Buff rounds: `7How many rounds this buff lasts.`n"); + output("`2Buff round message: `7What message should show as each round occurs.`n"); + output("`2Buff wearoff: `7What message is shown when this buff wears off.`n"); + output("`2Buff attack modifier: `7Multiplier to modify attack points by? 1.0 is no modification, 2.0 doubles their attack points.`n"); + output("`2Buff defense modifier: `7Multiplier to modify defense points by? 1.0 is no modification, 2.0 doubles their defense points.`n"); + output("`2Buff damage modifier: `7Multiplier to modify damage by? 1.0 is no modification, 2.0 doubles their damage points. This is `\$VERY POTENT`7!`n"); + output("`2Buff damage shield modifier: `7When you are hit, deals damage to your opponent based on damage done to you. 1.0 deals identical damage, 2.0 deals double damage back to the opponent.`n"); + output("`2Effect failure message: Message if this buff fails. (Only used with damage shield)`n"); + output("`2Effect no damage message: Message if no damage is done. (Only used with damage shield)`n"); + output("`2Effect message: What shows when this buff has an effect. (Only used with damage shield)`n`n"); + } + page_footer(); +} + +?> diff --git a/lotgd-web/lotgd/modules/drinks/run.php b/lotgd-web/lotgd/modules/drinks/run.php new file mode 100755 index 0000000..0f833b5 --- /dev/null +++ b/lotgd-web/lotgd/modules/drinks/run.php @@ -0,0 +1,155 @@ +"); + output_notl("`c`b"); + output($drinktext['title']); + output_notl("`b`c"); + tlschema(); + $drunk = get_module_pref("drunkeness"); + $end = "."; + if ($drunk > get_module_setting("maxdrunk")) + $end = ","; + tlschema($drinktext['schemas']['demand']); + $remark = translate_inline($drinktext['demand']); + $remark = str_replace("{lover}",$partner."`0", $remark); + $remark = str_replace("{barkeep}", $drinktext['barkeep']."`0", $remark); + tlschema(); + output_notl("%s$end", $remark); + $drunk = get_module_pref("drunkeness"); + if ($drunk > get_module_setting("maxdrunk")) { + tlschema($drinktext['schemas']['toodrunk']); + $remark = translate_inline($drinktext['toodrunk']); + tlschema(); + $remark = str_replace("{lover}",$partner."`0", $remark); + $remark = str_replace("{barkeep}", $drinktext['barkeep']."`0", $remark); + output($remark); + tlschema(); + } else { + $sql = "SELECT * FROM " . db_prefix("drinks") . " WHERE drinkid='".httpget('id')."'"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + $drinkcost = $session['user']['level'] * $row['costperlevel']; + if ($session['user']['gold'] >= $drinkcost) { + $drunk = get_module_pref("drunkeness"); + $drunk += $row['drunkeness']; + set_module_pref("drunkeness", $drunk); + $session['user']['gold'] -= $drinkcost; + debuglog("spent $drinkcost on {$row['name']}"); + $remark = str_replace("{lover}",$partner."`0", $row['remarks']); + $remark = str_replace("{barkeep}", $drinktext['barkeep']."`0", $remark); + if (count($drinktext['drinksubs']) > 0) { + $keys = array_keys($drinktext['drinksubs']); + $vals = array_values($drinktext['drinksubs']); + $remark = preg_replace($keys, $vals, $remark); + } + output($remark); + output_notl("`n`n"); + if ($row['harddrink']) { + $drinks = get_module_pref("harddrinks"); + set_module_pref("harddrinks", $drinks+1); + } + $givehp = 0; + $giveturn = 0; + if ($row['hpchance']>0 || $row['turnchance']>0) { + $tot = $row['hpchance'] + $row['turnchance']; + $c = e_rand(1, $tot); + if ($c <= $row['hpchance'] && $row['hpchance']>0) + $givehp = 1; + else + $giveturn = 1; + } + if ($row['alwayshp']) $givehp = 1; + if ($row['alwaysturn']) $giveturn = 1; + if ($giveturn) { + $turns = e_rand($row['turnmin'], $row['turnmax']); + $oldturns = $session['user']['turns']; + $session['user']['turns'] += $turns; + // sanity check + if ($session['user']['turns'] < 0) + $session['user']['turns'] = 0; + + if ($oldturns < $session['user']['turns']) { + output("`&You feel vigorous!`n"); + } else if ($oldturns > $session['user']['turns']) { + output("`&You feel lethargic!`n"); + } + } + if ($givehp) { + $oldhp = $session['user']['hitpoints']; + + // Check for percent increase first + if ($row['hppercent'] != 0.0) { + $hp = round($session['user']['maxhitpoints'] * + ($row['hppercent']/100), 0); + } else { + $hp = e_rand($row['hpmin'], $row['hpmax']); + } + $session['user']['hitpoints'] += $hp; + // Sanity check + if ($session['user']['hitpoints'] < 1) + $session['user']['hitpoints'] = 1; + + if ($oldhp < $session['user']['hitpoints']) { + output("`&You feel healthy!`n"); + } else if ($oldhp > $session['user']['hitpoints']) { + output("`&You feel sick!`n"); + } + } + $buff = array(); + $buff['name'] = $row['buffname']; + $buff['rounds'] = $row['buffrounds']; + if ($row['buffwearoff']) + $buff['wearoff'] = $row['buffwearoff']; + if ($row['buffatkmod']) + $buff['atkmod'] = $row['buffatkmod']; + if ($row['buffdefmod']) + $buff['defmod'] = $row['buffdefmod']; + if ($row['buffdmgmod']) + $buff['dmgmod'] = $row['buffdmgmod']; + if ($row['buffdmgshield']) + $buff['damageshield'] = $row['buffdmgshield']; + if ($row['buffroundmsg']) + $buff['roundmsg'] = $row['buffroundmsg']; + if ($row['buffeffectmsg']) + $buff['effectmsg'] = $row['buffeffectmsg']; + if ($row['buffeffectnodmgmsg']) + $buff['effectnodmgmsg'] = $row['buffeffectnodmgmsg']; + if ($row['buffeffectfailmsg']) + $buff['effectfailmsg'] = $row['buffeffectfailmsg']; + $buff['schema'] = "module-drinks"; + apply_buff('buzz',$buff); + } else { + output("You don't have enough money. How can you buy %s if you don't have any money!?!", $row['name']); + } + } + rawoutput(""); + if ($drinktext['return']>""){ + tlschema($drinktext['schemas']['return']); + addnav($drinktext['return'],$drinktext['returnlink']); + tlschema(); + }else{ + tlschema($drinktext['schemas']['return']); + addnav("I?Return to the Inn","inn.php"); + addnav(array("Go back to talking to %s`0", getsetting("barkeep", "`tCedrik")),"inn.php?op=bartender"); + tlschema(); + } + require_once("lib/villagenav.php"); + villagenav(); + page_footer(); + } +} +?> diff --git a/lotgd-web/lotgd/modules/fairy.php b/lotgd-web/lotgd/modules/fairy.php new file mode 100755 index 0000000..7300be7 --- /dev/null +++ b/lotgd-web/lotgd/modules/fairy.php @@ -0,0 +1,130 @@ +"Forest Fairy", + "version"=>"1.1", + "author"=>"Eric Stevens", + "category"=>"Forest Specials", + "download"=>"core_module", + "settings"=>array( + "Fairy Forest Event Settings,title", + "carrydk"=>"Do max hitpoints gained carry across DKs?,bool|1", + "hptoaward"=>"How many HP are given by the fairy?,range,1,5,1|1", + "fftoaward"=>"How many FFs are given by the fairy?,range,1,5,1|1", + ), + "prefs"=>array( + "Fairy Forest Event User Preferences,title", + "extrahps"=>"How many extra hitpoints has the user gained?,int", + ), + ); + return $info; +} + +function fairy_install(){ + module_addeventhook("forest", "return 100;"); + module_addhook("hprecalc"); + return true; +} + +function fairy_uninstall(){ + return true; +} + +function fairy_dohook($hookname,$args){ + switch($hookname){ + case "hprecalc": + $args['total'] -= get_module_pref("extrahps"); + if (!get_module_setting("carrydk")) { + $args['extra'] -= get_module_pref("extrahps"); + set_module_pref("extrahps", 0); + } + break; + } + return $args; +} + +function fairy_runevent($type) +{ + require_once("lib/increment_specialty.php"); + global $session; + // We assume this event only shows up in the forest currently. + $from = "forest.php?"; + $session['user']['specialinc'] = "module:fairy"; + + $op = httpget('op'); + if ($op=="" || $op=="search"){ + output("`%You encounter a fairy in the forest."); + output("\"`^Give me a gem!`%\" she demands."); + output("What do you do?"); + addnav("Give her a gem", $from."op=give"); + addnav("Don't give her a gem", $from."op=dont"); + }elseif ($op=="give"){ + $session['user']['specialinc'] = ""; + if ($session['user']['gems']>0){ + output("`%You give the fairy one of your hard-earned gems."); + output("She looks at it, squeals with delight, and promises a gift in return."); + output("She hovers over your head, sprinkles golden fairy dust down on you before flitting away."); + output("You discover that ...`n`n`^"); + $session['user']['gems']--; + debuglog("gave 1 gem to a fairy"); + switch(e_rand(1,7)){ + case 1: + $extra = get_module_setting("fftoaward"); + if ($extra == 1) output("You receive an extra forest fight!"); + else output("You receive %s extra forest fights!", $extra); + $session['user']['turns'] += $extra; + break; + case 2: + case 3: + output("You feel perceptive and notice `%TWO gems`^ nearby!"); + $session['user']['gems']+=2; + debuglog("found 2 gem from a fairy"); + break; + case 4: + case 5: + $hptype = "permanently"; + if (!get_module_setting("carrydk") || + (is_module_active("globalhp") && + !get_module_setting("carrydk", "globalhp"))) + $hptype = "temporarily"; + $hptype = translate_inline($hptype); + + $extra = get_module_setting("hptoaward"); + output("Your maximum hitpoints are `b%s`b increased by %d!", + $hptype, $extra); + + $session['user']['maxhitpoints'] += $extra; + $session['user']['hitpoints'] += $extra; + set_module_pref("extrahps", + get_module_pref("extrahps")+$extra); + break; + case 6: + case 7: + increment_specialty("`^"); + break; + } + }else{ + output("`%You promise to give the fairy a gem, however, when you open your purse, you discover that you have none."); + output("The tiny fairy floats before you, tapping her foot on the air as you try to explain why it is that you lied to her.`n`n"); + output("Having had enough of your mumblings, she sprinkles some angry red fairy dust on you."); + output("Your vision blacks out, and when you wake again, you cannot tell where you are."); + output("You spend enough time searching for the way back to the village that you lose time for a forest fight."); + $session['user']['turns']--; + } + output("`0"); + }else{ + if ($session['user']['gems']) { + output("`%Not wanting to part with one of your precious precious gems, you swat the tiny creature to the ground and walk away.`0"); + } else { + output("`%Not having any gems to part with, you swat the tiny creature to the ground and walk away.`0"); + } + $session['user']['specialinc'] = ""; + } +} + +function fairy_run(){ +} +?> diff --git a/lotgd-web/lotgd/modules/findgem.php b/lotgd-web/lotgd/modules/findgem.php new file mode 100755 index 0000000..b7ffb1a --- /dev/null +++ b/lotgd-web/lotgd/modules/findgem.php @@ -0,0 +1,40 @@ +"Find Gems", + "version"=>"1.1", + "author"=>"Eric Stevens", + "category"=>"Forest Specials", + "download"=>"core_module", + ); + return $info; +} + +function findgem_install(){ + module_addeventhook("forest", "return 100;"); + module_addeventhook("travel", "return 20;"); + return true; +} + +function findgem_uninstall(){ + return true; +} + +function findgem_dohook($hookname,$args){ + return $args; +} + +function findgem_runevent($type,$link) +{ + global $session; + output("`^Fortune smiles on you and you find a `%gem`^!`0"); + $session['user']['gems']++; + debuglog("found a gem in the dirt"); +} + +function findgem_run(){ +} +?> diff --git a/lotgd-web/lotgd/modules/findgold.php b/lotgd-web/lotgd/modules/findgold.php new file mode 100755 index 0000000..840c2c4 --- /dev/null +++ b/lotgd-web/lotgd/modules/findgold.php @@ -0,0 +1,48 @@ +"Find Gold", + "version"=>"1.1", + "author"=>"Eric Stevens", + "category"=>"Forest Specials", + "download"=>"core_module", + "settings"=>array( + "Find Gold Event Settings,title", + "mingold"=>"Minimum gold to find (multiplied by level),range,0,50,1|10", + "maxgold"=>"Maximum gold to find (multiplied by level),range,20,150,1|50" + ), + ); + return $info; +} + +function findgold_install(){ + module_addeventhook("forest", "return 100;"); + module_addeventhook("travel", "return 20;"); + return true; +} + +function findgold_uninstall(){ + return true; +} + +function findgold_dohook($hookname,$args){ + return $args; +} + +function findgold_runevent($type,$link) +{ + global $session; + $min = $session['user']['level']*get_module_setting("mingold"); + $max = $session['user']['level']*get_module_setting("maxgold"); + $gold = e_rand($min, $max); + output("`^Fortune smiles on you and you find %s gold!`0", $gold); + $session['user']['gold']+=$gold; + debuglog("found $gold gold in the dirt"); +} + +function findgold_run(){ +} +?> diff --git a/lotgd-web/lotgd/modules/foilwench.php b/lotgd-web/lotgd/modules/foilwench.php new file mode 100755 index 0000000..5c9c28b --- /dev/null +++ b/lotgd-web/lotgd/modules/foilwench.php @@ -0,0 +1,87 @@ +"Foilwench", + "version"=>"1.1", + "author"=>"Eric Stevens", + "category"=>"Forest Specials", + "download"=>"core_module", + ); + return $info; +} + +function foilwench_install(){ + module_addeventhook("forest", "return 100;"); + return true; +} + +function foilwench_uninstall(){ + return true; +} + +function foilwench_dohook($hookname,$args){ + return $args; +} + +function foilwench_runevent($type) +{ + require_once("lib/increment_specialty.php"); + global $session; + // We assume this event only shows up in the forest currently. + $from = "forest.php?"; + $session['user']['specialinc'] = "module:foilwench"; + + $colors = array(""=>"`7"); + $colors = modulehook("specialtycolor", $colors); + $c = $colors[$session['user']['specialty']]; + if (!$c) $c = "`7"; + if ($session['user']['specialty'] == "") { + output("You have no direction in the world, you should rest and make some important decisions about your life."); + $session['user']['specialinc']=""; + return; + } + $skills = modulehook("specialtynames"); + + $op = httpget('op'); + if ($op=="give"){ + if ($session['user']['gems']>0){ + output("%sYou give `@Foil`&wench%s a gem, and she hands you a slip of parchment with instructions on how to advance in your specialty.`n`n", $c, $c); + output("You study it intensely, shred it up, and eat it lest infidels get ahold of the information.`n`n"); + output("`@Foil`&wench%s sighs... \"`&You didn't have to eat it... Oh well, now be gone from here!%s\"`3", $c, $c); + increment_specialty("`3"); + $session['user']['gems']--; + debuglog("gave 1 gem to Foilwench"); + }else{ + output("%sYou hand over your imaginary gem.", $c); + output("`@Foil`&wench%s stares blankly back at you.", $c); + output("\"`&Come back when you have a `breal`b gem you simpleton.%s\"`n`n", $c); + output("\"`#Simpleton?%s\" you ask.`n`n", $c); + output("With that, `@Foil`&wench%s throws you out.`0", $c); + } + $session['user']['specialinc']=""; + }elseif($op=="dont"){ + output("%sYou inform `@Foil`&wench%s that if she would like to get rich, she will have to do so on her efforts, and stomp away.", $c, $c); + $session['user']['specialinc']=""; + }elseif($session['user']['specialty']!=""){ + output("%sYou are seeking prey in the forest when you stumble across a strange hut.", $c); + output("Ducking inside, you are met by the grizzled face of a battle-hardened old woman."); + output("\"`&Greetings %s`&, I am `@Foil`&wench, master of all.%s\"`n`n", $session['user']['name'], $c); + output("\"`#Master of all?%s\" you inquire.`n`n", $c); + output("\"`&Yes, master of all. All the skills are mine to control, and to teach.%s\"`n`n", $c); + output("\"`#Yours to teach?%s\" you query.`n`n", $c); + output("The old woman sighs, \"`&Yes, mine to teach. I will teach you how to advance in %s on two conditions.%s\"`n`n", $skills[$session['user']['specialty']], $c); + output("\"`#Two conditions?%s\" you repeat inquisitively.`n`n", $c); + output("\"`&Yes. First, you must give me a gem, and second you must stop repeating what I say in the form of a question!%s\"`n`n", $c); + output("\"`#A gem!%s\" you state definitively.`n`n", $c); + output("\"`&Well... I guess that wasn't a question. So how about that gem?%s\"", $c); + addnav("Give her a gem", $from."op=give"); + addnav("Don't give her a gem",$from."op=dont"); + } +} + +function foilwench_run(){ +} +?> diff --git a/lotgd-web/lotgd/modules/game_dice.php b/lotgd-web/lotgd/modules/game_dice.php new file mode 100755 index 0000000..ca12eb8 --- /dev/null +++ b/lotgd-web/lotgd/modules/game_dice.php @@ -0,0 +1,118 @@ +"Dice Game for DarkHorse", + "author"=>"Eric Stevens", + "version"=>"1.1", + "category"=>"Darkhorse Game", + "download"=>"core_module", + ); + return $info; +} + +function game_dice_install(){ + global $session; + debug("Adding Hooks"); + module_addhook("darkhorsegame"); + return true; +} + +function game_dice_uninstall(){ + output("Uninstalling this module.`n"); + return true; +} + +function game_dice_dohook($hookname, $args){ + if ($hookname=="darkhorsegame"){ + $ret = urlencode($args['return']); + addnav("D?Play Dice Game", + "runmodule.php?module=game_dice&ret=$ret"); + } + return $args; +} + +function game_dice_run(){ + global $session; + $ret = urlencode(httpget("ret")); + page_header("A Game of Dice"); + + if ($session['user']['gold']>0){ + $bet = abs((int)httpget('bet') + (int)httppost('bet')); + if ($bet<=0){ + addnav("Never mind", appendlink(urldecode($ret), "op=oldman")); + output("`3\"`!You get to roll a die, and choose to keep or pass on the roll. If you pass, you get up to two more chances to roll, for a total of three rolls. Once you keep your roll (or on the third roll), I will do the same. In the end, if my die is higher than yours, I win, if yours is higher, you win, and if they are a tie, neither of us wins, and we each keep our bet.`3\"`n`n"); + output("`3\"`!How much would you bet young %s?`3\"", translate_inline($session['user']['sex']?"lady":"man")); + rawoutput("
"); + rawoutput(""); + $b = translate_inline("Bet"); + rawoutput(""); + rawoutput("
"); + rawoutput(""); + addnav("","runmodule.php?module=game_dice&ret=$ret"); + }else if($bet>$session['user']['gold']){ + output("`3The old man reaches out with his stick and pokes your coin purse."); + output("\"`!I don't believe you have `^%s`! gold!`3\" he declares.`n`n", $bet); + output("Desperate to really show him good, you open up your purse and spill out its contents: `^%s`3 gold.`n`n", $session['user']['gold']); + output("Embarrassed, you think you'll head back to the tavern."); + addnav("Return to the Main Room",appendlink(urldecode($ret), "op=tavern")); + } else { + $what = httpget('what'); + if ($what!="keep"){ + $session['user']['specialmisc']=e_rand(1,6); + $try=(int)httpget('try'); + $try++; + switch ($try) { + case 1: $die = "first"; break; + case 2: $die = "second"; break; + default: $die = "third"; break; + } + $die = translate_inline($die); + output("You roll your %s die, and it comes up as `b%s`b`n`n", $die, $session['user']['specialmisc']); + output("`3You have bet `^%s`3.", $bet); + output("What do you do?"); + addnav("Keep","runmodule.php?module=game_dice&what=keep&bet=$bet&ret=$ret"); + if ($try<3) + addnav("Pass","runmodule.php?module=game_dice&what=pass&try=$try&bet=$bet&ret=$ret"); + }else{ + output("Your final roll was `b%s`b, the old man will now try to beat it:`n`n", $session['user']['specialmisc']); + $r = e_rand(1,6); + output("The old man rolls a %s...`n", $r); + if ($r>$session['user']['specialmisc'] || $r==6){ + output("\"`7I think I'll stick with that roll!`0\" he says.`n"); + }else{ + $r = e_rand(1,6); + output("The old man rolls again and gets a %s...`n", $r); + if ($r>=$session['user']['specialmisc']){ + output("\"`7I think I'll stick with that roll!`0\" he says.`n"); + }else{ + $r = e_rand(1,6); + output("The old man rolls his final roll and gets a %s...`n", $r); + } + } + if ($r>$session['user']['specialmisc']){ + output("`n\"`7Yeehaw, I knew the likes of you would never stand up to the likes of me!`0\" exclaims the old man as you hand him your `^%s`0 gold.", $bet); + $session['user']['gold']-=$bet; + debuglog("lost $bet gold at dice"); + }elseif ($r==$session['user']['specialmisc']){ + output("`n\"`7Yah... well, looks as though we tied.`0\" he says."); + }else{ + output("`n\"`7Aaarrgh!!! How could the likes of you beat me?!?!?`0\" shouts the old man as he gives you the gold he owes."); + $session['user']['gold']+=$bet; + debuglog("won $bet gold at dice"); + } + addnav("Play again?","runmodule.php?module=game_dice&ret=$ret"); + addnav("Other Games",appendlink(urldecode($ret), "op=oldman")); + addnav("Return to the Main Room", appendlink(urldecode($ret), "op=tavern")); + } + } + }else{ + output("`3The old man reaches out with his stick and pokes your coin purse. \"`!Empty?!?! How can you bet with no money??`3\" he shouts."); + output("With that, he turns back to his dice, apparently having already forgotten his anger."); + addnav("Return to the Main Room", appendlink(urldecode($ret), "op=tavern")); + } + page_footer(); +} +?> diff --git a/lotgd-web/lotgd/modules/game_fivesix.php b/lotgd-web/lotgd/modules/game_fivesix.php new file mode 100755 index 0000000..3bdc584 --- /dev/null +++ b/lotgd-web/lotgd/modules/game_fivesix.php @@ -0,0 +1,193 @@ +"Five Sixes Dice Game", + "author"=>"`4Talisman", + "version"=>"1.7", + "category"=>"Darkhorse Game", + "download"=>"core_module", + "settings"=>array( + "Five Sixes Dice Game,title", + "cost"=>"Cost to play,int|5", + "dailyuses"=>"Plays per day (0=unlimited),int|10", + "jackpot"=>"Gold in the pot,int|100", + "maxjackpot"=>"Maximum Payout,int|5000", + "lastwin5"=>"Last jackpot winner|Nobody...yet", + "lastpot5"=>"Last Jackpot Won,int|0", + "lastwin4"=>"Last winner of 4 sixes|Nobody...yet", + "lastpot4"=>"Last Jackpot Won,int|0", + "lastwin3"=>"Last winner of 3 sixes|Nobody...yet", + "lastpot3"=>"Last Jackpot Won,int|0", + ), + "prefs"=>array( + "Five Sixes Dice, title", + "playstoday"=>"Times played today,int|0", + ) + ); + return $info; +} + +function game_fivesix_install(){ + global $session; + module_addhook("darkhorsegame"); + module_addhook("newday"); + return true; +} + +function game_fivesix_uninstall(){ + return true; +} + +function game_fivesix_dohook($hookname, $args){ + + global $session; + switch($hookname){ + case "newday": + set_module_pref("playstoday",0); + break; + + case "darkhorsegame": + $ret = urlencode($args['return']); + addnav("Play Sixes Dice Game", + "runmodule.php?module=game_fivesix&ret=$ret&what=play"); + } + return $args; +} + +function game_fivesix_run(){ + global $session; + $ret = urlencode(httpget("ret")); + page_header("A Game of Dice"); + + $prize=get_module_setting("jackpot"); + $cost=get_module_setting("cost"); + + $what = httpget('what'); + if ($what=="play"){ + output("`n`@So you'd like to try your hand to rolling five sixes, would you?`n"); + output("The game is quite simple, really - you roll five dice."); + output("If all five display sixes, you win the jackpot.`n`n"); + output("`^It only costs you %s gold to play, and the current jackpot is %s gold pieces.`n`n", $cost, $prize); + + $lastpot5=get_module_setting("lastpot5"); + if ($lastpot5>=1){ + $lastwin5=get_module_setting("lastwin5"); + output("`@The last jackpot, worth %s gold was won by %s.`n`n",$lastpot5,$lastwin5); + }else{ + output("`@The jackpot has never been won - you could be the first!`n`n"); + } + $lastpot4=get_module_setting("lastpot4"); + if ($lastpot4>=1) { + output("%s`@, in a peerless display, won `^%s `@gold for rolling 4 sixes.`n`n", get_module_setting("lastwin4"), get_module_setting("lastpot4")); + } + $lastpot3=get_module_setting("lastpot3"); + if ($lastpot3>=1) { + output("If you need a loan, you might talk to %s`@, who won `^%s`@ gold for getting just three sixes.`n`n", get_module_setting("lastwin3"), get_module_setting("lastpot3")); + } + addnav("Play the Games"); + addnav("D?Roll the Dice","runmodule.php?module=game_fivesix&what=roll&ret=$ret"); + } elseif ($what=="roll"){ + $visits = get_module_pref("playstoday"); + $max = get_module_setting("dailyuses"); + + if (($visits < $max) || ($max==0)){ + $cost=get_module_setting("cost"); + if ($session['user']['gold'] < $cost){ + output("`3The old man watches as nothing but moths and dust emerge from your coin purse.`n"); + output("He shakes his head at you then turns back to his ale as though you weren't there."); + addnav("Return to the Main Room",appendlink(urldecode($ret), "op=tavern")); + }else{ + debuglog("spent $cost gold on five-sixes game"); + $session['user']['gold']-=$cost; + $visits++; + set_module_pref("playstoday",$visits); + $prize+=$cost; + + $maxpot=get_module_setting("maxjackpot"); + if ($prize > $maxpot) { + output("`n`@The old man slips your donation into his own change purse, muttering something about the pot being big enough already.`n`n"); + $prize = $maxpot; + } + + set_module_setting("jackpot",$prize); + + $almost=0; + $one=e_rand(1,6); + if ($one==6) $almost++; + $two=e_rand(1,6); + if ($two==6) $almost++; + $three=e_rand(1,6); + if ($three==6) $almost++; + $four=e_rand(1,6); + if ($four==6) $almost++; + $five=e_rand(1,6); + if ($five==6) $almost++; + + output("`n`@You gather the dice in an old leather cup, shake them, and hold your breath as you spill them onto the table.`n"); + output("Upon inspecting them, you see their values are `^%s %s %s %s `@and `^%s`@.`n`n",$one,$two,$three,$four,$five); + if ($almost==5){ + output("\"Congratulations!\", the old man exclaims."); + output("\"Tis rare for anybody to win this prize\"`n"); + output("`^The old man hands you your winnings of %s gold",$prize); + $session['user']['gold']+=$prize; + debuglog("won $prize gold at sixes game."); + addnews("%s won %s gold after rolling 5 sixes in the %s.",$session['user']['name'],$prize, get_module_setting("tavernname","darkhorse")); + set_module_setting("jackpot",100); + set_module_setting("lastpot5",$prize); + $lastwin5=$session['user']['name']; + set_module_setting("lastwin5",$lastwin5); + }elseif ($almost==4){ + $win=round($prize * .1); + $prize=$prize - $win; + set_module_setting("jackpot", $prize); + $session['user']['gold']+=$win; + debuglog("won $win gold at sixes game."); + set_module_setting("lastpot4",$win); + $lastwin4=$session['user']['name']; + set_module_setting("lastwin4",$lastwin4); + + addnews("%s won %s gold after rolling 4 sixes in the %s.",$session['user']['name'],$win, get_module_setting("tavernname", "darkhorse")); + output("`@The old man leans over the table to peer at your dice and looks thoughtful for a moment.`n"); + output("\"Well now...four out of five sixes is darned close, my friend. I think your effort deserves %s gold in reward.\"`n`n",$win); + output("`^The old man hands you %s gold.", $win); + }elseif ($almost==3){ + $win=round($prize * .05); + $prize=$prize - $win; + set_module_setting("jackpot", $prize); + $session['user']['gold']+=$win; + set_module_setting("lastpot3",$win); + $lastwin3=$session['user']['name']; + set_module_setting("lastwin3",$lastwin3); + + debuglog("won $win gold at sixes game."); + addnews("%s won %s gold after rolling 3 sixes in the %s.",$session['user']['name'],$win,get_module_setting("tavernname", "darkhorse")); + output("`@The old man leans over the table to peer at your dice and cackles as he notes your results.`n"); + output("\"Well now...three out of five sixes isn't a bad effort, my friend. I'll give ye %s gold for that try.\"`n`n",$win); + output("`^The old man hands you %s gold.", $win); + }else{ + output("The old man cackles. You rolled %s %s...but that's not enough!`n`n", $almost, translate_inline($almost == 1? "six": "sixes")); + output("Disappointed, you walk away."); + } + } + }else{ + output("`@The old man looks up at you and shakes his head slowly.`n"); + output("`%\"I think you've had enough for today. Why don't you come back tomorrow?\""); + } + addnav("Play the Games"); + addnav("Play again?","runmodule.php?module=game_fivesix&ret=$ret&what=play"); + } + addnav("Other Games",appendlink(urldecode($ret), "op=oldman")); + addnav("Return to the Main Room",appendlink(urldecode($ret), "op=tavern")); + + page_footer(); +} +?> diff --git a/lotgd-web/lotgd/modules/game_stones.php b/lotgd-web/lotgd/modules/game_stones.php new file mode 100755 index 0000000..54ee02b --- /dev/null +++ b/lotgd-web/lotgd/modules/game_stones.php @@ -0,0 +1,132 @@ +"Stones Game for DarkHorse", + "author"=>"Eric Stevens", + "version"=>"1.1", + "category"=>"Darkhorse Game", + "download"=>"core_module", + ); + return $info; +} + +function game_stones_install(){ + global $session; + debug("Adding Hooks"); + module_addhook("darkhorsegame"); + return true; +} + +function game_stones_uninstall(){ + output("Uninstalling this module.`n"); + return true; +} + +function game_stones_dohook($hookname, $args){ + if ($hookname=="darkhorsegame"){ + $ret = urlencode($args['return']); + addnav("S?Play Stones Game", + "runmodule.php?module=game_stones&ret=$ret"); + } + return $args; +} + +function game_stones_run(){ + global $session; + $ret = urlencode(httpget("ret")); + page_header("A Game of Stones"); + $stones = unserialize($session['user']['specialmisc']); + if (!is_array($stones)) $stones = array(); + $side = httpget('side'); + if ($side=="likepair") $stones['side']="likepair"; + if ($side=="unlikepair") $stones['side']="unlikepair"; + $bet = httppost('bet'); + if ($bet != "") + $stones['bet'] = min($session['user']['gold'], abs((int)$bet)); + if (!isset($stones['side']) || $stones['side']==""){ + output("`3The old man explains his game, \"`7I have a bag with 6 red stones, and 10 blue stones in it. You can choose between 'like pair' or 'unlike pair.' I will then draw out pairs of stones two at a time. If they are the same color as each other, they go to which ever of us is 'like pair,' and otherwise they go to which ever of us is 'unlike pair.' Whoever has the most stones at the end will win. If we have the same number, then it is a draw, and no one wins.`3\""); + addnav("Never Mind", appendlink(urldecode($ret), "op=oldman")); + addnav("Like Pair", + "runmodule.php?module=game_stones&side=likepair&ret=$ret"); + addnav("Unlike Pair", + "runmodule.php?module=game_stones&side=unlikepair&ret=$ret"); + $stones['red']=6; + $stones['blue']=10; + $stones['player']=0; + $stones['oldman']=0; + }elseif (!isset($stones['bet']) || $stones['bet']==0){ + $s1 = translate_inline($stones['side']=="likepair"?"Like":"Unlike"); + $s2 = translate_inline($stones['side']=="likepair"?"unlike":"like"); + output("`3\"`7%s pair for you, and %s pair for me it is then! How much do you bet?`3\"", $s1, $s2); + rawoutput("
"); + rawoutput(""); + $b = translate_inline("Bet"); + rawoutput(""); + rawoutput("
"); + rawoutput(""); + addnav("","runmodule.php?module=game_stones&ret=$ret"); + addnav("Never Mind", appendlink(urldecode($ret), "op=oldman")); + }elseif ($stones['red']+$stones['blue'] > 0 && + $stones['oldman']<=8 && $stones['player']<=8){ + $s1=""; + $s2=""; + $rstone = translate_inline("`\$red`3"); + $bstone = translate_inline("`!blue`3"); + while ($s1=="" || $s2==""){ + $s1 = e_rand(1,($stones['red']+$stones['blue'])); + if ($s1<=$stones['red']) { + $s1=$rstone; + $stones['red']--; + }else{ + $s1=$bstone; + $stones['blue']--; + } + if ($s2=="") { + $s2=$s1; + $s1=""; + } + } + output("`3The old man reaches into his bag and withdraws two stones."); + output("They are %s and %s. Your bet is `^%s`3.`n`n", $s1, $s2, $stones['bet']); + + if ($stones['side']=="likepair" && $s1==$s2) { + $winner="your"; + $stones['player']+=2; + } elseif ($stones['side']!="likepair" && $s1!=$s2) { + $winner="your"; + $stones['player']+=2; + } else { + $stones['oldman']+=2; + $winner = "his"; + } + $winner = translate_inline($winner); + + output("Since you are %s pairs, the old man places the stones in %s pile.`n`n", translate_inline($stones['side']=="likepair"?"like":"unlike"), $winner); + + output("You currently have `^%s`3 stones in your pile, and the old man has `^%s`3 stones in his.`n`n", $stones['player'], $stones['oldman']); + output("There are %s %s stones and %s %s stones in the bag yet.", $stones['red'], $rstone, $stones['blue'], $bstone); + addnav("Continue","runmodule.php?module=game_stones&ret=$ret"); + }else{ + if ($stones['player']>$stones['oldman']){ + output("`3Having defeated the old man at his game, you claim your `^%s`3 gold.", $stones['bet']); + $session['user']['gold']+=$stones['bet']; + debuglog("won {$stones['bet']} gold in the stones game"); + }elseif ($stones['player']<$stones['oldman']){ + output("`3Having defeated you at his game, the old man claims your `^%s`3 gold.", $stones['bet']); + $session['user']['gold']-=$stones['bet']; + debuglog("lost {$stones['bet']} gold in the stones game"); + }else{ + output("`3Having tied the old man, you call it a draw."); + } + $stones=array(); + addnav("Play again?","runmodule.php?module=game_stones&ret=$ret"); + addnav("Other Games",appendlink(urldecode($ret), "op=oldman")); + addnav("Return to Main Room", appendlink(urldecode($ret), "op=tavern")); + } + $session['user']['specialmisc']=serialize($stones); + page_footer(); +} +?> diff --git a/lotgd-web/lotgd/modules/glowingstream.php b/lotgd-web/lotgd/modules/glowingstream.php new file mode 100755 index 0000000..358f88a --- /dev/null +++ b/lotgd-web/lotgd/modules/glowingstream.php @@ -0,0 +1,125 @@ +"Glowing Stream", + "version"=>"1.1", + "author"=>"Eric Stevens", + "category"=>"Forest Specials", + "download"=>"core_module", + ); + return $info; +} +debug("glowingstream"); +function glowingstream_install(){ + module_addeventhook("forest", "return 100;"); + module_addeventhook("travel", "return 100;"); + return true; +} + +function glowingstream_uninstall(){ + return true; +} + +function glowingstream_dohook($hookname,$args){ + return $args; +} + +function glowingstream_runevent($type,$link) +{ + global $session; + // We only care about the forest here currently. + $from = $link; + $session['user']['specialinc']="module:glowingstream"; + + $op = httpget('op'); + if ($op=="" || $op=="search"){ + output("`#You discover a small stream of faintly glowing water that babbles over round pure white stones."); + output("You can sense a magical power in the water."); + output("Drinking this water may yield untold powers, or it may result in crippling disability."); + output("Do you wish to take a drink?"); + addnav("Drink", $from . "op=drink"); + addnav("Don't Drink", $from . "op=nodrink"); + }elseif ($op=="drink"){ + $session['user']['specialinc']=""; + $rand = e_rand(1,10); + output("`#Knowing that the water could yield deadly results, you decide to take your chances."); + output("Kneeling down at the edge of the stream, you take a long hard draught from the cold stream."); + output("You feel a warmth growing out from your chest...`n"); + switch ($rand){ + case 1: + output("`iIt is followed by a dreadful clammy cold`i."); + output("You stagger and claw at your breast as you feel what you imagine to be the hand of the reaper placing its unbreakable grip on your heart.`n`n"); + output("You collapse by the edge of the stream, only just now noticing that the stones you observed before were actually the bleached skulls of other adventurers as unfortunate as you.`n`n"); + output("Darkness creeps in around the edges of your vision as you lay staring up through the trees."); + output("Your breath comes shallower and less and less frequently as warm sunshine splashes on your face, in sharp contrast to the void taking residence in your heart.`n`n"); + output("`^You have died due to the foul power of the stream.`n"); + output("As the woodland creatures know the danger of this place, none are here to scavenge from your corpse, thus you may keep your gold.`n"); + output("The life lesson learned here balances any experience you would have lost.`n"); + output("You may continue playing again tomorrow."); + $session['user']['alive']=false; + $session['user']['hitpoints']=0; + addnav("Daily News","news.php"); + addnews("%s encountered strange powers in the forest, and was not seen again.",$session['user']['name']); + break; + case 2: + output("`iIt is followed by a dreadful clammy cold`i."); + output("You stagger and claw at your breast as you feel what you imagine to be the hand of the reaper placing its unbreakable grip on your heart.`n`n"); + output("You collapse by the edge of the stream, only just now noticing that the stones you observed before were actually the bleached skulls of other adventurers as unfortunate as you.`n`n"); + output("Darkness creeps in around the edges of your vision as you lay staring up through the trees."); + output("Your breath comes shallower and less and less frequently as warm sunshine splashes on your face, in sharp contrast to the void taking residence in your heart.`n`n"); + output("As you exhale your last breath, you distantly hear a tiny giggle."); + output("You find the strength to open your eyes, and find yourself staring at a tiny fairy who, flying just above your face is inadvertently sprinkling its fairy dust all over you, granting you the power to crawl once again to your feet."); + output("The lurch to your feet startles the tiny creature, and before you have a chance to thank it, it flits off.`n`n"); + output("`^You narrowly avoid death, you lose a forest fight, and most of your hitpoints."); + if ($session['user']['turns']>0) $session['user']['turns']--; + if ($session['user']['hitpoints'] > + ($session['user']['maxhitpoints']*.1)) + $session['user']['hitpoints'] = + round($session['user']['maxhitpoints']*.1,0); + if ($session['user']['hitpoints'] < 1) + $session['user']['hitpoints'] = 1; + break; + case 3: + output("You feel INVIGORATED!`n`n"); + output("`^Your hitpoints have been restored to full, and you feel the energy for another turn in the forest."); + if ($session['user']['hitpoints'] < + $session['user']['maxhitpoints']) + $session['user']['hitpoints'] = + $session['user']['maxhitpoints']; + $session['user']['turns']++; + break; + case 4: + output("You feel PERCEPTIVE!`n`n"); + output("You notice something glittering under one of the pebbles that line the stream.`n`n"); + output("`^You find a `%GEM`^!"); + $session['user']['gems']++; + debuglog("found 1 gem by the stream"); + break; + case 5: + case 6: + case 7: + output("You feel ENERGETIC!`n`n"); + output("`^You receive an extra forest fight!"); + $session['user']['turns']++; + break; + default: + output("You feel HEALTHY!`n`n"); + output("`^Your hitpoints have been restored to full."); + if ($session['user']['hitpoints'] < + $session['user']['maxhitpoints']) + $session['user']['hitpoints'] = + $session['user']['maxhitpoints']; + } + output("`0"); + }else{ + $session['user']['specialinc']=""; + output("`#Fearing the dreadful power in the water, you decide to let it be, and return to the forest.`0"); + } +} + +function glowingstream_run(){ +} +?> diff --git a/lotgd-web/lotgd/modules/goldmine.php b/lotgd-web/lotgd/modules/goldmine.php new file mode 100755 index 0000000..c517f35 --- /dev/null +++ b/lotgd-web/lotgd/modules/goldmine.php @@ -0,0 +1,282 @@ +"Gold Mine", + "version"=>"1.0", + "author"=>"Ville Valtokari", + "category"=>"Forest Specials", + "download"=>"core_module", + "settings"=>array( + "Goldmine Event Settings,title", + "alwaystether"=>"Chance the player will tether their mount automatically,range,0,100,1|10", + "percentgemloss"=>"Percentage of gems lost on death in mine,range,0,100,1|0", + "percentgoldloss"=>"Percentage of gold lost on death in mine,range,0,100,1|0", + ), + "prefs-mounts"=>array( + "Goldmine Mount Preferences,title", + "entermine"=>"Chance of entering mine,range,0,100,1|0", + "dieinmine"=>"Chance of dying in the mine,range,0,100,1|0", + "saveplayer"=>"Chance of saving player in mine,range,0,100,1|0", + "tethermsg"=>"Message when mount is tethered|", + "deathmsg"=>"Message when mount dies|", + "savemsg"=>"Message when mount saves player|", + ), + ); + return $info; +} + +function goldmine_install(){ + module_addeventhook("forest", "return 100;"); + $sql = "DESCRIBE " . db_prefix("mounts"); + $result = db_query($sql); + while($row = db_fetch_assoc($result)) { + if ($row['Field'] == "mine_canenter") { + debug("Migrating mine_canenter for all mounts"); + $sql = "INSERT INTO " . db_prefix("module_objprefs") . " (modulename,objtype,setting,objid,value) SELECT 'goldmine','mounts','entermine',mountid,mine_canenter FROM " . db_prefix("mounts") . " WHERE mine_canenter>0"; + db_query($sql); + debug("Dropping mine_canenter field from mounts table"); + $sql = "ALTER TABLE " . db_prefix("mounts") . " DROP mine_canenter"; + db_query($sql); + } + if ($row['Field'] == "mine_candie") { + debug("Migrating mine_candie for all mounts"); + $sql = "INSERT INTO " . db_prefix("module_objprefs") . " (modulename,objtype,setting,objid,value) SELECT 'goldmine','mounts','dieinmine',mountid,mine_candie FROM " . db_prefix("mounts") . " WHERE mine_candie>0"; + db_query($sql); + debug("Dropping mine_candie field from mounts table"); + $sql = "ALTER TABLE " . db_prefix("mounts") . " DROP mine_candie"; + db_query($sql); + } + if ($row['Field'] == "mine_cansave") { + debug("Migrating mine_cansave for all mounts"); + $sql = "INSERT INTO " . db_prefix("module_objprefs") . " (modulename,objtype,setting,objid,value) SELECT 'goldmine','mounts','saveplayer',mountid,mine_cansave FROM " . db_prefix("mounts") . " WHERE mine_cansave>0"; + db_query($sql); + debug("Dropping mine_cansave field from mounts table"); + $sql = "ALTER TABLE " . db_prefix("mounts") . " DROP mine_cansave"; + db_query($sql); + } + if ($row['Field'] == "mine_tethermsg") { + debug("Migrating mine_tethermsg for all mounts"); + $sql = "INSERT INTO " . db_prefix("module_objprefs") . " (modulename,objtype,setting,objid,value) SELECT 'goldmine','mounts','tethermsg',mountid,mine_tethermsg FROM " . db_prefix("mounts") . " WHERE mine_tethermsg!=''"; + db_query($sql); + debug("Dropping mine_tethermsg field from mounts table"); + $sql = "ALTER TABLE " . db_prefix("mounts") . " DROP mine_tethermsg"; + db_query($sql); + } + if ($row['Field'] == "mine_deathmsg") { + debug("Migrating mine_deathmsg for all mounts"); + $sql = "INSERT INTO " . db_prefix("module_objprefs") . " (modulename,objtype,setting,objid,value) SELECT 'goldmine','mounts','deathmsg',mountid,mine_deathmsg FROM " . db_prefix("mounts") . " WHERE mine_deathmsg!=''"; + db_query($sql); + debug("Dropping mine_deathmsg field from mounts table"); + $sql = "ALTER TABLE " . db_prefix("mounts") . " DROP mine_deathmsg"; + db_query($sql); + } + if ($row['Field'] == "mine_savemsg") { + debug("Migrating mine_savemsg for all mounts"); + $sql = "INSERT INTO " . db_prefix("module_objprefs") . " (modulename,objtype,setting,objid,value) SELECT 'goldmine','mounts','savemsg',mountid,mine_savemsg FROM " . db_prefix("mounts") . " WHERE mine_savemsg!=''"; + db_query($sql); + debug("Dropping mine_savemsg field from mounts table"); + $sql = "ALTER TABLE " . db_prefix("mounts") . " DROP mine_savemsg"; + db_query($sql); + } + } + return true; +} + +function goldmine_uninstall(){ + return true; +} + +function goldmine_dohook($hookname,$args){ + return $args; +} + +function goldmine_runevent($type) +{ + global $session; + // The only type of event we care about are the forest. + $from = "forest.php?"; + + $hashorse = $session['user']['hashorse']; + $horsecanenter = 0; + $horsecandie = 0; + $horsecansave = 0; + if ($hashorse) { + $horsecanenter = get_module_objpref('mounts', $hashorse, 'entermine'); + // See if we automatically tether; + if (e_rand(1, 100) <= get_module_setting("alwaystether")) + $horsecanenter = 0; + if ($horsecanenter) { + // The mount cannot die or save you if it cannot enter + $horsecandie = get_module_objpref('mounts', $hashorse, 'dieinmine'); + $horsecansave = get_module_objpref('mounts', $hashorse, 'saveplayer'); + } + require_once("lib/mountname.php"); + list($mountname, $lcmountname) = getmountname(); + } + $session['user']['specialinc']="module:goldmine"; + $op = httpget('op'); + if ($op == "" || $op == "search") { + output("`2You found an old abandoned mine in the depths of the forest."); + output("There is some old mining equipment nearby.`n`n"); + output("`^As you look around you realize that this is going to be a lot of work."); + output("So much so in fact that you will lose a forest fight for the day if you attempt it.`n`n"); + output("`^Looking around a bit more, you do notice what looks like evidence of occasional cave-ins in the mine.`n`n"); + addnav("Mine for gold and gems", $from . "op=mine"); + addnav("Return to the forest", $from . "op=no"); + } elseif ($op == "no") { + output("`2You decide you don't have time for this slow way to gain gold and gems, and so leave the old mine behind and go on your way...`n"); + $session['user']['specialinc']=""; + } elseif ($op=="mine") { + if ($session['user']['turns']<=0) { + output("`2You are too tired to mine anymore..`n"); + $session['user']['specialinc']=""; + } else { + // Horsecanenter is a percent, so, if rand(1-100) > enterpercent, + // tether it. Set enter percent to 0 (the default), to always + // tether. + if (e_rand(1, 100) > $horsecanenter && $hashorse) { + $msg = get_module_objpref('mounts',$hashorse, 'tethermsg'); + if ($msg) output ($msg); + else { + output("`&Seeing that the mine entrance is too small for %s`&, you tether it off to the side of the entrance.`n", $lcmountname); + } + // The mount it tethered, so it cannot die nor save the player + $horsecanenter = 0; + $horsecandie = 0; + $horsecansave = 0; + } + output("`2You pick up the mining equipment and start mining for gold and gems...`n`n"); + $rand = e_rand(1,20); + switch ($rand){ + case 1:case 2:case 3:case 4: case 5: + output("`2After a few hours of hard work you have only found worthless stones and one skull...`n`n"); + output("`^You lose one forest fight while digging.`n`n"); + if ($session['user']['turns']>0) $session['user']['turns']--; + $session['user']['specialinc']=""; + break; + case 6: case 7: case 8:case 9: case 10: + $gold = e_rand($session['user']['level']*5, $session['user']['level']*20); + output("`^After a few hours of hard work, you find %s gold!`n`n", $gold); + $session['user']['gold'] += $gold; + debuglog("found $gold gold in the goldmine"); + output("`^You lose one forest fight while digging.`n`n"); + if ($session['user']['turns']>0) $session['user']['turns']--; + $session['user']['specialinc']=""; + break; + case 11: case 12: case 13: case 14: case 15: + $gems = e_rand(1, round($session['user']['level']/7)+1); + output("`^After a few hours of hard work, you find `%%s %s`^!`n`n", $gems, translate_inline($gems == 1 ? "gem" : "gems")); + $session['user']['gems'] += $gems; + debuglog("found $gems gems in the goldmine"); + output("`^You lose one forest fight while digging.`n`n"); + if ($session['user']['turns']>0) $session['user']['turns']--; + $session['user']['specialinc']=""; + break; + case 16: case 17: case 18: + $gold = e_rand($session['user']['level']*10, $session['user']['level']*40); + $gems = e_rand(1, round($session['user']['level']/3)+1); + output("`^You have found the mother lode!`n`n"); + output("`^After a few hours of hard work, you find `%%s %s`^ and %s gold!`n`n", $gems, translate_inline($gems==1?"gem":"gems"), $gold); + $session['user']['gems'] += $gems; + $session['user']['gold'] += $gold; + debuglog("found $gold gold and $gems gems in the goldmine"); + output("`^You lose one forest fight while digging.`n`n"); + if ($session['user']['turns']>0) $session['user']['turns']--; + $session['user']['specialinc']=""; + break; + case 19: case 20: + output("`2After a lot of hard work you believe you have spotted a `&huge`2 `%gem`2 and some `6gold`2.`n"); + output("`2Anxious to be rich, you rear back and slam the pick home, knowing that the harder you hit, the quicker you will be done....`n"); + output("`7Unfortunately, you are quickly done in.`n"); + output("Your over-exuberant hit caused a massive cave in.`n"); + // Find the chance of dying based on race + $vals = modulehook("raceminedeath"); + $dead = 0; + $racesave = 1; + if (isset($vals['racesave']) && $vals['racesave']) { + if ($vals['schema']) tlschema($vals['schema']); + $racemsg = translate_inline($vals['racesave']); + if ($vals['schema']) tlschema(); + } + + if (isset($vals['chance']) && (e_rand(1, 100) < $vals['chance'])) { + $dead = 1; + $racesave = 0; + $racemsg = ""; + } + if ($dead) { + // The player has died, see if their horse saves them + if (isset($horsecansave) && (e_rand(1,100) <= $horsecansave)) { + $dead = 0; + $horsesave = 1; + } + } + // If we are still dead, see if the horse dies too. + $session['user']['specialinc']=""; + if ($dead) { + if (e_rand(1,100) <= $horsecandie) $horsedead = 1; + output("You have been crushed under a ton of rock.`n`nPerhaps the next adventurer will recover your body and bury it properly.`n"); + if ($horsedead) { + $msg = get_module_objpref('mounts', $hashorse, 'deathmsg'); + if ($msg) output ($msg); + else { + output("%s`7's bones were buried right alongside yours.", $mountname); + } + global $playermount; + $debugmount = $playermount['mountname']; + debuglog("lost their mount, a $debugmount, in a mine collapse."); + $session['user']['hashorse'] = 0; + if(isset($session['bufflist']['mount'])) + strip_buff("mount"); + } elseif ($hashorse) { + if ($horsecanenter) { + output("%s`7 managed to escape being crushed.", $mountname); + output("You know that it is trained to return to the village.`n"); + } else { + output("Fortunately you left %s`7 tethered outside.", $lcmountname); + output("You know that it is trained to return to the village.`n"); + } + } + $exp=round($session['user']['experience']*0.1, 0); + output("At least you learned something about mining from this experience and have gained %s experience.`n`n", $exp); + output("`3You may continue to play tomorrow`n"); + $session['user']['experience']+=$exp; + $session['user']['alive']=false; + $session['user']['hitpoints']=0; + $gemlost = round(get_module_setting("percentgemloss")/100 * $session['user']['gems'], 0); + $goldlost = round(get_module_setting("percentgoldloss")/100 * $session['user']['gold'], 0); + debuglog("lost $goldlost gold and $gemlost gems by dying in the goldmine"); + output("`^%s gold `&and `%%s %s`& were lost when you were buried!", $goldlost, $gemlost, translate_inline($gemlost == 1?"gem":"gems")); + $session['user']['gold'] -= $goldlost; + $session['user']['gems'] -= $gemlost; + addnav("Daily News","news.php"); + addnews("%s was completely buried after becoming greedy digging in the mines.",$session['user']['name']); + } else { + if (isset($horsesave) && $horsesave) { + $msg = get_module_objpref('mounts', $hashorse, 'savemsg'); + if ($msg) output ($msg); + else { + output("%s`7 managed to drag you to safety in the nick of time!`n", $mountname); + } + } elseif ($racesave) { + if (isset($racemsg) && $racemsg) output_notl($racemsg); + else { + output("Through sheer luck, you manage to escape the cave-in intact!`n"); + } + } + output("`n`&Your close call scared you so badly that you cannot face any more opponents today.`n"); + debuglog("`&has lost all turns for the day due to a close call in the mine."); + $session['user']['turns']=0; + } + break; + } + } + } +} + +function goldmine_run(){ +} +?> diff --git a/lotgd-web/lotgd/modules/lovers.php b/lotgd-web/lotgd/modules/lovers.php new file mode 100755 index 0000000..8abe07b --- /dev/null +++ b/lotgd-web/lotgd/modules/lovers.php @@ -0,0 +1,151 @@ +"Violet and Seth Lovers", + "author"=>"Eric Stevens", + "version"=>"1.0", + "category"=>"Inn", + "download"=>"core_module", + "prefs"=>array( + "Lover Module User Preferences,title", + "seenlover"=>"Visited Lover Today?,bool|0" + ) + ); + return $info; +} + +function lovers_install(){ + module_addhook("newday"); + module_addhook("inn"); + + $sql = "DESCRIBE " . db_prefix("accounts"); + $result = db_query($sql); + while ($row = db_fetch_assoc($result)){ + if ($row['Field']=="seenlover"){ + $sql = "SELECT seenlover,acctid FROM " . db_prefix("accounts") . " WHERE seenlover>0"; + $result1 = db_query($sql); + debug("Migrating seenlover.`n"); + while ($row1 = db_fetch_assoc($result1)){ + $sql = "INSERT INTO " . db_prefix("module_userprefs") . " (modulename,setting,userid,value) VALUES ('lovers','seenlover',{$row1['acctid']},{$row1['seenlover']})"; + db_query($sql); + }//end while + debug("Dropping seenlover column from the user table.`n"); + $sql = "ALTER TABLE " . db_prefix("accounts") . " DROP seenlover"; + db_query($sql); + //drop it from the user's session too. + unset($session['user']['seenlover']); + }//end if + }//end while + return true; +} + +function lovers_uninstall(){ + return true; +} + +function lovers_dohook($hookname, $args){ + global $session; + $partner = get_partner(); + switch($hookname){ + case "newday": + set_module_pref("seenlover",0); + if ($session['user']['marriedto'] == 4294967295){ + $dk = $session['user']['dragonkills']; + + + // 0.7 seemed to be a perfect balance of no loss of charm. + // 1.0 was too much. + $dk = max(1, round(.85 * sqrt($dk), 0)); + $charmloss= e_rand(1,$dk); + $session['user']['charm'] -= $charmloss; + output("`n`%You're married, so there's no reason to keep up that perfect image, and you let yourself go a little today ( You lose `\$%s charmpoint(s)`%).`n",$charmloss); + if ($session['user']['charm']<=0){ + output("`bWhen you wake up, you find a note next to you, reading`n`5Dear %s`5,`n",$session['user']['name']); + output("Despite many great kisses, I find that I'm simply no longer attracted to you the way I used to be.`n`n"); + output("Call me fickle, call me flakey, but I need to move on."); + output("There are other warriors in the land, and I think some of them are really hot."); + output("So it's not you, it's me, etcetera etcetera.`n`n"); + output("No hard feelings, Love,`n%s`b`n",$partner); + addnews("`\$%s`\$ has left %s`\$ to pursue \"other interests.\"`0",$partner, $session['user']['name']); + $session['user']['marriedto']=0; + $session['user']['charm']=0; + } + } + break; + case "inn": + addnav("Things to do"); + if ($session['user']['sex']==SEX_MALE){ + addnav(array("F?Flirt with %s", $partner), + "runmodule.php?module=lovers&op=flirt"); + addnav(array("Chat with %s",translate_inline(getsetting("bard", "`^Seth"))), + "runmodule.php?module=lovers&op=chat"); + }else{ + addnav(array("F?Flirt with %s", $partner), + "runmodule.php?module=lovers&op=flirt"); + addnav(array("Gossip with %s",translate_inline(getsetting("barmaid", "`%Violet"))), + "runmodule.php?module=lovers&op=chat"); + } + break; + } + return $args; +} + +function lovers_run(){ + global $session; + require_once("lib/villagenav.php"); + $iname = getsetting("innname", LOCATION_INN); + page_header($iname); + rawoutput(""); + output_notl("`c`b"); + output($iname); + output_notl("`b`c"); + switch(httpget('op')){ + case "flirt": + if ($session['user']['sex']==SEX_MALE) { + require_once("modules/lovers/lovers_violet.php"); + lovers_violet(); + } else { + require_once("modules/lovers/lovers_seth.php"); + lovers_seth(); + } + break; + case "chat": + if ($session['user']['sex']==SEX_MALE) { + require_once("modules/lovers/lovers_chat_seth.php"); + lovers_chat_seth(); + } else { + require_once("modules/lovers/lovers_chat_violet.php"); + lovers_chat_violet(); + } + break; + } + addnav("Return"); + addnav("I?Return to the Inn","inn.php"); + villagenav(); + rawoutput(""); + page_footer(); +} + +function lovers_getbuff(){ + global $session; + $partner = get_partner(); + $buff = array( + "name"=>"`!Lover's Protection", + "rounds"=>60, + "wearoff"=> + array("`!You miss %s`!.`0",$partner), + "defmod"=>1.2, + "roundmsg"=>"Your lover inspires you to keep safe!", + "schema"=>"module-lovers", + ); + return $buff; +} +?> diff --git a/lotgd-web/lotgd/modules/lovers/lovers_chat_seth.php b/lotgd-web/lotgd/modules/lovers/lovers_chat_seth.php new file mode 100755 index 0000000..f9cd27c --- /dev/null +++ b/lotgd-web/lotgd/modules/lovers/lovers_chat_seth.php @@ -0,0 +1,44 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/modules/lovers/lovers_chat_violet.php b/lotgd-web/lotgd/modules/lovers/lovers_chat_violet.php new file mode 100755 index 0000000..281b3cf --- /dev/null +++ b/lotgd-web/lotgd/modules/lovers/lovers_chat_violet.php @@ -0,0 +1,47 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/modules/lovers/lovers_seth.php b/lotgd-web/lotgd/modules/lovers/lovers_seth.php new file mode 100755 index 0000000..56c4b54 --- /dev/null +++ b/lotgd-web/lotgd/modules/lovers/lovers_seth.php @@ -0,0 +1,144 @@ +=2){ + output("%s`0 grins a big toothy grin.",$partner); + output("My, isn't the dimple in his chin cute??"); + if ($c<4) $c++; + }else{ + output("%s`0 raises an eyebrow at you, and asks if you have something in your eye.",$partner); + } + break; + case 2: + if (e_rand($c,4)>=4){ + output("%s`0 smiles at you and says, \"`^My, what pretty eyes you have.`0\"",$partner); + if ($c<7) $c++; + }else{ + output("%s`0 smiles, and waves... to the person standing behind you.",$partner); + } + break; + case 3: + if (e_rand($c,7)>=7){ + output("%s`0 bends over and retrieves your hanky, while you admire his firm posterior.",$partner); + if ($c<11) $c++; + }else{ + output("%s`0 bends over and retrieves your hanky, wipes his nose with it, and gives it back.",$partner); + } + break; + case 4: + if (e_rand($c,11)>=11){ + output("%s`0 places his arm around your waist, and escorts you to the bar where he buys you one of the Inn's fine swills.",$partner); + if ($c<14) $c++; + }else{ + output("%s`0 apologizes, \"`^I'm sorry m'lady, I have no money to spare,`0\" as he turns out his moth-riddled pocket.",$partner); + if ($c>0 && $c<10) $c--; + } + break; + case 5: + if (e_rand($c,14)>=14){ + output("You walk up to %s`0, grab him by the shirt, pull him to his feet, and plant a firm, long kiss right on his handsome lips.",$partner); + output("He collapses after, hair a bit disheveled, and short on breath."); + if ($c<18) $c++; + }else{ + output("You duck down to kiss %s`0 on the lips, but just as you do so, he bends over to tie his shoe.",$partner); + if ($c>0 && $c<13) $c--; + } + break; + case 6: + if (e_rand($c,18)>=18){ + output("Standing at the base of the stairs, you make a come-hither gesture at %s`0.",$partner); + output("He follows you like a puppydog."); + if ($session['user']['turns']>0){ + output("You feel exhausted!"); + $session['user']['turns']-=2; + if ($session['user']['turns']<0) + $session['user']['turns']=0; + } + addnews("`@%s`@ and %s`@ were seen heading up the stairs in the inn together.`0",$session['user']['name'],$partner); + if ($c<25) $c++; + }else{ + output("\"`^I'm sorry m'lady, but I have a show in 5 minutes`0\""); + if ($c>0) $c--; + } + break; + case 7: + output("Walking up to %s`0, you simply demand that he marry you.`n`n",$partner); + output("He looks at you for a few seconds.`n`n"); + if ($c>=22){ + output("\"`^Of course my love!`0\" he says."); + output("The next weeks are a blur as you plan the most wonderous wedding, paid for entirely by %s`0, and head on off to the deep forest for your honeymoon.",$partner); + addnews("`&%s`& and %s`& are joined today in joyous matrimony!!!",$session['user']['name'],$partner); + $session['user']['marriedto']=INT_MAX; + apply_buff('lover',lovers_getbuff()); + }else{ + output("%s`0 says, \"`^I'm sorry, apparently I've given you the wrong impression, I think we should just be friends.`0\"", $partner); + output("Depressed, you have no more desire to fight in the forest today."); + $session['user']['turns']=0; + debuglog("lost all turns after being rejected for marriage."); + } + break; + }//end switch + if ($c > $session['user']['charm']) + output("`n`n`^You gain a charm point!"); + if ($c < $session['user']['charm']) + output("`n`n`\$You LOSE a charm point!"); + $session['user']['charm']=$c; + }//end if + }//end if + }else{ + //have seen lover + output("You think you had better not push your luck with %s`0 today.",$partner); + } + set_module_pref("seenlover",$seenlover); +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/modules/lovers/lovers_violet.php b/lotgd-web/lotgd/modules/lovers/lovers_violet.php new file mode 100755 index 0000000..0fe8cc3 --- /dev/null +++ b/lotgd-web/lotgd/modules/lovers/lovers_violet.php @@ -0,0 +1,150 @@ +=2){ + output("You wink at %s`0, and she gives you a warm smile in return.",$partner); + if ($c<4) $c++; + }else{ + output("You wink at %s`0, but she pretends not to notice.",$partner); + } + break; + case 2: + output("You stroll confidently across the room toward %s`0.",$partner); + if (e_rand($c,4)>=4){ + output("Taking hold of her hand, you kiss it gently, your lips remaining for only a few seconds."); + output("%s`0 blushes and tucks a strand of hair behind her ear as you walk away, then presses the back side of her hand longingly against her cheek while watching your retreat.",$partner); + if ($c<7) $c++; + }else{ + output("You reach out to grab her hand, but %s`0 takes her hand back and asks if perhaps you'd like a drink.",$partner); + } + break; + case 3: + output("Standing with your back against a wooden column, you wait for %s`0 to wander your way when you call her name.",$partner); + if (e_rand($c,7)>=7){ + output("She approaches, a hint of a smile on her face."); + output("You grab her chin, lift it slightly, and place a firm but quick kiss on her plump lips."); + if ($c<11) $c++; + }else{ + output("She smiles and apologizes, insisting that she is simply too busy to take a moment from her work."); + } + break; + case 4: + output("Sitting at a table, you wait for %s`0 to come your way.",$partner); + if (e_rand($c,11)>=11){ + output("When she does so, you reach up and grab her firmly by the waist, pulling her down on to your lap."); + output("She laughs and throws her arms around your neck in a warm hug before thumping you on the chest, standing up, and insisting that she really must get back to work."); + if ($c<14) $c++; + }else{ + output("When she does so, you reach up to grab her by the waist, but she deftly dodges, careful not to spill the drink that she's carrying."); + if ($c>0 && $c<10) $c--; + } + break; + case 5: + output("Waiting for %s`0 to brush by you, you firmly palm her backside.",$partner); + if (e_rand($c,14)>=14){ + output("She turns and gives you a warm, knowing smile."); + if ($c<18) $c++; + }else{ + output("She turns and slaps you across the face. Hard."); + output("Perhaps you should go a little slower."); + if ($c>0 && $c<13) $c--; + } + break; + case 6: + if (e_rand($c,18)>=18){ + output("Like a whirlwind, you sweep through the inn, grabbing %s`0, who throws her arms around your neck, and whisk her upstairs to her room there.",$partner); + output("Not more than 10 minutes later you stroll down the stairs, smoking a pipe, and grinning from ear to ear."); + if ($session['user']['turns']>0){ + output("You feel exhausted! "); + $session['user']['turns']-=2; + if ($session['user']['turns']<0) $session['user']['turns']=0; + } + addnews("`@%s`@ and %s`@ were seen heading up the stairs in the inn together.`0",$session['user']['name'],$partner); + if ($c<25) $c++; + }else{ + output("Like a whirlwind, you sweep through the inn, and grab for %s`0.",$partner); + output("She turns and slaps your face!"); + output("\"`%What sort of girl do you think I am, anyhow?`0\" she demands! "); + if ($c>0) $c--; + } + break; + case 7: + output("%s`0 is working feverishly to serve patrons of the inn.",$partner); + output("You stroll up to her and take the mugs out of her hand, placing them on a nearby table."); + output("Amidst her protests you kneel down on one knee, taking her hand in yours."); + output("She quiets as you stare up at her and utter the question that you never thought you'd utter."); + output("She stares at you and you immediately know the answer by the look on her face.`n`n"); + if ($c>=22){ + output("It is a look of exceeding happiness."); + output("\"`%Yes!`0\" she says, \"`%Yes, yes yes!!!`0\""); + output("Her final confirmations are buried in a flurry of kisses about your face and neck.`n`n"); + output("The next days are a blur; you and %s`0 are married in the abbey down the street, in a gorgeous ceremony with many frilly girly things.",$partner); + addnews("`&%s`& and %s`& are joined today in joyous matrimony!!!",$session['user']['name'],$partner); + $session['user']['marriedto']=INT_MAX; + apply_buff('lover',lovers_getbuff()); + }else{ + output("It is a look of sadness."); + output("\"`%No`0,\" she says, \"`%I'm not yet ready to settle down`0.\"`n`n"); + output("Disheartened, you no longer possess the will to pursue any more forest adventures today."); + $session['user']['turns']=0; + debuglog("lost all turns after being rejected for marriage."); + } + } + if ($c > $session['user']['charm']) + output("`n`n`^You gain a charm point!"); + if ($c < $session['user']['charm']) + output("`n`n`\$You LOSE a charm point!"); + $session['user']['charm']=$c; + } + }else{ + output("You think you had better not push your luck with %s`0 today.",$partner); + } + set_module_pref("seenlover",$seenlover); +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/modules/outhouse.php b/lotgd-web/lotgd/modules/outhouse.php new file mode 100755 index 0000000..2a65468 --- /dev/null +++ b/lotgd-web/lotgd/modules/outhouse.php @@ -0,0 +1,241 @@ +"Gnomish Outhouse", + "author"=>"John Collins", + "version"=>"2.0", + "category"=>"Forest", + "download"=>"core_module", + "prefs"=>array( + "Gnomish Outhouse User Preferences,title", + "usedouthouse"=>"Used Outhouse Today,bool|0" + ), + "settings"=>array( + "Gnomish Outhouse Settings,title", + "cost"=>"Cost to use the private outhouse,range,1,20,1|5", + "goldinhand"=>"How much gold must user have in hand before they can lose money,range,0,10,1|1", + "giveback"=>"How much gold to give back if the player is rewarded for washing their hands,range,0,20,1|3", + "takeback"=>"How much gold to take if the user is punished for not washing their hands,range,0,20,1|1", + "goodmusthit"=>"Percent of time you get your money back if you wash,range,0,100,1|60", + "badmusthit"=>"Percent of time you lose money if you don't wash,range,0,100,1|50", + "givegempercent"=>"Percent chance of getting a gem if you wash,range,0,100,1|25", + "giveturnchance"=>"Percent chance of a free forest fight if you wash,range,0,100,1|0" + ) + ); + return $info; +} + +function outhouse_install(){ + global $session; + debug("Adding Hooks"); + module_addhook("forest"); + module_addhook("newday"); + + $sql = "DESCRIBE " . db_prefix("accounts"); + $result = db_query($sql); + while ($row = db_fetch_assoc($result)){ + if ($row['Field']=="usedouthouse"){ + $sql = "SELECT usedouthouse,acctid FROM " . db_prefix("accounts") . " WHERE usedouthouse>0"; + $result1 = db_query($sql); + debug("Migrating outhouse usage.`n"); + while ($row1 = db_fetch_assoc($result1)){ + $sql = "INSERT INTO " . db_prefix("module_userprefs") . " (modulename,setting,userid,value) VALUES ('outhouse','usedouthouse',{$row1['acctid']},{$row1['usedouthouse']})"; + db_query($sql); + }//end while + debug("Dropping usedouthouse column from the user table.`n"); + $sql = "ALTER TABLE " . db_prefix("accounts") . " DROP usedouthouse"; + db_query($sql); + //drop it from the user's session too. + unset($session['user']['usedouthouse']); + }//end if + }//end while + return true; +} + +function outhouse_uninstall(){ + output("Uninstalling this module.`n"); + return true; +} + +function outhouse_dohook($hookname, $args){ + if ($hookname=="forest"){ + addnav("O?The Outhouse","runmodule.php?module=outhouse"); + }elseif ($hookname=="newday"){ + set_module_pref("usedouthouse",0); + } + return $args; +} + +function outhouse_run(){ + global $session; + $cost = get_module_setting("cost"); + $goldinhand = get_module_setting("goldinhand"); + $giveback = get_module_setting("giveback"); + $takeback = get_module_setting("takeback"); + $goodmusthit = get_module_setting("goodmusthit"); + $badmusthit = get_module_setting("badmusthit"); + $givegempercent = get_module_setting("givegempercent"); + $giveturnchance= get_module_setting("giveturnchance"); + $returnto = get_module_setting("returnto"); + // Does the player have enough gold to use the Private Toilet? + if ($session['user']['gold'] >= $cost) + $canpay = true; + + $op = httpget('op'); + if ($op == "pay"){ + if (!$canpay) { + page_header("Private Toilet"); + output("`7You reach into your pocket and find that your gold has vanished!"); + output("Dejected, you return to the forest."); + require_once("lib/forest.php"); + forest(true); + page_footer(); + } + + page_header("Private Toilet"); + //$session['user']['usedouthouse'] = 1; + set_module_pref("usedouthouse",1); + output("`7You pay your %s gold to the Toilet Gnome for the privilege of using the paid outhouse.`n", $cost); + output("This is the cleanest outhouse in the land!`n"); + output("The Toilet Paper Gnome tells you if you need anything, just ask.`n"); + if ($session['user']['sex']) { + output("She politely turns her back to you and finishes cleaning the wash stand.`n"); + } else { + output("He politely turns his back to you and finishes cleaning the wash stand.`n"); + } + $session['user']['gold'] -= $cost; + debuglog("spent $cost gold to use the outhouse"); + addnav("Wash your hands", "runmodule.php?module=outhouse&op=washpay"); + addnav("Leave", "runmodule.php?module=outhouse&op=nowash"); + }elseif ($op == "free"){ + page_header("Public Toilet!"); + set_module_pref("usedouthouse",1); + output("`2The smell is so strong your eyes tear up and your nose hair curls!`n"); + output("After blowing his nose with it, the Toilet Paper Gnome gives you 1 sheet of single-ply TP to use.`n"); + output("After looking at the stuff covering his hands, you think you might not want to use it.`n`n"); + output("While %s over the big hole in the middle of the room with the TP Gnome observing you closely, you almost slip in.`n", translate_inline($session['user']['sex']?"squatting":"standing")); + output("You go ahead and take care of business as fast as you can; you can only hold your breath so long.`n"); + addnav("Wash your hands", "runmodule.php?module=outhouse&op=washfree"); + addnav("Leave", "runmodule.php?module=outhouse&op=nowash"); + }elseif ($op == "washpay"|| $op == "washfree"){ + page_header("Wash Stand"); + output("`2Washing your hands is always a good thing. You tidy up, straighten your %s in your reflection in the water, and head on your way.`0`n", $session['user']['armor']); + $goodhabits = e_rand(1, 100); + if ($goodhabits <= $goodmusthit && $op=="washpay"){ + output("`^The Wash Room Fairy blesses you!`n"); + output("`7You receive `^%s`7 gold for being sanitary and clean!`0`n", $giveback); + $session['user']['gold'] += $giveback; + debuglog("got $giveback gold in the outhouse for washing"); + $givegemtemp = e_rand(1, 100); + if ($givegemtemp <= $givegempercent){ + $session['user']['gems']++; + debuglog("gained 1 gem in the outhouse"); + output("`&Aren't you the lucky one to find a `%gem`& there by the doorway!`0`n"); + } + $giveturntemp = e_rand(1, 100); + if ($giveturntemp <= $giveturnchance) { + $session['user']['turns']++; + output("`&You gained a turn!`0`n"); + } + }elseif ($goodhabits <= $goodmusthit && $op == "washfree"){ + if (e_rand(1, 3)==1) { + output("`&You notice a small bag containing `^%s`7 gold that someone left by the washstand.`0", $giveback); + $session['user']['gold'] += $giveback; + debuglog("got $giveback gold in the outhouse for washing"); + } + } + $args = array( + 'soberval'=>0.9, + 'sobermsg'=>"`&Leaving the outhouse, you feel a little more sober.`n", + 'schema'=>"module-outhouse", + ); + modulehook("soberup", $args); + require_once("lib/forest.php"); + forest(true); + }elseif (($op == "nowash")){ + page_header("Stinky Hands"); + output("`2Your hands are soiled and real stinky!`n"); + output("Didn't your mother teach you any better?`n"); + $takeaway = e_rand(1, 100); + if ($takeaway >= $badmusthit){ + if ($session['user']['gold'] >= $goldinhand){ + $session['user']['gold'] -= $takeback; + debuglog("lost $takeback gold in the outhouse for not washing"); + output("`nThe Toilet Paper Gnome has thrown you to the slimy, filthy floor and extracted `\$%s gold`2 %s from you due to your slovenliness!`n", $takeback, translate_inline($takeback ==1?"piece":"pieces")); + } + output("Aren't you glad an embarrassing moment like this isn't in the news?`n"); + if ($session['user']['sex']) { + $msg = "`2Always cool, %s`2 was seen walking around with a long string of toilet paper stuck to her foot.`n"; + } else { + $msg = "`2Always cool, %s`2 was seen walking around with a long string of toilet paper stuck to his foot.`n"; + } + addnews($msg, $session['user']['name']); + } + require_once("lib/forest.php"); + forest(true); + }else{ + page_header("The Outhouses"); + output("`2The nearby village has two outhouses, which it keeps way out here in the forest because of the warding effect of their smell on creatures.`n`n"); + if (get_module_pref("usedouthouse")==0){ + output("In typical caste style, there is a privileged outhouse, and an underprivileged outhouse."); + output("The choice is yours!`0`n`n"); + addnav("Toilets"); + if ($canpay){ + addnav(array("Private Toilet: (%s gold)", $cost), + "runmodule.php?module=outhouse&op=pay"); + }else{ + output("`2The Private Toilet costs `^%s`2 gold.", $cost); + output("Looks like you are going to have to hold it or use the Public Toilet!"); + } + addnav("Public Toilet: (free)", "runmodule.php?module=outhouse&op=free"); + addnav("Hold it", "forest.php"); + }else{ + switch(e_rand(1,3)){ + case 1: + output("The Outhouses are closed for repairs.`n"); + output("You will have to hold it till tomorrow!"); + break; + case 2: + output("As you draw close to the Outhouses, you realize that you simply don't think you can bear the smell of another visit to the Outhouses today."); + break; + case 3: + output("You really don't have anything left to relieve today!"); + break; + } + output("`n`n`7You return to the forest.`0"); + require_once("lib/forest.php"); + forest(true); + } + } + page_footer(); +} +?> diff --git a/lotgd-web/lotgd/modules/racedwarf.php b/lotgd-web/lotgd/modules/racedwarf.php new file mode 100755 index 0000000..67f94d5 --- /dev/null +++ b/lotgd-web/lotgd/modules/racedwarf.php @@ -0,0 +1,341 @@ +"Race - Dwarf", + "version"=>"1.1", + "author"=>"Eric Stevens", + "category"=>"Races", + "download"=>"core_module", + "settings"=>array( + "Dwarven Race Settings,title", + "villagename"=>"Name for the dwarven village|Qexelcrag", + "minedeathchance"=>"Chance for Dwarves to die in the mine,range,0,100,1|5", + ), + "prefs-drinks"=>array( + "Dwarven Race Drink Preferences,title", + "servedkeg"=>"Is this drink served in the dwarven inn?,bool|0", + ), + ); + return $info; +} + +function racedwarf_install(){ + module_addhook("chooserace"); + module_addhook("setrace"); + module_addhook("creatureencounter"); + module_addhook("villagetext"); + module_addhook("travel"); + module_addhook("village"); + module_addhook("validlocation"); + module_addhook("validforestloc"); + module_addhook("moderate"); + module_addhook("drinks-text"); + module_addhook("changesetting"); + module_addhook("drinks-check"); + module_addhook("raceminedeath"); + module_addhook("racenames"); + module_addhook("camplocs"); + module_addhook("mercenarycamptext"); + $sql = "SELECT companionid FROM ".db_prefix("companions")." WHERE name = 'Grizzly Bear'"; + $result = db_query($sql); + if (db_num_rows($result) == 0) { + $sql = "INSERT INTO " . db_prefix("companions") . " (`companionid`, `name`, `category`, `description`, `attack`, `attackperlevel`, `defense`, `defenseperlevel`, `maxhitpoints`, `maxhitpointsperlevel`, `abilities`, `cannotdie`, `cannotbehealed`, `companionlocation`, `companionactive`, `companioncostdks`, `companioncostgems`, `companioncostgold`, `jointext`, `dyingtext`, `allowinshades`, `allowinpvp`, `allowintrain`) VALUES (0, 'Grizzly Bear', 'Wild Beasts', 'You look at the beast knowing that this Grizzly Bear will provide an effective block against attack with its long curved claws and massive body of silver-tipped fur.', 1, 2, 5, 2, 25, 25, 'a:4:{s:5:\"fight\";s:1:\"0\";s:4:\"heal\";s:1:\"0\";s:5:\"magic\";s:1:\"0\";s:6:\"defend\";s:1:\"1\";}', 0, 0, '".get_module_setting("villagename", "racedwarf")."', 1, 0, 4, 600, 'You hear a low, deep belly growl coming from a shadowed corner of the Bestiarium. Curious you walk over to investigate your purchase. As you approach a large form shuffles on all four legs towards the front of its hewn rock enclosure.`n`nThe hunched shoulders of the largest bear you have ever seen ripple as its front haunches push against the ground causing it to stand on its hind legs. It makes another low growl before dropping back on all four legs to follow you on your adventure.', 'The grizzly gets scared by the multitude of blows and hits he has to take and flees into the forest.', 1, 0, 0)"; + db_query($sql); + debug("Inserted new companion: Grizzly Bear"); + } + return true; +} + +function racedwarf_uninstall(){ + global $session; + $vname = get_module_setting("villagename", "racedwarf");; + $gname = get_module_setting("villagename"); + $sql = "UPDATE " . db_prefix("accounts") . " SET location='$vname' WHERE location = '$gname'"; + db_query($sql); + if ($session['user']['location'] == $gname) + $session['user']['location'] = $vname; + // Force anyone who was a Dwarf to rechoose race + $sql = "UPDATE " . db_prefix("accounts") . " SET race='" . RACE_UNKNOWN . "' WHERE race='Dwarf'"; + db_query($sql); + if ($session['user']['race'] == 'Dwarf') + $session['user']['race'] = RACE_UNKNOWN; + $sql = "UPDATE ". db_prefix("companions") ." SET location='all' WHERE location ='$vname'"; + db_query($sql); + return true; +} + +function racedwarf_dohook($hookname,$args){ + //yeah, the $resline thing is a hack. Sorry, not sure of a better way + //to handle this. + // It could be passed as a hook arg? + global $session,$resline; + $city = get_module_setting("villagename"); + $race = "Dwarf"; + switch($hookname){ + case "racenames": + $args[$race] = $race; + break; + case "raceminedeath": + if ($session['user']['race'] == $race) { + $args['chance'] = get_module_setting("minedeathchance"); + $args['racesave'] = "Fortunately your dwarven skill let you escape unscathed.`n"; + $args['schema'] = "module-racedwarf"; + } + break; + case "changesetting": + // Ignore anything other than villagename setting changes for myself + if ($args['setting'] == "villagename" && $args['module']=="racedwarf") { + if ($session['user']['location'] == $args['old']) + $session['user']['location'] = $args['new']; + $sql = "UPDATE " . db_prefix("accounts") . + " SET location='" . addslashes($args['new']) . + "' WHERE location='" . addslashes($args['old']) . "'"; + db_query($sql); + $sql = "UPDATE ".db_prefix("companions")." SET location='".$args['new']." WHERE location='".$args['old']."'"; + db_query($sql); + if (is_module_active("cities")) { + $sql = "UPDATE " . db_prefix("module_userprefs") . + " SET value='" . addslashes($args['new']) . + "' WHERE modulename='cities' AND setting='homecity'" . + "AND value='" . addslashes($args['old']) . "'"; + db_query($sql); + } + } + break; + case "chooserace": + output("Deep in the subterranean strongholds of %s, home to the noble and fierce `#Dwarven`0 people whose desire for privacy and treasure bears no resemblance to their tiny stature.`n`n", $city, true); + addnav("`#Dwarf`0","newday.php?setrace=$race$resline"); + addnav("","newday.php?setrace=$race$resline"); + break; + case "setrace": + if ($session['user']['race']==$race){ + output("`#As a dwarf, you are more easily able to identify the value of certain goods.`n"); + output("`^You gain extra gold from forest fights!"); + if (is_module_active("cities")) { + if ($session['user']['dragonkills']==0 && + $session['user']['age']==0){ + //new farmthing, set them to wandering around this city. + set_module_setting("newest-$city", + $session['user']['acctid'],"cities"); + } + set_module_pref("homecity",$city,"cities"); + if ($session['user']['age'] == 0) + $session['user']['location']=$city; + } + } + break; + case "validforestloc": + case "validlocation": + if (is_module_active("cities")) + $args[$city] = "village-$race"; + break; + case "moderate": + if (is_module_active("cities")) { + tlschema("commentary"); + $args["village-$race"]=sprintf_translate("City of %s", $city); + tlschema(); + } + break; + case "creatureencounter": + if ($session['user']['race']==$race){ + //get those folks who haven't manually chosen a race + racedwarf_checkcity(); + $args['creaturegold']=round($args['creaturegold']*1.2,0); + } + break; + case "travel": + $capital = getsetting("villagename", LOCATION_FIELDS); + $hotkey = substr($city, 0, 1); + $ccity = urlencode($city); + tlschema("module-cities"); + if ($session['user']['location']==$capital){ + addnav("Safer Travel"); + addnav(array("%s?Go to %s", $hotkey, $city),"runmodule.php?module=cities&op=travel&city=$ccity"); + }elseif ($session['user']['location']!=$city){ + addnav("More Dangerous Travel"); + addnav(array("%s?Go to %s", $hotkey, $city),"runmodule.php?module=cities&op=travel&city=$ccity&d=1"); + } + if ($session['user']['superuser'] & SU_EDIT_USERS){ + addnav("Superuser"); + addnav(array("%s?Go to %s", $hotkey, $city),"runmodule.php?module=cities&op=travel&city=$ccity&su=1"); + } + tlschema(); + break; + case "villagetext": + racedwarf_checkcity(); + if ($session['user']['location'] == $city){ + // Do this differently + $args['text']=array("`#`c`bCavernous %s, home of the dwarves`b`c`n`3Deep in the heart of Mount %s lie the ancient caverns that the Dwarves have called home for centuries. Colossal columns, covered with deeply carved geometric shapes, stretch up into the darkness, supporting the massive weight of the mountain above. All around you, stout dwarves discuss legendary treasures and drink heartily from mighty steins, which they readily fill from tremendous barrels nearby.`n", $city, $city); + $args['schemas']['text'] = "module-racedwarf"; + $args['clock']="`n`3A cleverly crafted crystal prism allows a beam of light to fall through a crack in the great ceiling.`nIt illuminates age old markings carved into the cavern floor, telling you that on the surface it is `#%s`3.`n"; + $args['schemas']['clock'] = "module-racedwarf"; + if (is_module_active("calendar")) { + $args['calendar'] = "`n`3A second prism marks out the date on the calendar as `#Year %4\$s`3, `#%3\$s %2\$s`3.`nYet a third shows the day of the week as `#%1\$s`3.`nSo finely wrought are these displays that you marvel at the cunning and skill involved.`n"; + $args['schemas']['calendar'] = "module-racedwarf"; + } + $args['title']= array("The Caverns of %s", $city); + $args['schemas']['title'] = "module-racedwarf"; + $args['sayline']="brags"; + $args['schemas']['sayline'] = "module-racedwarf"; + $args['talk']="`n`#Nearby some villagers brag:`n"; + $args['schemas']['talk'] = "module-racedwarf"; + $new = get_module_setting("newest-$city", "cities"); + if ($new != 0) { + $sql = "SELECT name FROM " . db_prefix("accounts") . + " WHERE acctid='$new'"; + $result = db_query_cached($sql, "newest-$city"); + $row = db_fetch_assoc($result); + $args['newestplayer'] = $row['name']; + $args['newestid']=$new; + } else { + $args['newestplayer'] = $new; + $args['newestid']=""; + } + if ($new == $session['user']['acctid']) { + $args['newest']="`n`3Being rather new to this life, you pound an empty stein against an ale keg in an attempt to get some of the fabulous ale therein."; + } else { + $args['newest']="`n`3Pounding an empty stein against a yet unopened barrel of ale, wondering how to get to the sweet nectar inside is `#%s`3."; + } + $args['schemas']['newest'] = "module-racedwarf"; + $args['gatenav']="Village Gates"; + $args['schemas']['gatenav'] = "module-racedwarf"; + $args['fightnav']="Th' Arena"; + $args['schemas']['fightnav'] = "module-racedwarf"; + $args['marketnav']="Ancient Treasures"; + $args['schemas']['marketnav'] = "module-racedwarf"; + $args['tavernnav']="Ale Square"; + $args['schemas']['tavernnav'] = "module-racedwarf"; + $args['mercenarycamp']="A Bestiarium"; + $args['schemas']['mercenarycamp'] = "module-racedwarf"; + $args['section']="village-$race"; + unblocknav("mercenarycamp.php"); + } + break; + case "village": + if ($session['user']['location'] == $city) { + tlschema($args['schemas']['tavernnav']); + addnav($args['tavernnav']); + tlschema(); + addnav("K?Great Kegs of Ale","runmodule.php?module=racedwarf&op=ale"); + } + break; + case "drinks-text": + if ($session['user']['location'] != $city) break; + $args["title"]="Great Kegs of Ale"; + $args['schemas']['title'] = "module-racedwarf"; + $args["return"]="B?Return to the Bar"; + $args['schemas']['return'] = "module-racedwarf"; + $args['returnlink']="runmodule.php?module=racedwarf&op=ale"; + $args["demand"]="Pounding your fist on the bar, you demand another drink"; + $args['schemas']['demand'] = "module-racedwarf"; + $args['barkeep'] = "`\$G`4argoyle"; + $args['schemas']['barkeep'] = "module-racedwarf"; + $args["toodrunk"]=" but `0{barkeep}`0 the bartender continues to clean the stein he was working on and growls, \"`qNo more of my drinks for you!`0\""; + $args['schemas']['toodrunk'] = "module-racedwarf"; + $args["toomany"]="`\$G`4argoyle`0 the bartender furrows his balding head. \"`qYou're too weak to handle any more of `QMY`q brew. Begone!`0\""; + $args['schemas']['toomany'] = "module-racedwarf"; + $args['drinksubs']=array( + "/Cedrik/"=>$args['barkeep']."`0", + "/ Violet /"=>translate_inline(" a stranger "), + "/ Seth /"=>translate_inline(" a stranger "), + "/ `.Violet`. /"=>translate_inline(" a stranger "), + "/ `.Seth`. /"=>translate_inline(" a stranger "), + ); + break; + case "drinks-check": + if ($session['user']['location'] == $city) { + $val = get_module_objpref("drinks", $args['drinkid'], "servedkeg"); + $args['allowdrink'] = $val; + } + break; + case "camplocs": + $args[$city] = sprintf_translate("The Village of %s", $city); + break; + case "mercenarycamptext": + if ($session['user']['location'] == $city) { + $args['title'] = "A Bestiarium"; + $args['schemas']['title'] = "module-racedwarf"; + + $args['desc'] = array( + "`5You are making your way to the Bestiarium deep in the bowels of the dwarven mountain stronghold.", + "The sounds of a massive struggle echo off the hewn rock walls of the cavernous passageway.", + "Scuffling is punctuated with the sounds of snarling and the impact of a heavy body slamming into another.`n`n", + + "As you round the corner you find yourself at the edge of an arena.", + "Around the walls are carved out stalls which contain beasts of various shapes, sizes and abilities.`n`n", + + "In the arena, a `&white wolf `5whose size equals that of a mountain pony is lunging towards a massive `~black bear`5.", + "`~The bear`5 on his hind legs stands as tall as an oak.", + "It raises a paw as `&the wolf `5leaps towards him, then with a movement so quick you nearly miss it, `&the wolf `5is batted away to fall on its side.", + "Apparently enraged, `&the wolf`5 leaps snarling to its feet to prepare to lunge again.`n`n", + + "At that moment a stocky dwarf standing at the edge of the arena raises his finger and thumb to his mouth.", + "A piercing whistle cuts through the air.", + "`~The black bear `5lowers himself to all fours and shakes his body, then yawns.", + "`&The white wolf `5pauses, then lays down with his tongue hanging in a pant.", + "Its yellow eyes never leaving you as you walk towards the dwarf.`n`n", + + "\"`tGreetings, Dwalin!`5\" you call out as you approach.", + "\"`tI am in need of a beast to accompany me on my adventures.", + "What do you have available this day?`5\"`n`n" + ); + $args['schemas']['desc'] = "module-racedwarf"; + + $args['buynav'] = "Buy a Beast"; + $args['schemas']['buynav'] = "module-racedwarf"; + + $args['healnav'] = ""; + $args['schemas']['healnav'] = ""; + + $args['healtext'] = ""; + $args['schemas']['healtext'] = ""; + + $args['healnotenough'] = ""; + $args['schemas']['healnotenough'] = ""; + + $args['healpaid'] = ""; + $args['schemas']['healpaid'] = ""; + + // We don not want the healer in this camp. + blocknav("mercenarycamp.php?op=heal", true); + } + break; + } + return $args; +} + +function racedwarf_checkcity(){ + global $session; + $race="Dwarf"; + $city= get_module_setting("villagename"); + + if ($session['user']['race']==$race && is_module_active("cities")){ + //if they're this race and their home city isn't right, set it up. + if (get_module_pref("homecity","cities")!=$city){ //home city is wrong + set_module_pref("homecity",$city,"cities"); + } + } + return true; +} + +function racedwarf_run(){ + $op = httpget("op"); + switch($op){ + case "ale": + require_once("lib/villagenav.php"); + page_header("Great Kegs of Ale"); + output("`3You make your way over to the great kegs of ale lined up near by, looking to score a hearty draught from their mighty reserves."); + output("A mighty dwarven barkeep named `\$G`4argoyle`3 stands at least 4 feet tall, and is serving out the drinks to the boisterous crowd."); + addnav("Drinks"); + modulehook("ale"); + addnav("Other"); + villagenav(); + page_footer(); + break; + } +} +?> diff --git a/lotgd-web/lotgd/modules/raceelf.php b/lotgd-web/lotgd/modules/raceelf.php new file mode 100755 index 0000000..8459040 --- /dev/null +++ b/lotgd-web/lotgd/modules/raceelf.php @@ -0,0 +1,271 @@ +"Race - Elf", + "version"=>"1.0", + "author"=>"Eric Stevens", + "category"=>"Races", + "download"=>"core_module", + "settings"=>array( + "Elven Race Settings,title", + "villagename"=>"Name for the elven village|Glorfindal", + "minedeathchance"=>"Chance for Elves to die in the mine,range,0,100,1|90", + ), + ); + return $info; +} + +function raceelf_install(){ + module_addhook("chooserace"); + module_addhook("setrace"); + module_addhook("newday"); + module_addhook("villagetext"); + module_addhook("travel"); + module_addhook("validlocation"); + module_addhook("validforestloc"); + module_addhook("moderate"); + module_addhook("changesetting"); + module_addhook("raceminedeath"); + module_addhook("pvpadjust"); + module_addhook("adjuststats"); + module_addhook("racenames"); + module_addhook("weaponstext"); + return true; +} + +function raceelf_uninstall(){ + global $session; + $vname = getsetting("villagename", LOCATION_FIELDS); + $gname = get_module_setting("villagename"); + $sql = "UPDATE " . db_prefix("accounts") . " SET location='$vname' WHERE location = '$gname'"; + db_query($sql); + if ($session['user']['location'] == $gname) + $session['user']['location'] = $vname; + // Force anyone who was a Elf to rechoose race + $sql = "UPDATE " . db_prefix("accounts") . " SET race='" . RACE_UNKNOWN . "' WHERE race='Elf'"; + db_query($sql); + if ($session['user']['race'] == 'Elf') + $session['user']['race'] = RACE_UNKNOWN; + return true; +} + +function raceelf_dohook($hookname,$args){ + //yeah, the $resline thing is a hack. Sorry, not sure of a better way + //to handle this. + // Pass it in via args? + global $session,$resline; + $city = get_module_setting("villagename"); + $race = "Elf"; + switch($hookname){ + case "racenames": + $args[$race] = $race; + break; + case "pvpadjust": + if ($args['race'] == $race) { + $args['creaturedefense']+=(1+floor($args['creaturelevel']/5)); + } + break; + case"adjuststats": + if ($args['race'] == $race) { + $args['defense'] += (1+floor($args['level']/5)); + } + break; + case "raceminedeath": + if ($session['user']['race'] == $race) { + $args['chance'] = get_module_setting("minedeathchance"); + } + break; + case "changesetting": + // Ignore anything other than villagename setting changes + if ($args['setting'] == "villagename" && $args['module']=="raceelf") { + if ($session['user']['location'] == $args['old']) + $session['user']['location'] = $args['new']; + $sql = "UPDATE " . db_prefix("accounts") . + " SET location='" . addslashes($args['new']) . + "' WHERE location='" . addslashes($args['old']) . "'"; + db_query($sql); + if (is_module_active("cities")) { + $sql = "UPDATE " . db_prefix("module_userprefs") . + " SET value='" . addslashes($args['new']) . + "' WHERE modulename='cities' AND setting='homecity'" . + "AND value='" . addslashes($args['old']) . "'"; + db_query($sql); + } + } + break; + case "chooserace": + output("High among the trees of the %s forest, in frail looking elaborate `^Elvish`0 structures that look as though they might collapse under the slightest strain, yet have existed for centuries.`n`n", $city, true); + addnav("`^Elf`0","newday.php?setrace=$race$resline"); + addnav("","newday.php?setrace=$race$resline"); + break; + case "setrace": + if ($session['user']['race']==$race){ + output("`^As an elf, you are keenly aware of your surroundings at all times; very little ever catches you by surprise.`n"); + output("You gain extra defense!"); + if (is_module_active("cities")) { + if ($session['user']['dragonkills']==0 && + $session['user']['age']==0){ + //new farmthing, set them to wandering around this city. + set_module_setting("newest-$city", + $session['user']['acctid'],"cities"); + } + set_module_pref("homecity",$city,"cities"); + if ($session['user']['age'] == 0) + $session['user']['location']=$city; + } + } + break; + case "newday": + if ($session['user']['race']==$race){ + raceelf_checkcity(); + apply_buff("racialbenefit",array( + "name"=>"`@Elvish Awareness`0", + "defmod"=>"(?(1+((1+floor(/5))/)):0)", + "allowinpvp"=>1, + "allowintrain"=>1, + "rounds"=>-1, + "schema"=>"module-raceelf", + ) + ); + } + break; + case "validforestloc": + case "validlocation": + if (is_module_active("cities")) + $args[$city]="village-$race"; + break; + case "moderate": + if (is_module_active("cities")) { + tlschema("commentary"); + $args["village-$race"]=sprintf_translate("City of %s", $city); + tlschema(); + } + break; + case "travel": + $capital = getsetting("villagename", LOCATION_FIELDS); + $hotkey = substr($city, 0, 1); + $ccity=urlencode($city); + tlschema("module-cities"); + if ($session['user']['location']==$capital){ + addnav("Safer Travel"); + addnav(array("%s?Go to %s", $hotkey, $city),"runmodule.php?module=cities&op=travel&city=$ccity"); + }elseif ($session['user']['location']!=$city){ + addnav("More Dangerous Travel"); + addnav(array("%s?Go to %s", $hotkey, $city),"runmodule.php?module=cities&op=travel&city=$ccity&d=1"); + } + if ($session['user']['superuser'] & SU_EDIT_USERS){ + addnav("Superuser"); + addnav(array("%s?Go to %s", $hotkey, $city),"runmodule.php?module=cities&op=travel&city=$ccity&su=1"); + } + tlschema(); + break; + case "villagetext": + raceelf_checkcity(); + if ($session['user']['location'] == $city){ + $args['text']=array("`^`c`b%s, Ancestral Home of the Elves`b`c`n`6You stand on the forest floor. %s rises about you, appearing to be one with the forest. Ancient, frail-looking buildings appear to grow from the forest floor, the tree limbs, and on the very treetops. The magnificent trees clutch delicately to these homes of elves. Bright motes of light swirl around you as you move about.`n", $city, $city); + $args['schemas']['text'] = "module-raceelf"; + $args['clock']="`n`6Capturing one of the tiny lights, you peer delicately into your hands.`nThe fairy within tells you that it is `^%s`6 before disappearing in a tiny sparkle.`n"; + $args['schemas']['clock'] = "module-raceelf"; + if (is_module_active("calendar")) { + $args['calendar']="`n`6Another fairy whispers in your ear, \"`^Today is `&%3\$s %2\$s`^, `&%4\$s`^. It is `&%1\$s`^.`6\"`n"; + $args['schemas']['calendar'] = "modules-raceelf"; + } + $args['title']= array("%s City", $city); + $args['schemas']['title'] = "module-raceelf"; + $args['sayline']="converses"; + $args['schemas']['sayline'] = "module-raceelf"; + $args['talk']="`n`^Nearby some villagers converse:`n"; + $args['schemas']['talk'] = "module-raceelf"; + $new = get_module_setting("newest-$city", "cities"); + if ($new != 0) { + $sql = "SELECT name FROM " . db_prefix("accounts") . + " WHERE acctid='$new'"; + $result = db_query_cached($sql, "newest-$city"); + $row = db_fetch_assoc($result); + $args['newestplayer'] = $row['name']; + $args['newestid']=$new; + } else { + $args['newestplayer'] = $new; + $args['newestid']=""; + } + if ($new == $session['user']['acctid']) { + $args['newest']="`n`6You stare around in wonder at the excessively tall buildings and feel just a bit queasy at the prospect of looking down from those heights."; + } else { + $args['newest']="`n`6Looking at the buildings high above, and looking a little queasy at the prospect of such heights is `^%s`6."; + } + $args['schemas']['newest'] = "module-raceelf"; + $args['gatenav']="Village Gates"; + $args['schemas']['gatenav'] = "module-raceelf"; + $args['fightnav']="Honor Avenue"; + $args['schemas']['fightnav'] = "module-raceelf"; + $args['marketnav']="Mercantile"; + $args['schemas']['marketnav'] = "module-raceelf"; + $args['tavernnav']="Towering Halls"; + $args['schemas']['tavernnav'] = "module-raceelf"; + $args['section']="village-$race"; + $args['schemas']['weaponshop'] = "module-raceelf"; + $args['weaponshop'] = "Gadriel's Weapons"; + } + break; + case "weaponstext": + $tradeinvalue = round(($session['user']['weaponvalue']*.75),0); + if ($session['user']['location'] == $city) { + $args['schemas']['title'] = "module-raceelf"; + $args['title']="Gadriel's Weapons"; + $args['schemas']['desc'] = "module-raceelf"; + $args['schemas']['tradein'] = "module-raceelf"; + if ($session['user']['race'] == $race) { + $args['desc'] = array( + "`7The Elven Ranger pads gracefully towards you as you enter, examining you from head to foot, an expression of piqued interest upon his fine elven features.", + "The tiny elf has magnificent blond hair reaching almost to his knees, and he spends a long moment memorizing your every facial feature.", + "His assessment finally concluded, a gleam settles in his eyes, and a small smile graces his expression.`n`n", + "`5\"You will be richly rewarded for respecting the acquired skill of your own blood,`7\" he says. `5\"Before you lie the greatest feats of workmanship known in all the lands, the grace and power that only the Elves can create. To wield an Elven weapon is an honor unsurpassed.`7\"", + array("`7You warm to his pride in your shared Elven blood, and proudly display your %s.`n`n",$session['user']['weapon']), + ); + $args['tradein'] = array( + array("`5Gadriel`7 looks at you and says, \"`5I'll give you `^%s`5 trade-in value for your `~%s`5.", $tradeinvalue, $session['user']['weapon']), + array("Tell me which instrument of battle you wish to own.\""), + ); + }else{ + $args['desc'] = array( + "`7The Elven Ranger pads gracefully towards you as you enter, examining you from head to foot, an expression of piqued interest upon his fine elven features.", + "The tiny elf has magnificent blond hair reaching almost to his knees, and he spends a long moment memorizing your every facial feature.", + "Gleaming eyes narrow as his assessment is concluded, and his face becomes a hardened mask which sets your teeth on edge. Despite his tiny stature, you feel intimidated, and he revels in your discomfort.`n`n", + "`7Speaking at last, his words are measured and calculated. `5\"You have shown surprising intelligence,`7\" he barks coldly, `5\"for having sought the finest workmanship in all the lands. No other being can hope to posess the grace and pure power of we Elves. No other weapons have one tenth the nobility and quality of what you see here. And no creature shall wield them as well as an Elf would, though you may try as you might.`7\"", + array("`7You attempt bravado in the face of such arrogance, and thrust forward your %s for inspection.`n`n",$session['user']['weapon']), + ); + $args['tradein'] = array( + array("`5Gadriel`7 takes your `5%s`7 and examines it again quitely. After some seconds he gives it back to you with a cold look in his eyes.", $session['user']['weapon']), + array("`5\"`^%s`5 gold is all I can give you for this.\"`7, he says.`n`n", $tradeinvalue), + ); + } + $args['schemas']['payweapon'] = "module-raceelf"; + $args['payweapon'] = "Gadriel takes your `5%s`7 and puts it on a rack behind him. Then, with a flourish, he pick up a new `5%s`7, deftly demonstrating its use, before handing it to you with gallantry and grace."; + } + break; + } + return $args; +} + +function raceelf_checkcity(){ + global $session; + $race="Elf"; + $city=get_module_setting("villagename"); + + if ($session['user']['race']==$race && is_module_active("cities")){ + //if they're this race and their home city isn't right, set it up. + if (get_module_pref("homecity","cities")!=$city){ //home city is wrong + set_module_pref("homecity",$city,"cities"); + } + } + return true; +} + +function raceelf_run(){ + +} +?> diff --git a/lotgd-web/lotgd/modules/racehuman.php b/lotgd-web/lotgd/modules/racehuman.php new file mode 100755 index 0000000..c938f63 --- /dev/null +++ b/lotgd-web/lotgd/modules/racehuman.php @@ -0,0 +1,285 @@ +"Race - Human", + "version"=>"1.0", + "author"=>"Eric Stevens", + "category"=>"Races", + "download"=>"core_module", + "settings"=>array( + "Human Race Settings,title", + "villagename"=>"Name for the human village|Romar", + "minedeathchance"=>"Chance for Humans to die in the mine,range,0,100,1|90", + "bonus"=>"How many extra forest fights for humans?,range,1,3,1|2", + ), + ); + return $info; +} + +function racehuman_install(){ + module_addhook("chooserace"); + module_addhook("setrace"); + module_addhook("newday"); + module_addhook("villagetext"); + module_addhook("stabletext"); + module_addhook("travel"); + module_addhook("validlocation"); + module_addhook("validforestloc"); + module_addhook("moderate"); + module_addhook("changesetting"); + module_addhook("raceminedeath"); + module_addhook("stablelocs"); + module_addhook("racenames"); + return true; +} + +function racehuman_uninstall(){ + global $session; + $vname = getsetting("villagename", LOCATION_FIELDS); + $gname = get_module_setting("villagename"); + $sql = "UPDATE " . db_prefix("accounts") . " SET location='$vname' WHERE location = '$gname'"; + db_query($sql); + if ($session['user']['location'] == $gname) + $session['user']['location'] = $vname; + // Force anyone who was a Human to rechoose race + $sql = "UPDATE " . db_prefix("accounts") . " SET race='" . RACE_UNKNOWN . "' WHERE race='Human'"; + db_query($sql); + if ($session['user']['race'] == 'Human') + $session['user']['race'] = RACE_UNKNOWN; + return true; +} + +function racehuman_dohook($hookname,$args){ + //yeah, the $resline thing is a hack. Sorry, not sure of a better way + // to handle this. + // Pass it as an arg? + global $session,$resline; + $city = get_module_setting("villagename"); + $race = "Human"; + switch($hookname){ + case "racenames": + $args[$race] = $race; + break; + case "raceminedeath": + if ($session['user']['race'] == $race) { + $args['chance'] = get_module_setting("minedeathchance"); + } + break; + case "changesetting": + // Ignore anything other than villagename setting changes + if ($args['setting'] == "villagename" && $args['module']=="racehuman") { + if ($session['user']['location'] == $args['old']) + $session['user']['location'] = $args['new']; + $sql = "UPDATE " . db_prefix("accounts") . + " SET location='" . addslashes($args['new']) . + "' WHERE location='" . addslashes($args['old']) . "'"; + db_query($sql); + if (is_module_active("cities")) { + $sql = "UPDATE " . db_prefix("module_userprefs") . + " SET value='" . addslashes($args['new']) . + "' WHERE modulename='cities' AND setting='homecity'" . + "AND value='" . addslashes($args['old']) . "'"; + db_query($sql); + } + } + break; + case "chooserace": + output("`0On the plains in the city of %s, the city of `&men`0; always following your father and looking up to his every move, until he sought out the `@Green Dragon`0, never to be seen again.`n`n", $city, true); + addnav("`&Human`0","newday.php?setrace=$race$resline"); + addnav("","newday.php?setrace=$race$resline"); + break; + case "setrace": + if ($session['user']['race']==$race){ + $bonus = get_module_setting("bonus"); + $one = translate_inline("an"); + $two = translate_inline("two"); + $three = translate_inline("three"); + $word = $bonus==1?$one:$bonus==2?$two:$three; + $fight = translate_inline("fight"); + $fights = translate_inline("fights"); + output("`&As a human, your size and strength permit you the ability to effortlessly wield weapons, tiring much less quickly than other races.`n`^You gain %s extra forest %s each day!", $word, $bonus==1?$fight:$fights); + if (is_module_active("cities")) { + if ($session['user']['dragonkills']==0 && + $session['user']['age']==0){ + //new farmthing, set them to wandering around this city. + set_module_setting("newest-$city", + $session['user']['acctid'],"cities"); + } + set_module_pref("homecity",$city,"cities"); + if ($session['user']['age'] == 0) + $session['user']['location']=$city; + } + } + break; + case "newday": + if ($session['user']['race']==$race){ + racehuman_checkcity(); + + $bonus = get_module_setting("bonus"); + $one = translate_inline("an"); + $two = translate_inline("two"); + $three = translate_inline("three"); + $word = $bonus==1?$one:$bonus==2?$two:$three; + $fight = translate_inline("fight"); + $fights = translate_inline("fights"); + + $args['turnstoday'] .= ", Race (human): $bonus"; + $session['user']['turns']+=$bonus; + $fight = translate_inline("fight"); + $fights = translate_inline("fights"); + output("`n`&Because you are human, you gain `^%s extra`& forest fights for today!`n`0", $word, $bonus==1?$fight:$fights); + } + break; + case "validforestloc": + case "validlocation": + if (is_module_active("cities")) + $args[$city]="village-$race"; + break; + case "moderate": + if (is_module_active("cities")) { + tlschema("commentary"); + $args["village-$race"]=sprintf_translate("City of %s", $city); + tlschema(); + } + break; + case "travel": + $capital = getsetting("villagename", LOCATION_FIELDS); + $hotkey = substr($city, 0, 1); + $ccity = urlencode($city); + tlschema("module-cities"); + if ($session['user']['location']==$capital){ + addnav("Safer Travel"); + addnav(array("%s?Go to %s", $hotkey, $city),"runmodule.php?module=cities&op=travel&city=$ccity"); + }elseif ($session['user']['location']!=$city){ + addnav("More Dangerous Travel"); + addnav(array("%s?Go to %s", $hotkey, $city),"runmodule.php?module=cities&op=travel&city=$ccity&d=1"); + } + if ($session['user']['superuser'] & SU_EDIT_USERS){ + addnav("Superuser"); + addnav(array("%s?Go to %s", $hotkey, $city),"runmodule.php?module=cities&op=travel&city=$ccity&su=1"); + } + tlschema(); + break; + case "villagetext": + racehuman_checkcity(); + if ($session['user']['location'] == $city){ + $args['text']=array("`&`c`b%s, City of Men`b`c`n`7You are standing in the heart of %s. Though called a city, this stronghold of humans is little more than a fortified village. The city's low defensive walls are surrounded by rolling plains which gradually turn into thick forest in the distance. Some residents are engaged in conversation around the well in the village square.`n", $city, $city); + $args['schemas']['text'] = "module-racehuman"; + $args['clock']="`n`7The great sundial at the heart of the city reads `&%s`7.`n"; + $args['schemas']['clock'] = "module-racehuman"; + if (is_module_active("calendar")) { + $args['calendar'] = "`n`7A smaller contraption next to it reads `&%s`7, `&%s %s %s`7.`n"; + $args['schemas']['calendar'] = "module-racehuman"; + } + $args['title']=array("%s, City of Men", $city); + $args['schemas']['title'] = "module-racehuman"; + $args['sayline']="says"; + $args['schemas']['sayline'] = "module-racehuman"; + $args['talk']="`n`&Nearby some villagers talk:`n"; + $args['schemas']['talk'] = "module-racehuman"; + $new = get_module_setting("newest-$city", "cities"); + if ($new != 0) { + $sql = "SELECT name FROM " . db_prefix("accounts") . + " WHERE acctid='$new'"; + $result = db_query_cached($sql, "newest-$city"); + $row = db_fetch_assoc($result); + $args['newestplayer'] = $row['name']; + $args['newestid']=$new; + } else { + $args['newestplayer'] = $new; + $args['newestid']=""; + } + if ($new == $session['user']['acctid']) { + $args['newest']="`n`7As you wander your new home, you feel your jaw dropping at the wonders around you."; + } else { + $args['newest']="`n`7Wandering the village, jaw agape, is `&%s`7."; + } + $args['schemas']['newest'] = "module-racehuman"; + $args['section']="village-$race"; + $args['stablename']="Bertold's Bestiary"; + $args['schemas']['stablename'] = "module-racehuman"; + $args['gatenav']="Village Gates"; + $args['schemas']['gatenav'] = "module-racehuman"; + unblocknav("stables.php"); + } + break; + case "stabletext": + if ($session['user']['location'] != $city) break; + $args['title'] = "Bertold's Bestiary"; + $args['schemas']['title'] = "module-racehuman"; + $args['desc'] = array( + "`6Just outside the outskirts of the village, a training area and riding range has been set up.", + "Many people from all across the land mingle as Bertold, a strapping man with a wind-weathered face, extols the virtues of each of the creatures in his care.", + array("As you approach, Bertold smiles broadly, \"`^Ahh! how can I help you today, my %s?`6\" he asks in a booming voice.", translate_inline($session['user']['sex']?'lass':'lad', 'stables')) + ); + $args['schemas']['desc'] = "module-racehuman"; + $args['lad']="friend"; + $args['schemas']['lad'] = "module-racehuman"; + $args['lass']="friend"; + $args['schemas']['lass'] = "module-racehuman"; + $args['nosuchbeast']="`6\"`^I'm sorry, I don't stock any such animal.`6\", Bertold say apologetically."; + $args['schemas']['nosuchbeast'] = "module-racehuman"; + $args['finebeast']=array( + "`6\"`^Yes, yes, that's one of my finest beasts!`6\" says Bertold.`n`n", + "`6\"`^Not even Merick has a finer specimen than this!`6\" Bertold boasts.`n`n", + "`6\"`^Doesn't this one have fine musculature?`6\" he asks.`n`n", + "`6\"`^You'll not find a better trained creature in all the land!`6\" exclaims Bertold.`n`n", + "`6\"`^And a bargain this one'd be at twice the price!`6\" booms Bertold.`n`n", + ); + $args['schemas']['finebeast'] = "module-racehuman"; + $args['toolittle']="`6Bertold looks over the gold and gems you offer and turns up his nose, \"`^Obviously you misheard my price. This %s will cost you `&%s `^gold and `%%s`^ gems and not a penny less.`6\""; + $args['schemas']['toolittle'] = "module-racehuman"; + $args['replacemount']="`6Patting %s`6 on the rump, you hand the reins as well as the money for your new creature, and Bertold hands you the reins of a `&%s`6."; + $args['schemas']['replacemount'] = "module-racehuman"; + $args['newmount']="`6You hand over the money for your new creature, and Bertold hands you the reins of a new `&%s`6."; + $args['schemas']['newmount'] = "module-racehuman"; + $args['nofeed']="`6\"`^I'm terribly sorry %s, but I don't stock feed here. I'm not a common stable after all! Perhaps you should look elsewhere to feed your creature.`6\""; + $args['schemas']['nofeed'] = "module-racehuman"; + $args['nothungry']="`&%s`6 picks briefly at the food and then ignores it. Bertold, being honest, shakes his head and hands you back your gold."; + $args['schemas']['nothungry'] = "module-racehuman"; + $args['halfhungry']="`&%s`6 dives into the provided food and gets through about half of it before stopping. \"`^Well, %s wasn't as hungry as you thought.`6\" says Bertold as he hands you back all but %s gold."; + $args['schemas']['halfhungry'] = "module-racehuman"; + $args['hungry']="`6%s`6 seems to inhale the food provided. %s`6, the greedy creature that it is, then goes snuffling at Bertold's pockets for more food.`nBertold shakes his head in amusement and collects `&%s`6 gold from you."; + $args['schemas']['hungry'] = "module-racehuman"; + $args['mountfull']="`n`6\"`^Well, %s, your %s`^ is full up now. Come back tomorrow if it hungers again, and I'll be happy to sell you more.`6\" says Bertold with a genial smile."; + $args['schemas']['mountfull'] = "module-racehuman"; + $args['nofeedgold']="`6\"`^I'm sorry, but that is just not enough money to pay for food here.`6\" Bertold turns his back on you, and you lead %s away to find other places for feeding."; + $args['schemas']['nofeedgold'] = "module-racehuman"; + $args['confirmsale']="`n`n`6Bertold eyes your mount up and down, checking it over carefully. \"`^Are you quite sure you wish to part with this creature?`6\""; + $args['schemas']['confirmsale'] = "module-racehuman"; + $args['mountsold']="`6With but a single tear, you hand over the reins to your %s`6 to Bertold's stableboy. The tear dries quickly, and the %s in hand helps you quickly overcome your sorrow."; + $args['schemas']['mountsold'] = "module-racehuman"; + $args['offer']="`n`n`6Bertold strokes your creature's flank and offers you `&%s`6 gold and `%%s`6 gems for %s`6."; + $args['schemas']['offer'] = "module-racehuman"; + break; + case "stablelocs": + tlschema("mounts"); + $args[$city]=sprintf_translate("The Village of %s", $city); + tlschema(); + break; + } + return $args; +} + +function racehuman_checkcity(){ + global $session; + $race="Human"; + $city=get_module_setting("villagename"); + + if ($session['user']['race']==$race && is_module_active("cities")){ + //if they're this race and their home city isn't right, set it up. + if (get_module_pref("homecity","cities")!=$city){ //home city is wrong + set_module_pref("homecity",$city,"cities"); + } + } + return true; +} + +function racehuman_run(){ + +} +?> diff --git a/lotgd-web/lotgd/modules/racetroll.php b/lotgd-web/lotgd/modules/racetroll.php new file mode 100755 index 0000000..60f2a8b --- /dev/null +++ b/lotgd-web/lotgd/modules/racetroll.php @@ -0,0 +1,235 @@ +"Race - Troll", + "version"=>"1.0", + "author"=>"Eric Stevens", + "category"=>"Races", + "download"=>"core_module", + "settings"=>array( + "Trollish Race Settings,title", + "villagename"=>"Name for the troll village|Glukmoore", + "minedeathchance"=>"Chance for Trolls to die in the mine,range,0,100,1|90", + ), + ); + return $info; +} + +function racetroll_install(){ + module_addhook("chooserace"); + module_addhook("setrace"); + module_addhook("newday"); + module_addhook("villagetext"); + module_addhook("travel"); + module_addhook("validlocation"); + module_addhook("validforestloc"); + module_addhook("moderate"); + module_addhook("changesetting"); + module_addhook("raceminedeath"); + module_addhook("pvpadjust"); + module_addhook("adjuststats"); + module_addhook("racenames"); + return true; +} + +function racetroll_uninstall(){ + global $session; + $vname = getsetting("villagename", LOCATION_FIELDS); + $gname = get_module_setting("villagename"); + $sql = "UPDATE " . db_prefix("accounts") . " SET location='$vname' WHERE location = '$gname'"; + db_query($sql); + if ($session['user']['location'] == $gname) + $session['user']['location'] = $vname; + // Force anyone who was a Troll to rechoose race + $sql = "UPDATE " . db_prefix("accounts") . " SET race='" . RACE_UNKNOWN . "' WHERE race='Troll'"; + db_query($sql); + if ($session['user']['race'] == 'Troll') + $session['user']['race'] = RACE_UNKNOWN; + + return true; +} + +function racetroll_dohook($hookname,$args){ + //yeah, the $resline thing is a hack. Sorry, not sure of a better way + // to handle this. + // Pass it in via args? + global $session,$resline; + $city = get_module_setting("villagename"); + $race = "Troll"; + switch($hookname){ + case "racenames": + $args[$race] = $race; + break; + case "pvpadjust": + if ($args['race'] == $race) { + $args['creatureattack']+=(1+floor($args['creaturelevel']/5)); + } + break; + case "adjuststats": + if ($args['race'] == $race) { + $args['attack']+=(1+floor($args['level']/5)); + } + break; + case "raceminedeath": + if ($session['user']['race'] == $race) { + $args['chance'] = get_module_setting("minedeathchance"); + } + break; + case "changesetting": + // Ignore anything other than villagename setting changes + if ($args['setting'] == "villagename" && $args['module']=="racetroll") { + if ($session['user']['location'] == $args['old']) + $session['user']['location'] = $args['new']; + $sql = "UPDATE " . db_prefix("accounts") . + " SET location='" . addslashes($args['new']) . + "' WHERE location='" . addslashes($args['old']) . "'"; + db_query($sql); + if (is_module_active("cities")) { + $sql = "UPDATE " . db_prefix("module_userprefs") . + " SET value='" . addslashes($args['new']) . + "' WHERE modulename='cities' AND setting='homecity'" . + "AND value='" . addslashes($args['old']) . "'"; + db_query($sql); + } + } + break; + case "chooserace": + output("In the swamps of %s`2 as a `@Troll`2, fending for yourself from the very moment you crept out of your leathery egg, slaying your yet unhatched siblings, and feasting on their bones.`n`n",$city, true); + addnav("`@Troll`0","newday.php?setrace=$race$resline"); + addnav("","newday.php?setrace=$race$resline"); + break; + case "setrace": + if ($session['user']['race']==$race){ + output("`@As a troll, and having always fended for yourself, the ways of battle are not foreign to you.`n"); + output("`^You gain extra attack!"); + if (is_module_active("cities")) { + if ($session['user']['dragonkills']==0 && + $session['user']['age']==0){ + //new farmthing, set them to wandering around this city. + set_module_setting("newest-$city", + $session['user']['acctid'],"cities"); + } + set_module_pref("homecity",$city,"cities"); + if ($session['user']['age'] == 0) + $session['user']['location']=$city; + } + } + break; + case "validforestloc": + case "validlocation": + if (is_module_active("cities")) + $args[$city] = "village-$race"; + break; + case "moderate": + if (is_module_active("cities")) { + tlschema("commentary"); + $args["village-$race"]=sprintf_translate("City of %s", $city); + tlschema(); + } + break; + case "newday": + if ($session['user']['race']==$race){ + racetroll_checkcity(); + apply_buff("racialbenefit",array( + "name"=>"`@Trollish Strength`0", + "atkmod"=>"(?(1+((1+floor(/5))/)):0)", + "allowinpvp"=>1, + "allowintrain"=>1, + "rounds"=>-1, + "schema"=>"module-racetroll", + ) + ); + } + break; + case "travel": + $capital = getsetting("villagename", LOCATION_FIELDS); + $hotkey = substr($city, 0, 1); + $ccity = urlencode($city); + tlschema("module-cities"); + if ($session['user']['location']==$capital){ + addnav("Safer Travel"); + addnav(array("%s?Go to %s", $hotkey, $city),"runmodule.php?module=cities&op=travel&city=$ccity"); + }elseif ($session['user']['location']!=$city){ + addnav("More Dangerous Travel"); + addnav(array("%s?Go to %s", $hotkey, $city),"runmodule.php?module=cities&op=travel&city=$ccity&d=1"); + } + if ($session['user']['superuser'] & SU_EDIT_USERS){ + addnav("Superuser"); + addnav(array("%s?Go to %s", $hotkey, $city),"runmodule.php?module=cities&op=travel&city=$ccity&su=1"); + } + tlschema(); + break; + case "villagetext": + racetroll_checkcity(); + if ($session['user']['location'] == $city){ + $args['text']=array("`@`b`c%s, Home of the Trolls`c`b`n`2You are standing in a pile of mud, in the heart of a vast swamp. Around you are the fetid skin-covered hovels that trolls call home. Well actually, they call them 'ughrrnk', but that's a bit hard on the throats of non-trolls. Nearby some local peasants squabble over the rapidly decaying remains of the morning's hunt. Perched atop one of the huts, a badly scarred troll smears indescribable filth over his home's surface in an ill fated attempt to water proof it.`n", $city); + $args['schemas']['text'] = "module-racetroll"; + $args['clock']="`n`2Based on what's left of the morning's kill, you can tell that it is `@%s`2.`n"; + $args['schemas']['clock'] = "module-racetroll"; + if (is_module_active("calendar")) { + $args['calendar'] = "`n`2Bellows and noises around you let you know that it is `@%1\$s`2, `@%3\$s %2\$s`2, `@%4\$s`2.`n"; + $args['schemas']['calendar'] = "module-racetroll"; + } + $args['title']=array("The Swamps of %s", $city); + $args['schemas']['title'] = "module-racetroll"; + $args['sayline']="squabbles"; + $args['schemas']['sayline'] = "module-racetroll"; + $args['talk']="`n`@Nearby some villagers squabble:`n"; + $args['schemas']['talk'] = "module-racetroll"; + $new = get_module_setting("newest-$city", "cities"); + if ($new != 0) { + $sql = "SELECT name FROM " . db_prefix("accounts") . + " WHERE acctid='$new'"; + $result = db_query_cached($sql, "newest-$city"); + $row = db_fetch_assoc($result); + $args['newestplayer'] = $row['name']; + $args['newestid']=$new; + } else { + $args['newestplayer'] = $new; + $args['newestid']=""; + } + if ($new == $session['user']['acctid']) { + $args['newest']="`n`2You wander the village, picking your teeth with the tiny rib of one of your siblings. Flicking off a bit of shell that was still stuck to your skin, you watch as it skips several times across the muddy surface of the swamp before a small lizard jumps on it and begins to consume its nutrients."; + } else { + $args['newest']="`n`2Picking their teeth with a sliver of bone is `@%s`2, still covered with bits of shell from the hatchery."; + } + $args['schemas']['newest'] = "module-racetroll"; + $args['gatenav']="Village Gates"; + $args['schemas']['gatenav'] = "module-racetroll"; + $args['fightnav']="Barshem Gud"; + $args['schemas']['fightnav'] = "module-racetroll"; + $args['marketnav']="Da Gud Stuff"; + $args['schemas']['marketnav'] = "module-racetroll"; + $args['tavernnav']="Eatz n' Such"; + $args['schemas']['tavernnav'] = "module-racetroll"; + $args['infonav']="Da Infoz"; + $args['schemas']['infonav'] = "module-racetroll"; + $args['section']="village-$race"; + } + break; + } + return $args; +} + +function racetroll_checkcity(){ + global $session; + $race="Troll"; + $city=get_module_setting("villagename"); + + if ($session['user']['race']==$race && is_module_active("cities")){ + //if they're this race and their home city isn't right, set it up. + if (get_module_pref("homecity","cities")!=$city){ //home city is wrong + set_module_pref("homecity",$city,"cities"); + } + } + return true; +} + +function racetroll_run(){ + +} +?> diff --git a/lotgd-web/lotgd/modules/sethsong.php b/lotgd-web/lotgd/modules/sethsong.php new file mode 100755 index 0000000..3c42519 --- /dev/null +++ b/lotgd-web/lotgd/modules/sethsong.php @@ -0,0 +1,316 @@ +"Seth the Bard's Songs", + "version"=>"1.1", + "author"=>"Eric Stevens", + "category"=>"Inn", + "download"=>"core_module", + "settings"=>array( + "Seth the Bard's Songs,title", + "bhploss"=>"Percent of hitpoints that can be lost when Seth burps,range,2,100,2|10", + "shploss"=>"Percent of hitpoints that can be lost when a string breaks,range,2,100,2|20", + "hpgain"=>"Percent of max hitpoints that can be gained,range,2,100,2|20", + //I realize adding 100% of max hitpoints or killing them when they go to Seth is a little outrageous, but might as well give admins the option + "maxgems"=>"Most gems that can be found,int|1", + "mingems"=>"Fewest gems that can be found,int|1", + "Set these equal to each other for a fixed amount,note", + "mingold"=>"Minimum amount gold you can find,int|10", + "maxgold"=>"Maximum amount gold you can find,int|50", + "goldloss"=>"Amount of gold that can be lost,int|5", + "Warning: If a player's gold is less than this amount they loose nothin!,note", + "visits"=>"How many times per day can a player listen to Seth,int|1", + ), + "prefs"=>array( + "Seth the Bard's Songs,title", + "been"=>"How many times have they listened Seth today,int|0", + ), + ); + return $info; +} + +function sethsong_install(){ + // Convert the seenbard field. + $sql = "DESCRIBE " . db_prefix("accounts"); + $result = db_query($sql); + while ($row = db_fetch_assoc($result)){ + if ($row['Field']=="seenbard"){ + $sql = "SELECT seenbard,acctid FROM " . db_prefix("accounts") . " WHERE seenbard>0"; + $result1 = db_query($sql); + debug("Migrating seenbard.`n"); + while ($row1 = db_fetch_assoc($result1)){ + $sql = "INSERT INTO " . db_prefix("module_userprefs") . " (modulename,setting,userid,value) VALUES ('seth','been',{$row1['acctid']},{$row1['seenbard']})"; + db_query($sql); + }//end while + debug("Dropping seenbard column from the user table.`n"); + $sql = "ALTER TABLE " . db_prefix("accounts") . " DROP seenbard"; + db_query($sql); + //drop it from the user's session too. + unset($session['user']['seenbard']); + }//end if + }//end while + + module_addhook("inn"); + module_addhook("newday"); + return true; +} + +function sethsong_uninstall(){ + return true; +} + +function sethsong_dohook($hookname,$args){ + switch($hookname){ + case "inn": + $op = httpget("op"); + if ($op == "" || $op == "strolldown" || $op == "fleedragon") { + addnav("Things to do"); + addnav(array("L?Listen to %s`0 the Bard", getsetting("bard", "`^Seth")),"runmodule.php?module=sethsong"); + } + break; + case "newday": + set_module_pref("been",0); + break; + } + return $args; +} + +function sethsong_run(){ + $op=httpget('op'); + $visits=get_module_setting("visits"); + $been=get_module_pref("been"); + $iname = getsetting("innname", LOCATION_INN); + tlschema("inn"); + page_header($iname); + + rawoutput(""); + output_notl("`c`b"); + output($iname); + output_notl("`b`c"); + tlschema(); + + // Short circuit out if we've heard enough + if ($been >= $visits) { + output("%s`0 clears his throat and drinks some water.", getsetting("bard", "`^Seth")); + output("\"I'm sorry, my throat is just too dry.\""); + } else { + sethsong_sing(); + } + + addnav("Where to?"); + addnav("I?Return to the Inn","inn.php"); + villagenav(); + rawoutput(""); + page_footer(); +} + +function sethsong_sing() +{ + global $session; + $mostgold=get_module_setting("maxgold"); + $leastgold=get_module_setting("mingold"); + $lgain=get_module_setting("hpgain"); + $bloss=get_module_setting("bhploss"); + $sloss=get_module_setting("shploss"); + $gold=get_module_setting("goldloss"); + $mostgems=get_module_setting("maxgems"); + $leastgems=get_module_setting("mingems"); + $visits=get_module_setting("visits"); + $been=get_module_pref("been"); + + $been++; + set_module_pref("been",$been); + $rnd = e_rand(0,18); + output("%s`0 clears his throat and begins:`n`n`^", getsetting("bard", "`^Seth")); + switch ($rnd){ + case 0: + output("`@Green Dragon`^ is green,`n`@Green Dragon`^ is fierce.`n"); + output("I fancy for a`n`@Green Dragon`^ to pierce.`n`n"); + output("`0You gain TWO forest fights for today!"); + $session['user']['turns'] += 2; + break; + case 1: + // Since masters are now editable, pick a random one. + $sql = "SELECT creaturename FROM " . db_prefix("masters") . " ORDER BY RAND(".e_rand().") LIMIT 1"; + $res = db_query($sql); + if (db_num_rows($res)) { + $row = db_fetch_assoc($res); + $name = $row['creaturename']; + } else { + $name = "MightyE"; + } + output("%s, I scoff at thee and tickleth your toes.`n", $name); + output("For they smell most foul and seethe a stench far greater than you know!`n`n"); + output("`0You feel jovial, and gain an extra forest fight."); + $session['user']['turns']++; + break; + case 2: + output("Membrane Man, Membrane Man.`n"); + output("Membrane man hates %s`^ man.`n", $session['user']['name']); + output("They have a fight, Membrane wins.`n"); + output("Membrane Man.`n`n"); + output("`0You're not quite sure what to make of this."); + output("You merely back away, and think you'll visit %s`0 when he's feeling better.", getsetting("bard", "`^Seth")); + output("Having rested a while though, you think you could face another forest creature."); + $session['user']['turns']++; + break; + case 3: + output("Gather 'round and I'll tell you a tale`nmost terrible and dark`nof %s`^ and his unclean beer`nand how he hates this bard!`n`n", getsetting('barkeep', '`tCedrik')); + output("`0You realize he's right, %s`0's beer really is nasty.", getsetting('barkeep', '`tCedrik')); + output("That's why most patrons prefer his ale."); + output("Though you don't really gain anything from the tale from %s`0, you do happen to notice a few gold on the ground!", getsetting("bard", "`^Seth")); + $gain = e_rand($leastgold,$mostgold); + $session['user']['gold']+=$gain; + debuglog("found $gain gold near Seth"); + break; + case 4: + output("So a pirate goes into a bar with a steering wheel in his pants.`n"); + output("The bartender says, \"You know you have a steering wheel in your pants?\"`n"); + output("The pirate replies, \"Yaaarr, 'tis drivin' me nuts!\"`n`n"); + output("`0With a good hearty chuckle in your soul, you advance on the world, ready for anything!"); + $session['user']['hitpoints']=round(max($session['user']['maxhitpoints'],$session['user']['hitpoints'])*(($lgain/100)+1),0); + break; + case 5: + output("Listen close and hear me well: every second we draw even closer to death. *wink*`n`n"); + output("`0Depressed, you head for home... and lose a forest fight!"); + $session['user']['turns']--; + if ($session['user']['turns']<0) + $session['user']['turns']=0; + break; + case 6: + output("I love MightyE, MightyE weaponry, I love MightyE, MightyE weaponry, I love MightyE, MightyE weaponry, nothing kills as good as MightyE... WEAPONRY!`n`n"); + output("`0You think %s`0 is quite correct.`n", getsetting("bard", "`^Seth")); + output("You want to go out and kill something."); + output("You leave and think about bees and fish for some reason."); + $session['user']['turns']++; + break; + case 7: + output("%s`0 seems to sit up and prepare himself for something impressive.",getsetting("bard","`^Seth")); + output("He then burps loudly in your face."); + output("\"`^Was that entertaining enough?`0\"`n`n"); + output("`0The smell is overwhelming."); + output("You feel a little ill and lose some hitpoints."); + $session['user']['hitpoints']-=round($session['user']['maxhitpoints'] * ($bloss/100),0); + if ($session['user']['hitpoints']<=0) + $session['user']['hitpoints']=1; + break; + case 8: + output("`0\"`^What is the sound of one hand clapping?`0\" asks %s`0.", getsetting("bard", "`^Seth")); + if ($session['user']['gold'] >=$gold ) { + output("While you ponder this conundrum, %s`0 \"liberates\" a small entertainment fee from your purse.`n`n", getsetting("bard", "`^Seth")); + output("You lose %s gold!",$gold); + $session['user']['gold']-=$gold; + debuglog("lost $gold gold to Seth"); + } else { + output("While you ponder this conundrum, %s`0 attempts to \"liberate\" a small entertainment fee from your purse, but doesn't find enough to bother with.", getsetting("bard", "`^Seth")); + } + break; + case 9: + $gems=e_rand($leastgems,$mostgems); + output("What do you call a fish with no eyes?`n`n"); + output("A fsshh.`n`n"); + output("`0You groan as %s`0 laughs heartily.", getsetting("bard", "`^Seth")); + if($gems==0){ + output("Shaking your head, you turn to go back to the inn."); + } + if($gems==1){ + output("Shaking your head, you notice a gem in the dust."); + $session['user']['gems']++; + }else{ + output("Shaking your head, you notice %s gems in the dust.",$gems); + $session['user']['gems']+=$gems; + } + debuglog("got $gems gem\\(s\\) from Seth"); + break; + case 10: + output("%s`0 plays a soft but haunting melody.`n`n", getsetting("bard", "`^Seth")); + output("You feel relaxed, and your wounds seem to fade away."); + if ($session['user']['hitpoints'] < $session['user']['maxhitpoints']) + $session['user']['hitpoints'] = $session['user']['maxhitpoints']; + break; + case 11: + output("%s`0 plays a melancholy dirge for you.`n`n", getsetting("bard", "`^Seth")); + output("You feel lower in spirits, you may not be able to face as many villains today."); + $session['user']['turns']--; + if ($session['user']['turns']<0) + $session['user']['turns']=0; + break; + case 12: + output("The ants go marching one by one, hoorah, hoorah.`n"); + output("The ants go marching one by one, hoorah, hoorah!`n"); + output("The ants go marching one by one and the littlest one stops to suck his thumb, and they all go marching down, to the ground, to get out of the rain...`n"); + output("bum bum bum`n"); + output("The ants go marching two by two, hoorah, hoorah!....`n`n"); + output("%s`0 continues to sing, but not wishing to learn how high he can count, you quietly leave.`n`n", getsetting("bard", "`^Seth")); + output("Having rested a while, you feel refreshed."); + if($session['user']['hitpoints'] < $session['user']['maxhitpoints']) + $session['user']['hitpoints'] = $session['user']['maxhitpoints']; + break; + case 13: + output("There once was a lady from Venus, her body was shaped like a ...`n`n"); + if ($session['user']['sex']==SEX_FEMALE){ + output("%s`0 is cut short by a curt slap across his face!", getsetting("bard", "`^Seth")); + output("Feeling rowdy, you gain a forest fight."); + }else{ + output("%s`0 is cut short as you burst out in laughter, not even having to hear the end of the rhyme.", getsetting("bard", "`^Seth")); + output("Feeling inspired, you gain a forest fight."); + } + $session['user']['turns']++; + break; + case 14: + output("%s`0 plays a rousing call-to-battle that wakes the warrior spirit inside of you.`n`n", getsetting("bard", "`^Seth")); + output("`0You gain a forest fight!"); + $session['user']['turns']++; + break; + case 15: + output("%s`0 seems preoccupied with your... eyes.`n`n", getsetting("bard", "`^Seth")); + if ($session['user']['sex']==SEX_FEMALE){ + output("`0You receive one charm point!"); + $session['user']['charm']++; + }else{ + output("`0Furious, you stomp out of the bar!"); + output("You gain a forest fight in your fury."); + $session['user']['turns']++; + } + break; + case 16: + output("%s`0 begins to play, but a lute string snaps, striking you square in the eye.`n`n", getsetting("bard", "`^Seth")); + output("`0\"`^Whoops, careful, you'll shoot your eye out kid!`0\"`n`n"); + output("You lose some hitpoints!"); + $session['user']['hitpoints']-=round($session['user']['maxhitpoints']*($sloss/100),0); + if ($session['user']['hitpoints']<1) + $session['user']['hitpoints']=1; + break; + case 17: + output("%s`0 begins to play, but a rowdy patron stumbles past, spilling beer on you.", getsetting("bard", "`^Seth")); + output("You miss the performance as you wipe the swill from your %s.", $session['user']['armor']); + break; + case 18: + output("%s`0 stares at you thoughtfully, obviously rapidly composing an epic poem...`n`n", getsetting("bard", "`^Seth")); + output("`^U-G-L-Y, You ain't got no alibi -- you ugly, yeah yeah, you ugly!`n`n"); + $session['user']['charm']--; + if ($session['user']['charm']<0){ + output("`0If you had any charm, you'd have been offended, instead, %s`0 breaks a lute string.", getsetting("bard", "`^Seth")); + }else{ + output("`n`n`0Depressed, you lose a charm point."); + } + break; + } +} +?> diff --git a/lotgd-web/lotgd/modules/specialtydarkarts.php b/lotgd-web/lotgd/modules/specialtydarkarts.php new file mode 100755 index 0000000..908b20a --- /dev/null +++ b/lotgd-web/lotgd/modules/specialtydarkarts.php @@ -0,0 +1,252 @@ + "Specialty - Dark Arts", + "author" => "Eric Stevens", + "version" => "1.1", + "download" => "core_module", + "category" => "Specialties", + "prefs" => array( + "Specialty - Dark Arts User Prefs,title", + "skill"=>"Skill points in Dark Arts,int|0", + "uses"=>"Uses of Dark Arts allowed,int|0", + ), + ); + return $info; +} + +function specialtydarkarts_install(){ + $sql = "DESCRIBE " . db_prefix("accounts"); + $result = db_query($sql); + $specialty="DA"; + while($row = db_fetch_assoc($result)) { + // Convert the user over + if ($row['Field'] == "darkarts") { + debug("Migrating darkarts field"); + $sql = "INSERT INTO " . db_prefix("module_userprefs") . " (modulename,setting,userid,value) SELECT 'specialtydarkarts', 'skill', acctid, darkarts FROM " . db_prefix("accounts"); + db_query($sql); + debug("Dropping darkarts field from accounts table"); + $sql = "ALTER TABLE " . db_prefix("accounts") . " DROP darkarts"; + db_query($sql); + } elseif ($row['Field']=="darkartuses") { + debug("Migrating darkarts uses field"); + $sql = "INSERT INTO " . db_prefix("module_userprefs") . " (modulename,setting,userid,value) SELECT 'specialtydarkarts', 'uses', acctid, darkartuses FROM " . db_prefix("accounts"); + db_query($sql); + debug("Dropping darkartuses field from accounts table"); + $sql = "ALTER TABLE " . db_prefix("accounts") . " DROP darkartuses"; + db_query($sql); + } + } + debug("Migrating Darkarts Specialty"); + $sql = "UPDATE " . db_prefix("accounts") . " SET specialty='$specialty' WHERE specialty='1'"; + db_query($sql); + + module_addhook("choose-specialty"); + module_addhook("set-specialty"); + module_addhook("fightnav-specialties"); + module_addhook("apply-specialties"); + module_addhook("newday"); + module_addhook("incrementspecialty"); + module_addhook("specialtynames"); + module_addhook("specialtymodules"); + module_addhook("specialtycolor"); + module_addhook("dragonkill"); + return true; +} + +function specialtydarkarts_uninstall(){ + // Reset the specialty of anyone who had this specialty so they get to + // rechoose at new day + $sql = "UPDATE " . db_prefix("accounts") . " SET specialty='' WHERE specialty='DA'"; + db_query($sql); + return true; +} + +function specialtydarkarts_dohook($hookname,$args){ + global $session,$resline; + + $spec = "DA"; + $name = "Dark Arts"; + $ccode = "`$"; + + switch ($hookname) { + case "dragonkill": + set_module_pref("uses", 0); + set_module_pref("skill", 0); + break; + case "choose-specialty": + if ($session['user']['specialty'] == "" || + $session['user']['specialty'] == '0') { + addnav("$ccode$name`0","newday.php?setspecialty=$spec$resline"); + $t1 = translate_inline("Killing a lot of woodland creatures"); + $t2 = appoencode(translate_inline("$ccode$name`0")); + rawoutput("$t1 ($t2)
"); + addnav("","newday.php?setspecialty=$spec$resline"); + } + break; + case "set-specialty": + if($session['user']['specialty'] == $spec) { + page_header($name); + output("`5Growing up, you recall killing many small woodland creatures, insisting that they were plotting against you."); + output("Your parents, concerned that you had taken to killing the creatures barehanded, bought you your very first pointy twig."); + output("It wasn't until your teenage years that you began performing dark rituals with the creatures, disappearing into the forest for days on end, no one quite knowing where those sounds came from."); + } + break; + case "specialtycolor": + $args[$spec] = $ccode; + break; + case "specialtynames": + $args[$spec] = translate_inline($name); + break; + case "specialtymodules": + $args[$spec] = "specialtydarkarts"; + break; + case "incrementspecialty": + if($session['user']['specialty'] == $spec) { + $new = get_module_pref("skill") + 1; + set_module_pref("skill", $new); + $c = $args['color']; + $name = translate_inline($name); + output("`n%sYou gain a level in `&%s%s to `#%s%s!", + $c, $name, $c, $new, $c); + $x = $new % 3; + if ($x == 0){ + output("`n`^You gain an extra use point!`n"); + set_module_pref("uses", get_module_pref("uses") + 1); + }else{ + if (3-$x == 1) { + output("`n`^Only 1 more skill level until you gain an extra use point!`n"); + } else { + output("`n`^Only %s more skill levels until you gain an extra use point!`n", (3-$x)); + } + } + output_notl("`0"); + } + break; + case "newday": + $bonus = getsetting("specialtybonus", 1); + if($session['user']['specialty'] == $spec) { + $name = translate_inline($name); + if ($bonus == 1) { + output("`n`2For being interested in %s%s`2, you receive `^1`2 extra `&%s%s`2 use for today.`n",$ccode, $name, $ccode, $name); + } else { + output("`n`2For being interested in %s%s`2, you receive `^%s`2 extra `&%s%s`2 uses for today.`n",$ccode, $name,$bonus, $ccode,$name); + } + } + $amt = (int)(get_module_pref("skill") / 3); + if ($session['user']['specialty'] == $spec) $amt = $amt + $bonus; + set_module_pref("uses", $amt); + break; + case "fightnav-specialties": + $uses = get_module_pref("uses"); + $script = $args['script']; + if ($uses > 0) { + addnav(array("$ccode$name (%s points)`0", $uses),""); + addnav(array("$ccode • Skeleton Crew`7 (%s)`0", 1), + $script."op=fight&skill=$spec&l=1", true); + } + if ($uses > 1) { + addnav(array("$ccode • Voodoo`7 (%s)`0", 2), + $script."op=fight&skill=$spec&l=2",true); + } + if ($uses > 2) { + addnav(array("$ccode • Curse Spirit`7 (%s)`0", 3), + $script."op=fight&skill=$spec&l=3",true); + } + if ($uses > 4) { + addnav(array("$ccode • Wither Soul`7 (%s)`0", 5), + $script."op=fight&skill=$spec&l=5",true); + } + break; + case "apply-specialties": + $skill = httpget('skill'); + $l = httpget('l'); + if ($skill==$spec){ + if (get_module_pref("uses") >= $l){ + switch($l){ + case 1: + if (getsetting("enablecompanions", true)) { + apply_companion('skeleton_warrior', array( + "name"=>"`4Skeleton Warrior", + "hitpoints"=>round($session['user']['level']*3.33,0)+10, + "maxhitpoints"=>round($session['user']['level']*3.33,0)+10, + "attack"=>round((($session['user']['level']/4)+2))*round((($session['user']['level']/3)+2))+1.5, + "defense"=>floor((($session['user']['level']/3)+0))*ceil(($session['user']['level']/6)+2)+2.5, + "dyingtext"=>"`\$Your skeleton warrior crumbles to dust.`n", + "abilities"=>array( + "fight"=>true, + ), + "ignorelimit"=>true, // Does not count towards companion limit... + ), true); + // Because of this last "true" the companion can be added any time. + // Even, if the player controls already more companions than normally allowed! + } else { + apply_buff('da1',array( + "startmsg"=>"`\$You call on the spirits of the dead, and skeletal hands claw at {badguy} from beyond the grave.", + "name"=>"`\$Skeleton Crew", + "rounds"=>5, + "wearoff"=>"Your skeleton minions crumble to dust.", + "minioncount"=>round($session['user']['level']/3)+1, + "maxbadguydamage"=>round($session['user']['level']/2,0)+1, + "effectmsg"=>"`)An undead minion hits {badguy}`) for `^{damage}`) damage.", + "effectnodmgmsg"=>"`)An undead minion tries to hit {badguy}`) but `\$MISSES`)!", + "schema"=>"module-specialtydarkarts" + )); + } + break; + case 2: + apply_buff('da2',array( + "startmsg"=>"`\$You pull out a tiny doll that looks like {badguy}.", + "effectmsg"=>"You thrust a pin into the {badguy} doll hurting it for `^{damage}`) points!", + "rounds"=>1, + "minioncount"=>1, + "maxbadguydamage"=>round($session['user']['attack']*3,0), + "minbadguydamage"=>round($session['user']['attack']*1.5,0), + "schema"=>"module-specialtydarkarts" + )); + break; + case 3: + apply_buff('da3',array( + "startmsg"=>"`\$You place a curse on {badguy}'s ancestors.", + "name"=>"`\$Curse Spirit", + "rounds"=>5, + "wearoff"=>"Your curse has faded.", + "badguydmgmod"=>0.5, + "roundmsg"=>"{badguy} staggers under the weight of your curse, and deals only half damage.", + "schema"=>"module-specialtydarkarts" + )); + break; + case 5: + apply_buff('da5',array( + "startmsg"=>"`\$You hold out your hand and {badguy} begins to bleed from its ears.", + "name"=>"`\$Wither Soul", + "rounds"=>5, + "wearoff"=>"Your victim's soul has been restored.", + "badguyatkmod"=>0, + "badguydefmod"=>0, + "roundmsg"=>"{badguy} claws at its eyes, trying to release its own soul, and cannot attack or defend.", + "schema"=>"module-specialtydarkarts" + )); + break; + } + set_module_pref("uses", get_module_pref("uses") - $l); + }else{ + apply_buff('da0', array( + "startmsg"=>"Exhausted, you try your darkest magic, a bad joke. {badguy} looks at you for a minute, thinking, and finally gets the joke. Laughing, it swings at you again.", + "rounds"=>1, + "schema"=>"module-specialtydarkarts" + )); + } + } + break; + } + return $args; +} + +function specialtydarkarts_run(){ +} +?> diff --git a/lotgd-web/lotgd/modules/specialtymysticpower.php b/lotgd-web/lotgd/modules/specialtymysticpower.php new file mode 100755 index 0000000..2e41b2a --- /dev/null +++ b/lotgd-web/lotgd/modules/specialtymysticpower.php @@ -0,0 +1,244 @@ + "Specialty - Mystical Powers", + "author" => "Eric Stevens", + "version" => "1.0", + "download" => "core_module", + "category" => "Specialties", + "prefs" => array( + "Specialty - Mystical Powers User Prefs,title", + "skill"=>"Skill points in Mystical Powers,int|0", + "uses"=>"Uses of Mystical Powers allowed,int|0", + ), + ); + return $info; +} + +function specialtymysticpower_install(){ + $sql = "DESCRIBE " . db_prefix("accounts"); + $result = db_query($sql); + $specialty="MP"; + while($row = db_fetch_assoc($result)) { + // Convert the user over + if ($row['Field'] == "magic") { + debug("Migrating mystic powers field"); + $sql = "INSERT INTO " . db_prefix("module_userprefs") . " (modulename,setting,userid,value) SELECT 'specialtymysticpower', 'skill', acctid, magic FROM " . db_prefix("accounts"); + db_query($sql); + debug("Dropping magic field from accounts table"); + $sql = "ALTER TABLE " . db_prefix("accounts") . " DROP magic"; + db_query($sql); + } elseif ($row['Field']=="magicuses") { + debug("Migrating mystic powers uses field"); + $sql = "INSERT INTO " . db_prefix("module_userprefs") . " (modulename,setting,userid,value) SELECT 'specialtymysticpower', 'uses', acctid, magicuses FROM " . db_prefix("accounts"); + db_query($sql); + debug("Dropping magicuses field from accounts table"); + $sql = "ALTER TABLE " . db_prefix("accounts") . " DROP magicuses"; + db_query($sql); + } + } + debug("Migrating Mystic Powers Specialty"); + $sql = "UPDATE " . db_prefix("accounts") . " SET specialty='$specialty' WHERE specialty='2'"; + db_query($sql); + + module_addhook("choose-specialty"); + module_addhook("set-specialty"); + module_addhook("fightnav-specialties"); + module_addhook("apply-specialties"); + module_addhook("newday"); + module_addhook("incrementspecialty"); + module_addhook("specialtynames"); + module_addhook("specialtymodules"); + module_addhook("specialtycolor"); + module_addhook("dragonkill"); + return true; +} + +function specialtymysticpower_uninstall(){ + // Reset the specialty of anyone who had this specialty so they get to + // rechoose at new day + $sql = "UPDATE " . db_prefix("accounts") . " SET specialty='' WHERE specialty='MP'"; + db_query($sql); + return true; +} + +function specialtymysticpower_dohook($hookname,$args){ + global $session,$resline; + + $spec = "MP"; + $name = "Mystical Powers"; + $ccode = "`%"; + $ccode2 = "`%%"; // We need this to handle the damned sprintf escaping. + + switch ($hookname) { + case "dragonkill": + set_module_pref("uses", 0); + set_module_pref("skill", 0); + break; + case "choose-specialty": + if ($session['user']['specialty'] == "" || + $session['user']['specialty'] == '0') { + addnav("$ccode$name`0","newday.php?setspecialty=".$spec."$resline"); + $t1 = translate_inline("Dabbling in mystical forces"); + $t2 = appoencode(translate_inline("$ccode$name`0")); + rawoutput("$t1 ($t2)
"); + addnav("","newday.php?setspecialty=$spec$resline"); + } + break; + case "set-specialty": + if($session['user']['specialty'] == $spec) { + page_header($name); + output("`3Growing up, you remember knowing there was more to the world than the physical, and what you could place your hands on."); + output("You realized that your mind itself, with training, could be turned into a weapon."); + output("Over time, you began to control the thoughts of small creatures, commanding them to do your bidding, and also to begin to tap into the mystical force known as mana, which could be shaped into the elemental forms of fire, water, ice, earth, and wind."); + output("To your delight, it could also be used as a weapon against your foes."); + } + break; + case "specialtycolor": + $args[$spec] = $ccode; + break; + case "specialtynames": + $args[$spec] = translate_inline($name); + break; + case "specialtymodules": + $args[$spec] = "specialtymysticpower"; + break; + case "incrementspecialty": + if($session['user']['specialty'] == $spec) { + $new = get_module_pref("skill") + 1; + set_module_pref("skill", $new); + $name = translate_inline($name); + $c = $args['color']; + output("`n%sYou gain a level in `&%s%s to `#%s%s!", + $c, $name, $c, $new, $c); + $x = $new % 3; + if ($x == 0){ + output("`n`^You gain an extra use point!`n"); + set_module_pref("uses", get_module_pref("uses") + 1); + }else{ + if (3-$x == 1) { + output("`n`^Only 1 more skill level until you gain an extra use point!`n"); + } else { + output("`n`^Only %s more skill levels until you gain an extra use point!`n", (3-$x)); + } + } + output_notl("`0"); + } + break; + case "newday": + $bonus = getsetting("specialtybonus", 1); + if($session['user']['specialty'] == $spec) { + $name = translate_inline($name); + if ($bonus == 1) { + output("`n`2For being interested in %s%s`2, you receive `^1`2 extra `&%s%s`2 use for today.`n",$ccode,$name,$ccode,$name); + } else { + output("`n`2For being interested in %s%s`2, you receive `^%s`2 extra `&%s%s`2 uses for today.`n",$ccode,$name,$bonus,$ccode,$name); + } + } + $amt = (int)(get_module_pref("skill") / 3); + if ($session['user']['specialty'] == $spec) $amt = $amt + $bonus; + set_module_pref("uses", $amt); + break; + case "fightnav-specialties": + $uses = get_module_pref("uses"); + $script = $args['script']; + if ($uses > 0) { + addnav(array("$ccode2$name (%s points)`0", $uses), ""); + addnav(array("e?$ccode2 • Regeneration`7 (%s)`0", 1), + $script."op=fight&skill=$spec&l=1", true); + } + if ($uses > 1) { + addnav(array("$ccode2 • Earth Fist`7 (%s)`0", 2), + $script."op=fight&skill=$spec&l=2",true); + } + if ($uses > 2) { + addnav(array("$ccode2 • Siphon Life`7 (%s)`0", 3), + $script."op=fight&skill=$spec&l=3",true); + } + if ($uses > 4) { + addnav(array("g?$ccode2 • Lightning Aura`7 (%s)`0", 5), + $script."op=fight&skill=$spec&l=5",true); + } + break; + case "apply-specialties": + $skill = httpget('skill'); + $l = httpget('l'); + if ($skill==$spec){ + if (get_module_pref("uses") >= $l){ + switch($l){ + case 1: + apply_buff('mp1', array( + "startmsg"=>"`^You begin to regenerate!", + "name"=>"`%Regeneration", + "rounds"=>5, + "wearoff"=>"You have stopped regenerating.", + "regen"=>$session['user']['level'], + "effectmsg"=>"You regenerate for {damage} health.", + "effectnodmgmsg"=>"You have no wounds to regenerate.", + "aura"=>true, + "auramsg"=>"`5Your {companion}`5 regenerates for `^{damage} health`5 due to your healing aura.", + "schema"=>"module-specialtymysticpower" + )); + break; + case 2: + apply_buff('mp2', array( + "startmsg"=>"`^{badguy}`% is clutched by a fist of earth and slammed to the ground!", + "name"=>"`%Earth Fist", + "rounds"=>5, + "wearoff"=>"The earthen fist crumbles to dust.", + "minioncount"=>1, + "effectmsg"=>"A huge fist of earth pummels {badguy} for `^{damage}`) points.", + "minbadguydamage"=>1, + "maxbadguydamage"=>$session['user']['level']*3, + "areadamage"=>true, + "schema"=>"module-specialtymysticpower" + )); + break; + case 3: + apply_buff('mp3', array( + "startmsg"=>"`^Your weapon glows with an unearthly presence.", + "name"=>"`%Siphon Life", + "rounds"=>5, + "wearoff"=>"Your weapon's aura fades.", + "lifetap"=>1, //ratio of damage healed to damage dealt + "effectmsg"=>"You are healed for {damage} health.", + "effectnodmgmsg"=>"You feel a tingle as your weapon tries to heal your already healthy body.", + "effectfailmsg"=>"Your weapon wails as you deal no damage to your opponent.", + "schema"=>"module-specialtymysticpower" + )); + break; + case 5: + apply_buff('mp5', array( + "startmsg"=>"`^Your skin sparkles as you assume an aura of lightning.", + "name"=>"`%Lightning Aura", + "rounds"=>5, + "wearoff"=>"With a fizzle, your skin returns to normal.", + "damageshield"=>2, // ratio of damage reflected to damage received + "effectmsg"=>"{badguy} recoils as lightning arcs out from your skin, hitting for `^{damage}`) damage.", + "effectnodmgmsg"=>"{badguy} is slightly singed by your lightning, but otherwise unharmed.", + "effectfailmsg"=>"{badguy} is slightly singed by your lightning, but otherwise unharmed.", + "schema"=>"module-specialtymysticpower" + )); + break; + } + set_module_pref("uses", get_module_pref("uses") - $l); + }else{ + apply_buff('mp0', array( + "startmsg"=>"You furrow your brow and call on the powers of the elements. A tiny flame appears. {badguy} lights a cigarette from it, giving you a word of thanks before swinging at you again.", + "rounds"=>1, + "schema"=>"module-specialtymysticpower" + )); + } + } + break; + } + return $args; +} + +function specialtymysticpower_run(){ +} +?> diff --git a/lotgd-web/lotgd/modules/specialtythiefskills.php b/lotgd-web/lotgd/modules/specialtythiefskills.php new file mode 100755 index 0000000..48e6198 --- /dev/null +++ b/lotgd-web/lotgd/modules/specialtythiefskills.php @@ -0,0 +1,232 @@ + "Specialty - Thieving Skills", + "author" => "Eric Stevens", + "version" => "1.0", + "download" => "core_module", + "category" => "Specialties", + "prefs" => array( + "Specialty - Thieving Skills User Prefs,title", + "skill"=>"Skill points in Thieving Skills,int|0", + "uses"=>"Uses of Thieving Skills allowed,int|0", + ), + ); + return $info; +} + +function specialtythiefskills_install(){ + $sql = "DESCRIBE " . db_prefix("accounts"); + $result = db_query($sql); + $specialty="TS"; + while($row = db_fetch_assoc($result)) { + // Convert the user over + if ($row['Field'] == "thievery") { + debug("Migrating thieving skills field"); + $sql = "INSERT INTO " . db_prefix("module_userprefs") . " (modulename,setting,userid,value) SELECT 'specialtythiefskills', 'skill', acctid, thievery FROM " . db_prefix("accounts"); + db_query($sql); + debug("Dropping thievery field from accounts table"); + $sql = "ALTER TABLE " . db_prefix("accounts") . " DROP thievery"; + db_query($sql); + } elseif ($row['Field']=="thieveryuses") { + debug("Migrating thieving skills uses field"); + $sql = "INSERT INTO " . db_prefix("module_userprefs") . " (modulename,setting,userid,value) SELECT 'specialtythiefskills', 'uses', acctid, thieveryuses FROM " . db_prefix("accounts"); + db_query($sql); + debug("Dropping thieveryuses field from accounts table"); + $sql = "ALTER TABLE " . db_prefix("accounts") . " DROP thieveryuses"; + db_query($sql); + } + } + debug("Migrating Thieving Skills Specialty"); + $sql = "UPDATE " . db_prefix("accounts") . " SET specialty='$specialty' WHERE specialty='3'"; + db_query($sql); + + module_addhook("choose-specialty"); + module_addhook("set-specialty"); + module_addhook("fightnav-specialties"); + module_addhook("apply-specialties"); + module_addhook("newday"); + module_addhook("incrementspecialty"); + module_addhook("specialtynames"); + module_addhook("specialtymodules"); + module_addhook("specialtycolor"); + module_addhook("dragonkill"); + return true; +} + +function specialtythiefskills_uninstall(){ + // Reset the specialty of anyone who had this specialty so they get to + // rechoose at new day + $sql = "UPDATE " . db_prefix("accounts") . " SET specialty='' WHERE specialty='TS'"; + db_query($sql); + return true; +} + +function specialtythiefskills_dohook($hookname,$args){ + global $session,$resline; + + $spec = "TS"; + $name = "Thieving Skills"; + $ccode = "`^"; + + switch ($hookname) { + case "dragonkill": + set_module_pref("uses", 0); + set_module_pref("skill", 0); + break; + case "choose-specialty": + if ($session['user']['specialty'] == "" || + $session['user']['specialty'] == '0') { + addnav("$ccode$name`0","newday.php?setspecialty=".$spec."$resline"); + $t1 = translate_inline("Stealing from the rich and giving to yourself"); + $t2 = appoencode(translate_inline("$ccode$name`0")); + rawoutput("$t1 ($t2)
"); + addnav("","newday.php?setspecialty=$spec$resline"); + } + break; + case "set-specialty": + if($session['user']['specialty'] == $spec) { + page_header($name); + output("`6Growing up, you recall discovering that a casual bump in a crowded room could earn you the coin purse of someone otherwise more fortunate than you."); + output("You also discovered that the back side of your enemies were considerably more prone to a narrow blade than the front side was to even a powerful weapon."); + } + break; + case "specialtycolor": + $args[$spec] = $ccode; + break; + case "specialtynames": + $args[$spec] = translate_inline($name); + break; + case "specialtymodules": + $args[$spec] = "specialtythiefskills"; + break; + case "incrementspecialty": + if($session['user']['specialty'] == $spec) { + $new = get_module_pref("skill") + 1; + set_module_pref("skill", $new); + $name = translate_inline($name); + $c = $args['color']; + output("`n%sYou gain a level in `&%s%s to `#%s%s!", + $c, $name, $c, $new, $c); + $x = $new % 3; + if ($x == 0){ + output("`n`^You gain an extra use point!`n"); + set_module_pref("uses", get_module_pref("uses") + 1); + }else{ + if (3-$x == 1) { + output("`n`^Only 1 more skill level until you gain an extra use point!`n"); + } else { + output("`n`^Only %s more skill levels until you gain an extra use point!`n", (3-$x)); + } + } + output_notl("`0"); + } + break; + case "newday": + $bonus = getsetting("specialtybonus", 1); + if($session['user']['specialty'] == $spec) { + $name = translate_inline($name); + if ($bonus == 1) { + output("`n`2For being interested in %s%s`2, you receive `^1`2 extra `&%s%s`2 use for today.`n",$ccode,$name,$ccode,$name); + } else { + output("`n`2For being interested in %s%s`2, you receive `^%s`2 extra `&%s%s`2 uses for today.`n",$ccode,$name,$bonus,$ccode,$name); + } + } + $amt = (int)(get_module_pref("skill") / 3); + if ($session['user']['specialty'] == $spec) $amt = $amt + $bonus; + set_module_pref("uses", $amt); + break; + case "fightnav-specialties": + $uses = get_module_pref("uses"); + $script = $args['script']; + if ($uses > 0) { + addnav(array("$ccode$name (%s points)`0", $uses), ""); + addnav(array("$ccode • Insult`7 (%s)`0", 1), + $script."op=fight&skill=$spec&l=1", true); + } + if ($uses > 1) { + addnav(array("$ccode • Poison Blade`7 (%s)`0", 2), + $script."op=fight&skill=$spec&l=2",true); + } + if ($uses > 2) { + addnav(array("$ccode • Hidden Attack`7 (%s)`0", 3), + $script."op=fight&skill=$spec&l=3",true); + } + if ($uses > 4) { + addnav(array("$ccode • Backstab`7 (%s)`0", 5), + $script."op=fight&skill=$spec&l=5",true); + } + break; + case "apply-specialties": + $skill = httpget('skill'); + $l = httpget('l'); + if ($skill==$spec){ + if (get_module_pref("uses") >= $l){ + switch($l){ + case 1: + apply_buff('ts1',array( + "startmsg"=>"`^You call {badguy} a bad name, making it cry.", + "name"=>"`^Insult", + "rounds"=>5, + "wearoff"=>"Your victim stops crying and wipes its nose.", + "roundmsg"=>"{badguy} feels dejected and cannot attack as well.", + "badguyatkmod"=>0.5, + "schema"=>"module-specialtythiefskills" + )); + break; + case 2: + apply_buff('ts2',array( + "startmsg"=>"`^You apply some poison to your {weapon}.", + "name"=>"`^Poison Attack", + "rounds"=>5, + "wearoff"=>"Your victim's blood has washed the poison from your {weapon}.", + "atkmod"=>2, + "roundmsg"=>"Your attack is multiplied!", + "schema"=>"module-specialtythiefskills" + )); + break; + case 3: + apply_buff('ts3', array( + "startmsg"=>"`^With the skill of an expert thief, you virtually disappear, and attack {badguy} from a safer vantage point.", + "name"=>"`^Hidden Attack", + "rounds"=>5, + "wearoff"=>"Your victim has located you.", + "roundmsg"=>"{badguy} cannot locate you, and swings wildly!", + "badguyatkmod"=>0, + "schema"=>"module-specialtythiefskills" + )); + break; + case 5: + apply_buff('ts5',array( + "startmsg"=>"`^Using your skills as a thief, you disappear behind {badguy} and slide a thin blade between its vertebrae!", + "name"=>"`^Backstab", + "rounds"=>5, + "wearoff"=>"Your victim won't be so likely to let you get behind it again!", + "atkmod"=>3, + "defmod"=>3, + "roundmsg"=>"Your attack is multiplied, as is your defense!", + "schema"=>"module-specialtythiefskills" + )); + break; + } + set_module_pref("uses", get_module_pref("uses") - $l); + }else{ + apply_buff('ts0', array( + "startmsg"=>"You try to attack {badguy} by putting your best thievery skills into practice, but instead, you trip over your feet.", + "rounds"=>1, + "schema"=>"module-specialtythiefskills" + )); + } + } + break; + } + return $args; +} + +function specialtythiefskills_run(){ +} +?> diff --git a/lotgd-web/lotgd/motd.php b/lotgd-web/lotgd/motd.php new file mode 100755 index 0000000..954eed9 --- /dev/null +++ b/lotgd-web/lotgd/motd.php @@ -0,0 +1,119 @@ +$addm | $addp ]

"); +} + +if ($op=="vote"){ + $motditem = httppost('motditem'); + $choice = httppost('choice'); + $sql = "DELETE FROM " . db_prefix("pollresults") . " WHERE motditem='$motditem' AND account='{$session['user']['acctid']}'"; + db_query($sql); + $sql = "INSERT INTO " . db_prefix("pollresults") . " (choice,account,motditem) VALUES ('$choice','{$session['user']['acctid']}','$motditem')"; + db_query($sql); + invalidatedatacache("poll-$motditem"); + header("Location: motd.php"); + exit(); +} +if ($op == "add" || $op == "addpoll" || $op == "del") { + if ($session['user']['superuser'] & SU_POST_MOTD) { + if ($op == "add") motd_form($id); + elseif ($op == "addpoll") motd_poll_form($id); + elseif ($op == "del") motd_del($id); + } else { + if ($session['user']['loggedin']){ + $session['user']['experience'] = + round($session['user']['experience']*0.9,0); + addnews("%s was penalized for attempting to defile the gods.", + $session['user']['name']); + output("You've attempted to defile the gods. You are struck with a wand of forgetfulness. Some of what you knew, you no longer know."); + saveuser(); + } + } +} +if ($op=="") { + $count = getsetting("motditems", 5); + $newcount = httpget("newcount"); + if (!$newcount || !httppost('proceed')) $newcount=0; + /* + motditem("Beta!","Please see the beta message below.","","", ""); + */ + $m = httpget("month"); + if ($m > ""){ + $sql = "SELECT " . db_prefix("motd") . ".*,name AS motdauthorname FROM " . db_prefix("motd") . " LEFT JOIN " . db_prefix("accounts") . " ON " . db_prefix("accounts") . ".acctid = " . db_prefix("motd") . ".motdauthor WHERE motddate >= '{$m}-01' AND motddate <= '{$m}-31' ORDER BY motddate DESC"; + $result = db_query_cached($sql,"motd-$m"); + }else{ + $sql = "SELECT " . db_prefix("motd") . ".*,name AS motdauthorname FROM " . db_prefix("motd") . " LEFT JOIN " . db_prefix("accounts") . " ON " . db_prefix("accounts") . ".acctid = " . db_prefix("motd") . ".motdauthor ORDER BY motddate DESC limit $newcount,".($newcount+$count); + if ($newcount=0) //cache only the last x items + $result = db_query_cached($sql,"motd"); + else + $result = db_query($sql); + } + while ($row = db_fetch_assoc($result)) { + if (!isset($session['user']['lastmotd'])) + $session['user']['lastmotd']=0; + if ($row['motdauthorname']=="") + $row['motdauthorname']="`@Green Dragon Staff`0"; + if ($row['motdtype']==0){ + motditem($row['motdtitle'], $row['motdbody'], + $row['motdauthorname'], $row['motddate'], + $row['motditem']); + }else{ + pollitem($row['motditem'], $row['motdtitle'], $row['motdbody'], + $row['motdauthorname'],$row['motddate'], + $row['motditem']); + } + } + /* + motditem("Beta!","For those who might be unaware, this website is still in beta mode. I'm working on it when I have time, which generally means a couple of changes a week. Feel free to drop suggestions, I'm open to anything :-)","","", ""); + */ + + $result = db_query("SELECT mid(motddate,1,7) AS d, count(*) AS c FROM ".db_prefix("motd")." GROUP BY d ORDER BY d DESC"); + $row = db_fetch_assoc($result); + rawoutput("
"); + output("MoTD Archives:"); + rawoutput("".tlbutton_clear()); + rawoutput(""); + rawoutput(""); + rawoutput(" "); + rawoutput("
"); + + commentdisplay("`n`@Commentary:`0`n", "motd"); +} + +$session['needtoviewmotd']=false; + +$sql = "SELECT motddate FROM " . db_prefix("motd") ." ORDER BY motditem DESC LIMIT 1"; +$result = db_query_cached($sql, "motddate"); +$row = db_fetch_assoc($result); +$session['user']['lastmotd']=$row['motddate']; + +popup_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/mounts.php b/lotgd-web/lotgd/mounts.php new file mode 100755 index 0000000..b93791e --- /dev/null +++ b/lotgd-web/lotgd/mounts.php @@ -0,0 +1,466 @@ +"); + while($row = db_fetch_assoc($r)) { + echo(""); + } + if (db_num_rows($r) == 0) { + echo(""); + } + echo(""); + exit(); +} + + +check_su_access(SU_EDIT_MOUNTS); + +tlschema("mounts"); + +page_header("Mount Editor"); + +require_once("lib/superusernav.php"); +superusernav(); + +addnav("Mount Editor"); +addnav("Add a mount","mounts.php?op=add"); + +if ($op=="deactivate"){ + $sql = "UPDATE " . db_prefix("mounts") . " SET mountactive=0 WHERE mountid='$id'"; + db_query($sql); + $op=""; + httpset("op", ""); + invalidatedatacache("mountdata-$id"); +} elseif ($op=="activate"){ + $sql = "UPDATE " . db_prefix("mounts") . " SET mountactive=1 WHERE mountid='$id'"; + db_query($sql); + $op=""; + httpset("op", ""); + invalidatedatacache("mountdata-$id"); +} elseif ($op=="del") { + //refund for anyone who has a mount of this type. + $sql = "SELECT * FROM ".db_prefix("mounts")." WHERE mountid='$id'"; + $result = db_query_cached($sql, "mountdata-$id", 3600); + $row = db_fetch_assoc($result); + $sql = "UPDATE ".db_prefix("accounts")." SET gems=gems+{$row['mountcostgems']}, goldinbank=goldinbank+{$row['mountcostgold']}, hashorse=0 WHERE hashorse={$row['mountid']}"; + db_query($sql); + //drop the mount. + $sql = "DELETE FROM " . db_prefix("mounts") . " WHERE mountid='$id'"; + db_query($sql); + module_delete_objprefs('mounts', $id); + $op = ""; + httpset("op", ""); + invalidatedatacache("mountdata-$id"); +} elseif ($op=="give") { + $session['user']['hashorse'] = $id; + // changed to make use of the cached query + $sql = "SELECT * FROM ".db_prefix("mounts")." WHERE mountid='$id'"; + $result = db_query_cached($sql, "mountdata-$id", 3600); + $row = db_fetch_assoc($result); + $buff = unserialize($row['mountbuff']); + if ($buff['schema'] == "") $buff['schema'] = "mounts"; + apply_buff("mount",$buff); + $op=""; + httpset("op", ""); +}elseif ($op=="save"){ + $subop = httpget("subop"); + if ($subop == "") { + $buff = array(); + $mount = httppost('mount'); + if ($mount) { + reset($mount['mountbuff']); + while (list($key,$val)=each($mount['mountbuff'])){ + if ($val>""){ + $buff[$key]=stripslashes($val); + } + } + $buff['schema']="mounts"; + httppostset('mount', $buff, 'mountbuff'); + + list($sql, $keys, $vals) = postparse(false, 'mount'); + if ($id>""){ + $sql="UPDATE " . db_prefix("mounts") . + " SET $sql WHERE mountid='$id'"; + }else{ + $sql="INSERT INTO " . db_prefix("mounts") . + " ($keys) VALUES ($vals)"; + } + db_query($sql); + invalidatedatacache("mountdata-$id"); + if (db_affected_rows()>0){ + output("`^Mount saved!`0`n"); + }else{ + output("`^Mount `\$not`^ saved: `\$%s`0`n", $sql); + } + } + } elseif ($subop=="module") { + // Save modules settings + $module = httpget("module"); + $post = httpallpost(); + reset($post); + while(list($key, $val) = each($post)) { + set_module_objpref("mounts", $id, $key, $val, $module); + } + output("`^Saved!`0`n"); + } + if ($id) { + $op="edit"; + } else { + $op = ""; + } + httpset("op", $op); +} + +if ($op==""){ + $sql = "SELECT count(acctid) AS c, hashorse FROM ".db_prefix("accounts")." GROUP BY hashorse"; + $result = db_query($sql); + $mounts = array(); + while ($row = db_fetch_assoc($result)){ + $mounts[$row['hashorse']] = $row['c']; + } + rawoutput(""); + + $sql = "SELECT * FROM " . db_prefix("mounts") . " ORDER BY mountcategory, mountcostgems, mountcostgold"; + $ops = translate_inline("Ops"); + $name = translate_inline("Name"); + $cost = translate_inline("Cost"); + $feat = translate_inline("Features"); + $owners = translate_inline("Owners"); + + $edit = translate_inline("Edit"); + $give = translate_inline("Give"); + $del = translate_inline("Del"); + $deac = translate_inline("Deactivate"); + $act = translate_inline("Activate"); + + $conf = translate_inline("There are %s user(s) who own this mount, are you sure you wish to delete it?"); + + rawoutput(""); + rawoutput(""); + $result = db_query($sql); + $cat = ""; + $count=0; + + $number=db_num_rows($result); + for ($i=0;$i<$number;$i++){ + $row = db_fetch_assoc($result); + if ($cat!=$row['mountcategory']){ + rawoutput(""); + $cat = $row['mountcategory']; + $count=0; + } + if (isset($mounts[$row['mountid']])) { + $mounts[$row['mountid']] = (int)$mounts[$row['mountid']]; + } else { + $mounts[$row['mountid']] = 0; + } + rawoutput(""); + rawoutput(""); + addnav("","mounts.php?op=deactivate&id={$row['mountid']}"); + }else{ + rawoutput("$act ]"); + addnav("","mounts.php?op=activate&id={$row['mountid']}"); + } + rawoutput(""); + $count++; + } + rawoutput("
$ops$name$cost$feat$owners
"); + output("Category: %s", $row['mountcategory']); + rawoutput("
[ $edit |"); + addnav("","mounts.php?op=edit&id={$row['mountid']}"); + rawoutput("$give |",true); + addnav("","mounts.php?op=give&id={$row['mountid']}"); + if ($row['mountactive']){ + rawoutput("$del |"); + }else{ + $mconf = sprintf($conf, $mounts[$row['mountid']]); + rawoutput("$del |"); + addnav("","mounts.php?op=del&id={$row['mountid']}"); + } + if ($row['mountactive']) { + rawoutput("$deac ]"); + output_notl("`&%s`0", $row['mountname']); + rawoutput(""); + output("`%%s gems`0, `^%s gold`0",$row['mountcostgems'], $row['mountcostgold']); + rawoutput(""); + $features = array("FF"=>$row['mountforestfights']); + $args = array("id"=>$row['mountid'],"features"=>&$features); + $args = modulehook("mountfeatures", $args); + reset($features); + $mcount = 1; + $max = count($features); + foreach ($features as $fname=>$fval) { + $fname = translate_inline($fname); + output_notl("%s: %s%s", $fname, $fval, ($mcount==$max?"":", ")); + $mcount++; + } + rawoutput(""); + $file = "mounts.php?op=xml&id=".$row['mountid']; + rawoutput(""); + rawoutput("
"); + output("`nIf you wish to delete a mount, you have to deactivate it first."); + output("If there are any owners of the mount when it is deleted, they will no longer have a mount, but they will get a FULL refund of the price of the mount at the time of deletion."); +}elseif ($op=="add"){ + output("Add a mount:`n"); + addnav("Mount Editor Home","mounts.php"); + mountform(array()); +}elseif ($op=="edit"){ + addnav("Mount Editor Home","mounts.php"); + $sql = "SELECT * FROM " . db_prefix("mounts") . " WHERE mountid='$id'"; + $result = db_query_cached($sql, "mountdata-$id", 3600); + if (db_num_rows($result)<=0){ + output("`iThis mount was not found.`i"); + }else{ + addnav("Mount properties", "mounts.php?op=edit&id=$id"); + module_editor_navs("prefs-mounts", "mounts.php?op=edit&subop=module&id=$id&module="); + $subop=httpget("subop"); + if ($subop=="module") { + $module = httpget("module"); + rawoutput("
"); + module_objpref_edit("mounts", $module, $id); + rawoutput("
"); + addnav("", "mounts.php?op=save&subop=module&id=$id&module=$module"); + } else { + output("Mount Editor:`n"); + $row = db_fetch_assoc($result); + $row['mountbuff']=unserialize($row['mountbuff']); + mountform($row); + } + } +} + +function mountform($mount){ + // Let's sanitize the data + if (!isset($mount['mountname'])) $mount['mountname'] = ""; + if (!isset($mount['mountid'])) $mount['mountid'] = ""; + if (!isset($mount['mountdesc'])) $mount['mountdesc'] = ""; + if (!isset($mount['mountcategory'])) $mount['mountcategory'] = ""; + if (!isset($mount['mountlocation'])) $mount['mountlocation'] = 'all'; + if (!isset($mount['mountdkcost'])) $mount['mountdkcost'] = 0; + if (!isset($mount['mountcostgems'])) $mount['mountcostgems'] = 0; + if (!isset($mount['mountcostgold'])) $mount['mountcostgold'] = 0; + if (!isset($mount['mountfeedcost'])) $mount['mountfeedcost'] = 0; + if (!isset($mount['mountforestfights'])) $mount['mountforestfights'] = 0; + if (!isset($mount['newday'])) $mount['newday'] = ""; + if (!isset($mount['recharge'])) $mount['recharge'] = ""; + if (!isset($mount['partrecharge'])) $mount['partrecharge'] = ""; + if (!isset($mount['mountbuff'])) $mount['mountbuff'] = array(); + if (!isset($mount['mountactive'])) $mount['mountactive']=0; + if (!isset($mount['mountbuff']['name'])) + $mount['mountbuff']['name'] = ""; + if (!isset($mount['mountbuff']['roundmsg'])) + $mount['mountbuff']['roundmsg'] = ""; + if (!isset($mount['mountbuff']['wearoff'])) + $mount['mountbuff']['wearoff'] = ""; + if (!isset($mount['mountbuff']['effectmsg'])) + $mount['mountbuff']['effectmsg'] = ""; + if (!isset($mount['mountbuff']['effectnodmgmsg'])) + $mount['mountbuff']['effectnodmgmsg'] = ""; + if (!isset($mount['mountbuff']['effectfailmsg'])) + $mount['mountbuff']['effectfailmsg'] = ""; + if (!isset($mount['mountbuff']['rounds'])) + $mount['mountbuff']['rounds'] = 0; + if (!isset($mount['mountbuff']['atkmod'])) + $mount['mountbuff']['atkmod'] = ""; + if (!isset($mount['mountbuff']['defmod'])) + $mount['mountbuff']['defmod'] = ""; + if (!isset($mount['mountbuff']['invulnerable'])) + $mount['mountbuff']['invulnerable'] = ""; + if (!isset($mount['mountbuff']['regen'])) + $mount['mountbuff']['regen'] = ""; + if (!isset($mount['mountbuff']['minioncount'])) + $mount['mountbuff']['minioncount'] = ""; + if (!isset($mount['mountbuff']['minbadguydamage'])) + $mount['mountbuff']['minbadguydamage'] = ""; + if (!isset($mount['mountbuff']['maxbadguydamage'])) + $mount['mountbuff']['maxbadguydamage'] = ""; + + if (!isset($mount['mountbuff']['mingoodguydamage'])) + $mount['mountbuff']['mingoodguydamage'] = ""; + if (!isset($mount['mountbuff']['maxgoodguydamage'])) + $mount['mountbuff']['maxgoodguydamage'] = ""; + if (!isset($mount['mountbuff']['lifetap'])) + $mount['mountbuff']['lifetap'] = ""; + if (!isset($mount['mountbuff']['damageshield'])) + $mount['mountbuff']['damageshield'] = ""; + if (!isset($mount['mountbuff']['badguydmgmod'])) + $mount['mountbuff']['badguydmgmod'] = ""; + if (!isset($mount['mountbuff']['badguyatkmod'])) + $mount['mountbuff']['badguyatkmod'] = ""; + if (!isset($mount['mountbuff']['badguydefmod'])) + $mount['mountbuff']['badguydefmod'] = ""; + + rawoutput("
"); + rawoutput(""); + addnav("","mounts.php?op=save&id={$mount['mountid']}"); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput("
"); + output("Mount Name:"); + rawoutput("
"); + output("Mount Description:"); + rawoutput("
"); + output("Mount Category:"); + rawoutput("
"); + output("Mount Availability:"); + rawoutput(""); + // Run a modulehook to find out where stables are located. By default + // they are located in 'Degolburg' (ie, getgamesetting('villagename')); + // Some later module can remove them however. + $vname = getsetting('villagename', LOCATION_FIELDS); + $locs = array($vname => sprintf_translate("The Village of %s", $vname)); + $locs = modulehook("stablelocs", $locs); + $locs['all'] = translate_inline("Everywhere"); + ksort($locs); + reset($locs); + rawoutput("
"); + output("Mount Cost (DKs):"); + rawoutput("
"); + output("Mount Cost (Gems):"); + rawoutput("
"); + output("Mount Cost (Gold):"); + rawoutput("
"); + output("Mount Feed Cost`n(Gold per level):"); + rawoutput("
"); + output("Delta Forest Fights:"); + rawoutput("
"); + output("`bMount Messages:`b"); + rawoutput("
"); + output("New Day:"); + rawoutput("
"); + output("Full Recharge:"); + rawoutput("
"); + output("Partial Recharge:"); + rawoutput("
"); + output("Mount Buff:"); + rawoutput(""); + output("Buff name:"); + rawoutput("
"); + output("`bBuff Messages:`b`n"); + output("Each round:"); + rawoutput("
"); + output("Wear off:"); + rawoutput("
"); + output("Effect:"); + rawoutput("
"); + output("Effect No Damage:"); + rawoutput("
"); + output("Effect Fail:"); + rawoutput("
"); + output("(message replacements: {badguy}, {goodguy}, {weapon}, {armor}, {creatureweapon}, and where applicable {damage}.)`n"); + output("`n`bEffects:`b`n"); + output("Rounds to last (from new day):"); + rawoutput("
"); + output("Player Atk mod:"); + rawoutput(""); + output("(multiplier)`n"); + output("Player Def mod:"); + rawoutput(""); + output("(multiplier)`n"); + output("Player is invulnerable (1 = yes, 0 = no):"); + rawoutput("
"); + output("Regen:"); + rawoutput("
"); + output("Minion Count:"); + rawoutput("
"); + + output("Min Badguy Damage:"); + rawoutput("
"); + output("Max Badguy Damage:"); + rawoutput("
"); + output("Min Goodguy Damage:"); + rawoutput("
"); + output("Max Goodguy Damage:"); + rawoutput("
"); + + output("Lifetap:"); + rawoutput(""); + output("(multiplier)`n"); + output("Damage shield:"); + rawoutput(""); + output("(multiplier)`n"); + output("Badguy Damage mod:"); + rawoutput(""); + output("(multiplier)`n"); + output("Badguy Atk mod:"); + rawoutput(""); + output("(multiplier)`n"); + output("Badguy Def mod:"); + rawoutput(""); + output("(multiplier)`n"); + output("`bOn Dynamic Buffs`b`n"); + output("`@In the above, for most fields, you can choose to enter valid PHP code, substituting for fields in the user's account table.`n"); + output("Examples of code you might enter:`n"); + output("`^`n"); + output("round(/10)`n"); + output("round(/max(,1))`n"); + output("`@Fields you might be interested in for this: `n"); + output_notl("`3name, sex `7(0=male 1=female)`3, specialty `7(DA=darkarts MP=mystical TS=thief)`3,`n"); + output_notl("experience, gold, weapon `7(name)`3, armor `7(name)`3, level,`n"); + output_notl("defense, attack, alive, goldinbank,`n"); + output_notl("spirits `7(-2 to +2 or -6 for resurrection)`3, hitpoints, maxhitpoints, gems,`n"); + output_notl("weaponvalue `7(gold value)`3, armorvalue `7(gold value)`3, turns, title, weapondmg, armordef,`n"); + output_notl("age `7(days since last DK)`3, charm, playerfights, dragonkills, resurrections `7(times died since last DK)`3,`n"); + output_notl("soulpoints, gravefights, deathpower `7(%s favor)`3,`n", getsetting("deathoverlord", '`$Ramius')); + output_notl("race, dragonage, bestdragonage`n`n"); + output("You can also use module preferences by using (for instance '' or ''`n`n"); + output("`@Finally, starting a field with 'debug:' will enable debug output for that field to help you locate errors in your implementation."); + output("While testing new buffs, you should be sure to debug fields before you release them on the world, as the PHP script will otherwise throw errors to the user if you have any, and this can break the site at various spots (as in places that redirects should happen)."); + rawoutput("
"); + $save = translate_inline("Save"); + rawoutput("
"); +} + +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/newday.php b/lotgd-web/lotgd/newday.php new file mode 100755 index 0000000..1b0133b --- /dev/null +++ b/lotgd-web/lotgd/newday.php @@ -0,0 +1,324 @@ +"Max Hitpoints + 5", + "ff"=>"Forest Fights + 1", + "at"=>"Attack + 1", + "de"=>"Defense + 1", + "unknown"=>"Unknown Spends (contact an admin to investigate!)", +); +$canbuy = array( + "hp"=>1, + "ff"=>1, + "at"=>1, + "de"=>1, + "unknown"=>0, +); +$retargs = modulehook("dkpointlabels", array('desc'=>$labels, 'buy'=>$canbuy)); +$labels = $retargs['desc']; +$canbuy = $retargs['buy']; +$pdks = array(); +reset($labels); +foreach($labels as $type=>$label) { + $pdks[$type] = (int)httppost($type); +} + +$pdk=httpget("pdk"); + +$dp = count($session['user']['dragonpoints']); +$dkills = $session['user']['dragonkills']; + +if ($pdk==1){ + reset($labels); + $pdktotal = 0; + $pdkneg = false; + modulehook("pdkpointrecalc"); + foreach($labels as $type=>$label) { + $pdktotal += (int)$pdks[$type]; + if((int)$pdks[$type] < 0) $pdkneg = true; + } + if ($pdktotal == $dkills-$dp && !$pdkneg) { + $dp += $pdktotal; + $session['user']['maxhitpoints'] += (5 * $pdks["hp"]); + $session['user']['attack'] += $pdks["at"]; + $session['user']['defense'] += $pdks["de"]; + reset($labels); + foreach($labels as $type=>$label) { + $count = 0; + if (isset($pdks[$type])) $count = (int)$pdks[$type]; + while($count) { + $count--; + array_push($session['user']['dragonpoints'],$type); + } + } + }else{ + output("`\$Error: Please spend the correct total amount of dragon points.`n`n"); + } +} + +if ($dp < $dkills) { + require_once("lib/newday/dragonpointspend.php"); +} elseif (!$session['user']['race'] || $session['user']['race']==RACE_UNKNOWN){ + require_once("lib/newday/setrace.php"); +}elseif ($session['user']['specialty']==""){ + require_once("lib/newday/setspecialty.php"); +}else{ + page_header("It is a new day!"); + rawoutput(""); + output("`c`b`#It is a New Day!`0`b`c"); + rawoutput(""); + $resurrection = httpget('resurrection'); + + if ($session['user']['alive']!=true){ + $session['user']['resurrections']++; + output("`@You are resurrected! This is resurrection number %s.`0`n",$session['user']['resurrections']); + $session['user']['alive']=true; + invalidatedatacache("list.php-warsonline"); + } + $session['user']['age']++; + $session['user']['seenmaster']=0; + output("You open your eyes to discover that a new day has been bestowed upon you. It is day number `^%s.`0",$session['user']['age']); + output("You feel refreshed enough to take on the world!`n"); + output("`2Turns for today set to `^%s`2.`n",$turnsperday); + + $turnstoday = "Base: $turnsperday"; + $args = modulehook("pre-newday", + array("resurrection"=>$resurrection, "turnstoday"=>$turnstoday)); + $turnstoday = $args['turnstoday']; + + $interestrate = e_rand($mininterest*100,$maxinterest*100)/(float)100; + if ($session['user']['turns']>getsetting("fightsforinterest",4) && $session['user']['goldinbank']>=0) { + $interestrate=1; + output("`2Today's interest rate: `^0% (Bankers in this village only give interest to those who work for it)`2.`n"); + } elseif (getsetting("maxgoldforinterest", 100000) && $session['user']['goldinbank']>=getsetting("maxgoldforinterest", 100000)) { + $interestrate=1; + output("`2Today's interest rate: `^0%% (The bank will not pay interest on accounts equal or greater than %s to retain solvency)`2.`n", getsetting("maxgoldforinterest", 100000)); + }else{ + output("`2Today's interest rate: `^%s%% `n",($interestrate-1)*100); + if ($session['user']['goldinbank']>=0){ + output("`2Gold earned from interest: `^%s`2.`n",(int)($session['user']['goldinbank']*($interestrate-1))); + }else{ + output("`2Interest Accrued on Debt: `^%s`2 gold.`n",-(int)($session['user']['goldinbank']*($interestrate-1))); + } + } + + //clear all standard buffs + $tempbuf = unserialize($session['user']['bufflist']); + $session['user']['bufflist']=""; + strip_all_buffs(); + tlschema("buffs"); + while(list($key,$val)=@each($tempbuf)){ + if (array_key_exists('survivenewday', $val) && + $val['survivenewday']==1){ + //$session['bufflist'][$key]=$val; + if (array_key_exists('schema', $val) && $val['schema']) + tlschema($val['schema']); + apply_buff($key,$val); + if (array_key_exists('newdaymessage', $val) && + $val['newdaymessage']) { + output($val['newdaymessage']); + output_notl("`n"); + } + if (array_key_exists('schema', $val) && $val['schema']) + tlschema(); + } + } + tlschema(); + + output("`2Hitpoints have been restored to `^%s`2.`n",$session['user']['maxhitpoints']); + + reset($session['user']['dragonpoints']); + $dkff=0; + while(list($key,$val)=each($session['user']['dragonpoints'])){ + if ($val=="ff"){ + $dkff++; + } + } + if ($session['user']['hashorse']){ + $buff = unserialize($playermount['mountbuff']); + if (!isset($buff['schema']) || $buff['schema'] == "") + $buff['schema']="mounts"; + apply_buff('mount',$buff); + } + if ($dkff>0) { + output("`n`2You gain `^%s`2 forest %s from spent dragon points!", + $dkff, translate_inline($dkff == 1?"fight":"fights")); + } + $r1 = e_rand(-1,1); + $r2 = e_rand(-1,1); + $spirits = $r1+$r2; + $resurrectionturns=$spirits; + if ($resurrection=="true"){ + addnews("`&%s`& has been resurrected by %s`&.",$session['user']['name'],getsetting('deathoverlord','`$Ramius')); + $spirits=-6; + $resurrectionturns=getsetting('resurrectionturns',-6); + if (strstr($resurrectionturns,'%')) { + $resurrectionturns=strtok($resurrectionturns,'%'); + $resurrectionturns=(int)$resurrectionturns; + if ($resurrectionturns<-100) $resurrectionturns=-100; + $resurrectionturns=round(($turnsperday+$dkff)*($resurrectionturns/100),0); + } else { + if ($resurrectionturns<-($turnsperday+$dkff)) $resurrectionturns=-($turnsperday+$dkff); + } + $session['user']['deathpower']-=100; + $session['user']['restorepage']="village.php?c=1"; + } + + $sp = array((-6)=>"Resurrected", (-2)=>"Very Low", (-1)=>"Low", + (0)=>"Normal", 1=>"High", 2=>"Very High"); + $sp = translate_inline($sp); + output("`n`2You are in `^%s`2 spirits today!`n",$sp[$spirits]); + if (abs($spirits)>0){ + if($resurrectionturns>0){ + $gain=translate_inline("gain"); + }else{ + $gain=translate_inline("lose"); + } + $sff = abs($resurrectionturns); + output("`2As a result, you `^%s %s forest %s`2 for today!`n", + $gain, $sff, translate_inline($sff==1?"fight":"fights")); + } + $rp = $session['user']['restorepage']; + $x = max(strrpos("&",$rp),strrpos("?",$rp)); + if ($x>0) $rp = substr($rp,0,$x); + if (substr($rp,0,10)=="badnav.php"){ + addnav("Continue","news.php"); + }else{ + addnav("Continue", cmd_sanitize($rp)); + } + + $session['user']['laston'] = date("Y-m-d H:i:s"); + $bgold = $session['user']['goldinbank']; + $session['user']['goldinbank']*=$interestrate; + $nbgold = $session['user']['goldinbank'] - $bgold; + + if ($nbgold != 0) { + debuglog(($nbgold >= 0 ? "earned " : "paid ") . abs($nbgold) . " gold in interest"); + } + $turnstoday .= ", Spirits: $resurrectionturns, DK: $dkff"; + $session['user']['turns']=$turnsperday+$resurrectionturns+$dkff; + $session['user']['hitpoints'] = $session['user']['maxhitpoints']; + $session['user']['spirits'] = $spirits; + if ($resurrection != "true") + $session['user']['playerfights'] = $dailypvpfights; + $session['user']['transferredtoday'] = 0; + $session['user']['amountouttoday'] = 0; + $session['user']['seendragon'] = 0; + $session['user']['seenmaster'] = 0; + $session['user']['fedmount'] = 0; + if ($resurrection!="true"){ + $session['user']['soulpoints']=50 + 5 * $session['user']['level']; + $session['user']['gravefights']=getsetting("gravefightsperday",10); + } + $session['user']['boughtroomtoday'] = 0; + $session['user']['recentcomments']=$session['user']['lasthit']; + $session['user']['lasthit'] = gmdate("Y-m-d H:i:s"); + if ($session['user']['hashorse']){ + $msg = $playermount['newday']; + require_once("lib/substitute.php"); + $msg = substitute_array("`n`&".$msg."`0`n"); + output($msg); + require_once("lib/mountname.php"); + list($name, $lcname) = getmountname(); + + $mff = (int)$playermount['mountforestfights']; + $session['user']['turns'] += $mff; + $turnstoday.=", Mount: $mff"; + if ($mff > 0) { + $state = translate_inline("gain"); + $color = "`^"; + } elseif ($mff < 0) { + $state = translate_inline("lose"); + $color = "`$"; + } + $mff = abs($mff); + if ($mff != 0) { + output("`n`&Because of %s`&, you %s%s %s`& forest %s for today!`n`0", $lcname, $color, $state, $mff, translate_inline($mff==1?'fight':'fights')); + } + }else{ + output("`n`&You strap your `%%s`& to your back and head out for some adventure.`0",$session['user']['weapon']); + } + if ($session['user']['hauntedby']>""){ + output("`n`n`)You have been haunted by %s`); as a result, you lose a forest fight!",$session['user']['hauntedby']); + $session['user']['turns']--; + $session['user']['hauntedby']=""; + $turnstoday.=", Haunted: -1"; + } + + require_once("lib/extended-battle.php"); + unsuspend_companions("allowinshades"); + + if (!getsetting("newdaycron",0)) { + //check last time we did this vs now to see if it was a different game day. + $lastnewdaysemaphore = convertgametime(strtotime(getsetting("newdaySemaphore","0000-00-00 00:00:00") . " +0000")); + $gametoday = gametime(); + if (gmdate("Ymd",$gametoday)!=gmdate("Ymd",$lastnewdaysemaphore)){ + // it appears to be a different game day, acquire semaphore and + // check again. + $sql = "LOCK TABLES " . db_prefix("settings") . " WRITE"; + db_query($sql); + clearsettings(); + $lastnewdaysemaphore = convertgametime(strtotime(getsetting("newdaySemaphore","0000-00-00 00:00:00") . " +0000")); + $gametoday = gametime(); + if (gmdate("Ymd",$gametoday)!=gmdate("Ymd",$lastnewdaysemaphore)){ + //we need to run the hook, update the setting, and unlock. + savesetting("newdaySemaphore",gmdate("Y-m-d H:i:s")); + $sql = "UNLOCK TABLES"; + db_query($sql); + require("lib/newday/newday_runonce.php"); + }else{ + //someone else beat us to it, unlock. + $sql = "UNLOCK TABLES"; + db_query($sql); + } + } + + } + $args = modulehook("newday", + array("resurrection"=>$resurrection, "turnstoday"=>$turnstoday)); + $turnstoday = $args['turnstoday']; + debuglog("New Day Turns: $turnstoday"); + +} +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/news.php b/lotgd-web/lotgd/news.php new file mode 100755 index 0000000..608f313 --- /dev/null +++ b/lotgd-web/lotgd/news.php @@ -0,0 +1,145 @@ +0){ + $sql = "DELETE FROM " . db_prefix("news") . " WHERE newsdate<'".date("Y-m-d H:i:s",strtotime("-".getsetting("expirecontent",180)." days"))."'"; + //echo $sql; + db_query($sql); +} + +if ($session['user']['loggedin']) checkday(); +$newsperpage=50; + +$offset = (int)httpget('offset'); +$timestamp=strtotime((0-$offset)." days"); +$sql = "SELECT count(newsid) AS c FROM " . db_prefix("news") . " WHERE newsdate='".date("Y-m-d",$timestamp)."'"; +$result = db_query($sql); +$row = db_fetch_assoc($result); +$totaltoday=$row['c']; +$page = (int)httpget('page'); +if (!$page) $page=1; +$pageoffset = $page; +if ($pageoffset>0) $pageoffset--; +$pageoffset*=$newsperpage; +$sql = "SELECT * FROM " . db_prefix("news") . " WHERE newsdate='".date("Y-m-d",$timestamp)."' ORDER BY newsid DESC LIMIT $pageoffset,$newsperpage"; +$result = db_query($sql); +page_header("LoGD News"); +$date=date("D, M j, Y",$timestamp); + +$pagestr = ""; +if ($totaltoday > $newsperpage) { + $pagestr = sprintf_translate("(Items %s - %s of %s)", $pageoffset+1, + min($pageoffset+$newsperpage,$totaltoday), $totaltoday); +} + +$sql2 = "SELECT " . db_prefix("motd") . ".*,name AS motdauthorname FROM " . db_prefix("motd") . " LEFT JOIN " . db_prefix("accounts") . " ON " . db_prefix("accounts") . ".acctid = " . db_prefix("motd") . ".motdauthor ORDER BY motddate DESC LIMIT 1"; +$result2 = db_query_cached($sql2, "lastmotd"); +while ($row = db_fetch_assoc($result2)) { + require_once("lib/motd.php"); + require_once("lib/nltoappon.php"); + if ($row['motdauthorname']=="") + $row['motdauthorname']="`@Green Dragon Staff`0"; + if ($row['motdtype']==0){ + motditem($row['motdtitle'], $row['motdbody'],$row['motdauthorname'], $row['motddate'], ""); + }else{ + pollitem($row['motditem'], $row['motdtitle'], $row['motdbody'],$row['motdauthorname'],$row['motddate'], false); + } +} +output_notl("`n"); +output("`c`b`!News for %s %s`0`b`c", $date, $pagestr); + +while ($row = db_fetch_assoc($result)) { + output_notl("`c`2-=-`@=-=`2-=-`@=-=`2-=-`@=-=`2-=-`0`c"); + if ($session['user']['superuser'] & SU_EDIT_COMMENTS){ + $del = translate_inline("Del"); + rawoutput("[ $del ] "); + addnav("","superuser.php?op=newsdelete&newsid={$row['newsid']}&return=".URLEncode($_SERVER['REQUEST_URI'])); + } + tlschema($row['tlschema']); + if ($row['arguments']>""){ + $arguments = array(); + $base_arguments = unserialize($row['arguments']); + array_push($arguments,$row['newstext']); + while (list($key,$val)=each($base_arguments)){ + array_push($arguments,$val); + } + $news = call_user_func_array("sprintf_translate",$arguments); + rawoutput(tlbutton_clear()); + }else{ + $news = translate_inline($row['newstext']); + } + tlschema(); + output_notl($news."`n"); +} +if (db_num_rows($result)==0){ + output_notl("`c`2-=-`@=-=`2-=-`@=-=`2-=-`@=-=`2-=-`0`c"); + output("`1`b`c Nothing of note happened this day. All in all a boring day. `c`b`0"); +} +output_notl("`c`2-=-`@=-=`2-=-`@=-=`2-=-`@=-=`2-=-`0`c"); +if (!$session['user']['loggedin']) { + addnav("Login Screen", "index.php"); +} else if ($session['user']['alive']){ + villagenav(); +}else{ + tlschema("nav"); + if($session['user']['sex'] == 1) { + addnav("`!`bYou're dead, Jane!`b`0"); + } else { + addnav("`!`bYou're dead, Jim!`b`0"); + } + addnav("S?Land of Shades","shades.php"); + addnav("G?The Graveyard","graveyard.php"); + require_once("lib/extended-battle.php"); + suspend_companions("allowinshades", true); + addnav("Log out","login.php?op=logout"); + tlschema(); +} +addnav("News"); +addnav("Previous News","news.php?offset=".($offset+1)); +if ($offset>0){ + addnav("Next News","news.php?offset=".($offset-1)); +} +if ($session['user']['loggedin']) + addnav("Preferences","prefs.php"); +addnav("About this game","about.php"); + +tlschema("nav"); +if ($session['user']['superuser'] & SU_EDIT_COMMENTS){ + addnav("Superuser"); + addnav(",?Comment Moderation","moderate.php"); +} +if ($session['user']['superuser']&~SU_DOESNT_GIVE_GROTTO){ + addnav("Superuser"); + addnav("X?Superuser Grotto","superuser.php"); +} +if ($session['user']['superuser'] & SU_INFINITE_DAYS){ + addnav("Superuser"); + addnav("/?New Day","newday.php"); +} +tlschema(); + +addnav("","news.php"); +if ($totaltoday>$newsperpage){ + addnav("Today's news"); + for ($i=0;$i<$totaltoday;$i+=$newsperpage){ + $pnum = $i/$newsperpage+1; + if ($pnum == $page) { + addnav(array("`b`#Page %s`0`b", $pnum),"news.php?offset=$offset&page=$pnum"); + } else { + addnav(array("Page %s", $pnum),"news.php?offset=$offset&page=$pnum"); + } + } +} + +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/paylog.php b/lotgd-web/lotgd/paylog.php new file mode 100755 index 0000000..1a0e9bc --- /dev/null +++ b/lotgd-web/lotgd/paylog.php @@ -0,0 +1,102 @@ +='$startdate' AND processdate < '$enddate' ORDER BY payid DESC"; + $result = db_query($sql); + rawoutput(""); + $type = translate_inline("Type"); + $gross = translate_inline("Gross"); + $fee = translate_inline("Fee"); + $net = translate_inline("Net"); + $processed = translate_inline("Processed"); + $id = translate_inline("Transaction ID"); + $who = translate_inline("Who"); + rawoutput(""); + $number=db_num_rows($result); + for ($i=0;$i<$number;$i++){ + $row = db_fetch_assoc($result); + $info = unserialize($row['info']); + rawoutput(""); + } + rawoutput("
Date$id$type$gross$fee$net$processed$who
"); + output_notl(date("m/d H:i",strtotime($info['payment_date']))); + rawoutput(""); + output_notl("%s",$row['txnid']); + rawoutput(""); + output_notl("%s", $info['txn_type']); + rawoutput(""); + output_notl("%.2f %s", $info['mc_gross'], $info['mc_currency']); + rawoutput(""); + output_notl("%s", $info['mc_fee']); + rawoutput(""); + output_notl("%.2f", (float)$info['mc_gross'] - (float)$info['mc_fee']); + rawoutput(""); + output_notl("%s", translate_inline($row['processed']?"`@Yes`0":"`\$No`0")); + rawoutput(""); + if ($row['name']>"") { + rawoutput(""); + output_notl("`&%s`0 (%d/%d)", $row['name'], $row['donationspent'], + $row['donation']); + rawoutput(""); + addnav("","user.php?op=edit&userid={$row['acctid']}"); + }else{ + $amt = round((float)$info['mc_gross'] * 100,0); + $memo = ""; + if (isset($info['memo'])) { + $memo = $info['memo']; + } + $link = "donators.php?op=add1&name=".rawurlencode($memo)."&amt=$amt&txnid={$row['txnid']}"; + rawoutput("-=( [".htmlentities($memo, ENT_COMPAT, getsetting("charset", "ISO-8859-1"))."] )=-"); + addnav("",$link); + } + rawoutput("
"); + addnav("Refresh","paylog.php"); +} +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/payment.php b/lotgd-web/lotgd/payment.php new file mode 100755 index 0000000..19a3838 --- /dev/null +++ b/lotgd-web/lotgd/payment.php @@ -0,0 +1,204 @@ + $value) { + $value = urlencode(stripslashes($value)); + $req .= "&$key=$value"; +} + +// post back to PayPal system to validate +$header = ""; +$header .= "POST /cgi-bin/webscr HTTP/1.1\r\n"; +$header .= "Content-Length: " . strlen($req) . "\r\n"; +$header .= "Content-Type: application/x-www-form-urlencoded\r\n"; +$header .= "Host: www.paypal.com\r\n"; +$header .= "Connection: close\r\n\r\n"; +$fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30); + +// assign posted variables to local variables +$item_name = httppost('item_name'); +$item_number = httppost('item_number'); +$payment_status = httppost('payment_status'); +$payment_amount = httppost('mc_gross'); +$payment_currency = httppost('mc_currency'); +$txn_id = httppost('txn_id'); +$receiver_email = httppost('receiver_email'); +$payer_email = httppost('payer_email'); +$payment_fee = httppost('mc_fee'); + +$response=''; +if (!$fp) { + // HTTP ERROR + payment_error(E_ERROR,"Unable to open socket to verify payment",__FILE__,__LINE__); +} else { + fputs ($fp, $header . $req); + while (!feof($fp)) { + $res = fgets ($fp, 1024); + $response .= $res; + + if (strcmp (trim($res), "VERIFIED") == 0) { + // check the payment_status is Completed + // check that txn_id has not been previously processed + // check that receiver_email is your Primary PayPal email + // check that payment_amount/payment_currency are correct + // process payment + if ($payment_status=="Completed" || $payment_status == 'Refunded'){ + if ($payment_status == 'Refunded'){ + //sanitize the data to look like a completed transaction + $payment_amount = $mc_gross; + $payment_fee = 0; + $txn_type = 'refund'; + } + $sql = "SELECT * FROM " . db_prefix("paylog") . " WHERE txnid='{$txn_id}'"; + $result = db_query($sql); + if (db_num_rows($result)==1){ + $emsg .= "Already logged this transaction ID ($txn_id)\n"; + payment_error(E_ERROR,$emsg,__FILE__,__LINE__); + } + if (($receiver_email != "logd@mightye.org") && + ($receiver_email != getsetting("paypalemail", ""))) { + $emsg = "This payment isn't to me! It's to $receiver_email.\n"; + payment_error(E_WARNING,$emsg,__FILE__,__LINE__); + } + writelog($response); + + }else{ + payment_error(E_ERROR,"Payment Status isn't 'Completed' it's '$payment_status'",__FILE__,__LINE__); + } + } + else if (strcmp (trim($res), "INVALID") == 0) { + // log for manual investigation + payment_error(E_ERROR,"Payment Status is 'INVALID'!\n\nPOST data:`n".serialize($_POST),__FILE__,__LINE__); + } + } + fclose ($fp); +} + +function writelog($response){ + global $post; + global $item_name, $item_number, $payment_status, $payment_amount; + global $payment_currency, $txn_id, $receiver_email, $payer_email; + global $payment_fee,$txn_type; + $match = array(); + preg_match("'([^:]*):([^/])*'",$item_number,$match); + if ($match[1]>""){ + $match[1] = addslashes($match[1]); + $sql = "SELECT acctid FROM " . db_prefix("accounts") . " WHERE login='{$match[1]}'"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + $acctid = $row['acctid']; + if ($acctid>0){ + $donation = $payment_amount; + // if it's a reversal, it'll only post back to us the amount + // we received back, with out counting the fees, which we + // receive under a different transaction, but get no + // notification for. + if ($txn_type =="reversal") $donation -= $payment_fee; + + $hookresult = modulehook("donation_adjustments",array("points"=>$donation*100,"amount"=>$donation,"acctid"=>$acctid,"messages"=>array())); + $hookresult['points'] = round($hookresult['points']); + + $sql = "UPDATE " . db_prefix("accounts") . " SET donation = donation + '{$hookresult['points']}' WHERE acctid=$acctid"; + + $result = db_query($sql); + debuglog("Received donator points for donating -- Credited Automatically",false,$acctid,"donation",$hookresult['points'],false); + if (!is_array($hookresult['messages'])){ + $hookresult['messages'] = array($hookresult['messages']); + } + foreach ($hookresult['messages'] as $id=>$message){ + debuglog($message,false,$acctid,"donation",0,false); + } + if (db_affected_rows()>0) $processed = 1; + modulehook("donation", array("id"=>$acctid, "amt"=>$donation*100, "manual"=>false)); + } + } + $sql = " + INSERT INTO " . db_prefix("paylog") . " ( + info, + response, + txnid, + amount, + name, + acctid, + processed, + filed, + txfee, + processdate + )VALUES ( + '".addslashes(serialize($post))."', + '".addslashes($response)."', + '$txn_id', + '$payment_amount', + '{$match[1]}', + ".(int)$acctid.", + ".(int)$processed.", + 0, + '$payment_fee', + '".date("Y-m-d H:i:s")."' + )"; + db_query($sql); + $err = db_error(); + if ($err) { + payment_error(E_ERROR,"SQL: $sql\nERR: $err", __FILE__,__LINE__); + } +} + +function payment_error($errno, $errstr, $errfile, $errline){ + global $payment_errors; + if (!is_int($errno) || (is_int($errno) && ($errno & error_reporting()))) { + $payment_errors.="Error $errno: $errstr in $errfile on $errline\n"; + } +} + +$adminEmail = getsetting("gameadminemail", "postmaster@localhost.com"); +if ($payment_errors>"") { + $subj = translate_mail("Payment Error",0); + // $payment_errors not translated + ob_start(); + echo "GET:
";
+	reset($_GET);
+	var_dump($_GET);
+	echo "
POST:
";
+	reset($_POST);
+	var_dump($_POST);
+	echo "
SERVER:
";
+	reset($_SERVER);
+	var_dump($_SERVER);
+	echo "
"; + $contents = ob_get_contents(); + ob_end_clean(); + $payment_errors .= "
".$contents; + + mail($adminEmail,$subj,$payment_errors."
","From: " . getsetting("gameadminemail", "postmaster@localhost.com")); +} +$output = ob_get_contents(); +if ($output > ""){ + if ($adminEmail == "") $adminEmail = "trash@mightye.org"; + echo "GET:
";
+	reset($_GET);
+	var_dump($_GET);
+	echo "
POST:
";
+	reset($_POST);
+	var_dump($_POST);
+	echo "
SERVER:
";
+	reset($_SERVER);
+	var_dump($_SERVER);
+	echo "
"; + mail($adminEmail,"Serious LoGD Payment Problems on {$_SERVER['HTTP_HOST']}",ob_get_contents(),"Content-Type: text/html"); +} +ob_end_clean(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/petition.php b/lotgd-web/lotgd/petition.php new file mode 100755 index 0000000..d15afa9 --- /dev/null +++ b/lotgd-web/lotgd/petition.php @@ -0,0 +1,23 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/prefs.php b/lotgd-web/lotgd/prefs.php new file mode 100755 index 0000000..6c243c7 --- /dev/null +++ b/lotgd-web/lotgd/prefs.php @@ -0,0 +1,322 @@ + "") { + setcookie("template",$skin,strtotime("+45 days")); + $_COOKIE['template']=$skin; +} + +require_once("lib/villagenav.php"); +require_once("common.php"); + +tlschema("prefs"); + +require_once("lib/is_email.php"); +require_once("lib/showform.php"); +require_once("lib/sanitize.php"); + +page_header("Preferences"); + +$op = httpget('op'); + +if ($op=="suicide" && getsetting("selfdelete",0)!=0) { + $userid = httpget('userid'); + require_once("lib/charcleanup.php"); + char_cleanup($userid, CHAR_DELETE_SUICIDE); + $sql = "DELETE FROM " . db_prefix("accounts") . " WHERE acctid='$userid'"; + db_query($sql); + output("Your character has been deleted!"); + addnews("`#%s quietly passed from this world.",$session['user']['name']); + addnav("Login Page", "index.php"); + $session=array(); + $session['user'] = array(); + $session['loggedin'] = false; + $session['user']['loggedin'] = false; + invalidatedatacache("charlisthomepage"); + invalidatedatacache("list.php-warsonline"); +} else { + + checkday(); + if ($session['user']['alive']){ + villagenav(); + }else{ + addnav("Return to the news","news.php"); + } + + + $oldvalues = stripslashes(httppost('oldvalues')); + $oldvalues = unserialize($oldvalues); + + $post = httpallpost(); + unset($post['oldvalues']); + + if (count($post)==0){ + }else{ + $pass1 = httppost('pass1'); + $pass2 = httppost('pass2'); + if ($pass1!=$pass2){ + output("`#Your passwords do not match.`n"); + }else{ + if ($pass1!=""){ + if (strlen($pass1)>3){ + if (substr($pass1,0,5)!="!md5!"){ + $pass1 = md5(md5($pass1)); + }else{ + $pass1 = md5(substr($pass1,5)); + } + $session['user']['password']=$pass1; + output("`#Your password has been changed.`n"); + }else{ + output("`#Your password is too short."); + output("It must be at least 4 characters.`n"); + } + } + } + reset($post); + $nonsettings = array( + "pass1"=>1, + "pass2"=>1, + "email"=>1, + "template"=>1, + "bio"=>1 + ); + foreach($post as $key=>$val){ + // If this is one we don't save, skip + if (isset($nonsettings[$key]) && $nonsettings[$key]) continue; + if (isset($oldvalues[$key]) && + stripslashes($val) == $oldvalues[$key]) continue; + // If this is a module userpref handle and skip + debug("Setting $key to $val"); + if (strstr($key, "___")) { + if (strpos($key, 'user_') === false && strpos($key, 'check_') === false) { + continue; + } + $val = httppost($key); + $x = explode("___", $key); + $module = $x[0]; + $key = $x[1]; + modulehook("notifyuserprefchange", + array("name"=>$key, + "old"=>$oldvalues[$module."___".$key], + "new"=>$val)); + set_module_pref($key, $val, $module); + continue; + } + $session['user']['prefs'][$key]=httppost($key); + } + $bio = stripslashes(httppost('bio')); + $bio = comment_sanitize($bio); + if ($bio!=comment_sanitize($session['user']['bio'])){ + if ($session['user']['biotime']>"9000-01-01") { + output("`\$You cannot modify your bio."); + output("It has been blocked by the administrators!`0`n"); + }else{ + $session['user']['bio']=$bio; + $session['user']['biotime']=date("Y-m-d H:i:s"); + } + } + $email = httppost('email'); + if ($email!=$session['user']['emailaddress']){ + if (is_email($email)){ + if (getsetting("requirevalidemail",0)==1){ + output("`#Your email cannot be changed, system settings prohibit it."); + output("(Emails may only be changed if the server allows more than one account per email.)"); + output("Use the Petition link to ask the server administrator to change your email address if this one is no longer valid.`n"); + }else{ + output("`#Your email address has been changed.`n"); + $session['user']['emailaddress']=$email; + } + }else{ + if (getsetting("requireemail",0)==1){ + output("`#That is not a valid email address.`n"); + }else{ + output("`#Your email address has been changed.`n"); + $session['user']['emailaddress']=$email; + } + } + } + output("Settings Saved"); + } + + if (!isset($session['user']['prefs']['timeformat'])) $session['user']['prefs']['timeformat'] = "[m/d h:ia]"; + + $form=array( + "Account Preferences,title", + "pass1"=>"Password,password", + "pass2"=>"Retype,password", + "email"=>"Email Address", + "Display Preferences,title", + "template"=>"Skin,theme", + "language"=>"Language,enum,".getsetting("serverlanguages","en,English,de,Deutsch,fr,Français,dk,Danish,es,Español,it,Italian"), + "tabconfig"=>"Show config sections in tabs,bool", + "Game Behavior Preferences,title", + "emailonmail"=>"Send email when you get new Ye Olde Mail?,bool", + "systemmail"=>"Send email for system generated messages?,bool", + "dirtyemail"=>"Allow profanity in received Ye Olde Poste messages?,bool", + "timestamp"=>"Show timestamps in commentary?,enum,0,None,1,Real Time [12/25 1:27pm],2,Relative Time (1h35m)", + "timeformat"=>array("Timestamp format (currently displaying time as %s whereas default format is \"[m/d h:ia]\"),string,20", + date($session['user']['prefs']['timeformat'], + strtotime("now") + ($session['user']['prefs']['timeoffset'] * 60 * 60))), + "timeoffset"=>array("Hours to offset time displays (%s currently displays as %s)?,int", + date($session['user']['prefs']['timeformat']), + date($session['user']['prefs']['timeformat'], + strtotime("now") + ($session['user']['prefs']['timeoffset'] * 60 * 60))), + "ihavenocheer"=>"`0Always disable all holiday related text replacements (such as a`1`0l`1`0e => e`1`0g`1`0g n`1`0o`1`0g for December),bool", + "bio"=>"Short Character Biography (255 chars max),string,255", + "nojump"=>"Don't jump to comment areas after refreshing or posting a comment?,bool", + ); + rawoutput(""); + $warn = translate_inline("Your password is too short. It must be at least 4 characters long."); + rawoutput(""); + // + $prefs = $session['user']['prefs']; + $prefs['bio'] = $session['user']['bio']; + $prefs['template'] = $_COOKIE['template']; + if ($prefs['template'] == "") + $prefs['template'] = getsetting("defaultskin", "jade.htm"); + $prefs['email'] = $session['user']['emailaddress']; + // Default tabbed config to true + if (!isset($prefs['tabconfig'])) $prefs['tabconfig'] = 1; + + // Okay, allow modules to add prefs one at a time. + // We are going to do it this way to *ensure* that modules don't conflict + // in namespace. + $sql = "SELECT modulename FROM " . db_prefix("modules") . " WHERE infokeys LIKE '%|prefs|%' AND active=1 ORDER BY modulename"; + $result = db_query($sql); + $everfound = 0; + $foundmodules = array(); + $msettings = array(); + $mdata = array(); + while ($row = db_fetch_assoc($result)) { + $module = $row['modulename']; + $info = get_module_info($module); + if (count($info['prefs']) <= 0) continue; + $tempsettings = array(); + $tempdata = array(); + $found = 0; + while (list($key, $val) = each($info['prefs'])) { + $isuser = preg_match("/^user_/", $key); + $ischeck = preg_match("/^check_/", $key); + + if (is_array($val)) { + $v = $val[0]; + $x = explode("|", $v); + $val[0] = $x[0]; + $x[0] = $val; + } else { + $x = explode("|", $val); + } + + if(is_array($x[0])) $x[0] = call_user_func_array('sprintf', $x[0]); + //$type = split(",", $x[0]); + $type = explode(",", $x[0]); + if (isset($type[1])) $type = trim($type[1]); + else $type = "string"; + + // Okay, if we have a title section, let's copy over the last + // title section + if (strstr($type, "title")) { + if ($found) { + $everfound = 1; + $found = 0; + $msettings = array_merge($msettings, $tempsettings); + $mdata = array_merge($mdata, $tempdata); + } + $tempsettings = array(); + $tempdata = array(); + } + + if (!$isuser && !$ischeck && !strstr($type,"title") && + !strstr($type, "note")) + continue; + if ($isuser) { + $found = 1; + } + // If this is a check preference, we need to call the modulehook + // checkuserpref (requested by cortalUX) + if ($ischeck) { + $args = modulehook("checkuserpref", + array("name"=>$key, "pref"=>$x[0], "default"=>$x[1]), + false, $module); + if (isset($args['allow']) && !$args['allow']) continue; + $x[0] = $args['pref']; + $x[1] = $args['default']; + $found = 1; + } + + $tempsettings[$module."___".$key] = $x[0]; + if (array_key_exists(1, $x)) { + $tempdata[$module."___".$key] = $x[1]; + } + } + if($found) { + $msettings = array_merge($msettings, $tempsettings); + $mdata = array_merge($mdata, $tempdata); + $everfound = 1; + } + + // If we found a user editable one + if ($everfound) { + // Collect the values + $foundmodules[]=$module; + } + } + if ($foundmodules!=array()) { + $sql = "SELECT * FROM " . db_prefix("module_userprefs") . " WHERE modulename IN ('".implode("','",$foundmodules)."') AND (setting LIKE 'user_%' OR setting LIKE 'check_%') AND userid='".$session['user']['acctid']."'"; + $result1 = db_query($sql); + while($row1 = db_fetch_assoc($result1)) { + $mdata[$row1['modulename']."___".$row1['setting']] = $row1['value']; + } + } + addnav('View Bio','bio.php?char='.$session['user']['acctid'].'&ret='.urlencode($_SERVER['REQUEST_URI'])); + + $form = array_merge($form, $msettings); + $prefs = array_merge($prefs, $mdata); + rawoutput("
"); + $info = showform($form,$prefs); + rawoutput(""); + + rawoutput("

"); + addnav("","prefs.php?op=save"); + + // Stop clueless lusers from deleting their character just because a + // monster killed them. + if ($session['user']['alive'] && getsetting("selfdelete",0)!=0) { + rawoutput("
"); + $deltext = translate_inline("Delete Character"); + $conf = translate_inline("Are you sure you wish to delete your character?"); + rawoutput("
"); + rawoutput(""); + rawoutput("
"); + rawoutput("
"); + addnav("","prefs.php?op=suicide&userid={$session['user']['acctid']}"); + } +} +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/pvp.php b/lotgd-web/lotgd/pvp.php new file mode 100755 index 0000000..dbb55d8 --- /dev/null +++ b/lotgd-web/lotgd/pvp.php @@ -0,0 +1,131 @@ + '`4You head out to the fields, where you know some unwitting warriors are sleeping.`n`nYou have `^%s`4 PvP fights left for today.`n`n', + 'schemas'=>array('atkmsg'=>'pvp') + ); + $args = modulehook("pvpstart", $args); + tlschema($args['schemas']['atkmsg']); + output($args['atkmsg'], $session['user']['playerfights']); + tlschema(); + addnav("L?Refresh List of Warriors","pvp.php"); + pvplist(); + villagenav(); +} else if ($act == "attack") { + $name = httpget('name'); + $badguy = setup_target($name); + $options['type'] = "pvp"; + $failedattack = false; + if ($badguy === false) { + $failedattack = true; + } else { + $battle=true; + if ($badguy['location']==$iname) { + $badguy['bodyguardlevel']=$badguy['boughtroomtoday']; + } + $attackstack['enemies'][0] = $badguy; + $attackstack['options'] = $options; + $session['user']['badguy']=createstring($attackstack); + debug($session['user']['badguy']); + $session['user']['playerfights']--; + } + + if ($failedattack){ + if (httpget('inn') > ""){ + addnav("Return to Listing","inn.php?op=bartender&act=listupstairs"); + }else{ + addnav("Return to Listing","pvp.php"); + } + } +} + +if ($op=="run"){ + output("Your pride prevents you from running"); + $op="fight"; + httpset('op', $op); +} + +$skill = httpget('skill'); +if ($skill!=""){ + output("Your honor prevents you from using any special ability"); + $skill=""; + httpset('skill', $skill); +} +if ($op=="fight" || $op=="run"){ + $battle=true; +} +if ($battle){ + + require_once("battle.php"); + + if ($victory){ + $killedin = $badguy['location']; + $handled = pvpvictory($badguy, $killedin, $options); + + // Handled will be true if a module has already done the addnews or + // whatever was needed. + if (!$handled) { + if ($killedin==$iname){ + addnews("`4%s`3 defeated `4%s`3 by sneaking into their room in the inn!",$session['user']['name'],$badguy['creaturename']); + }else{ + addnews("`4%s`3 defeated `4%s`3 in fair combat in the fields of %s.", $session['user']['name'],$badguy['creaturename'], $killedin); + } + } + + $op = ""; + httpset('op', $op); + if ($killedin==$iname){ + addnav("Return to the inn","inn.php"); + } else { + villagenav(); + } + if ($session['user']['hitpoints'] <= 0) { + output("`n`n`&Using a bit of cloth nearby, you manage to staunch your wounds so that you do not die as well."); + $session['user']['hitpoints'] = 1; + } + }elseif($defeat){ + $killedin = $badguy['location']; + $taunt = select_taunt_array(); + // This is okay because system mail which is all it's used for is + // not translated + $handled = pvpdefeat($badguy, $killedin, $taunt, $options); + // Handled will be true if a module has already done the addnews or + // whatever was needed. + if (!$handled) { + if ($killedin == $iname) { + addnews("`%%s`5 has been slain while breaking into the inn room of `^%s`5 in order to attack them.`n%s`0", $session['user']['name'], $badguy['creaturename'], $taunt); + }else { + addnews("`%%s`5 has been slain while attacking `^%s`5 in the fields of `&%s`5.`n%s`0", $session['user']['name'], $badguy['creaturename'], $killedin, $taunt); + } + } + }else{ + $extra = ""; + if (httpget('inn')) $extra = "?inn=1"; + fightnav(false,false, "pvp.php$extra"); + } +} +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/rawsql.php b/lotgd-web/lotgd/rawsql.php new file mode 100755 index 0000000..96a7f9a --- /dev/null +++ b/lotgd-web/lotgd/rawsql.php @@ -0,0 +1,90 @@ +$sql)); + debuglog('Ran Raw SQL: ' . $sql); + $r = db_query($sql, false); + if (!$r) { + output("`\$SQL Error:`& %s`0`n`n",db_error($r)); + } else { + if (db_affected_rows() > 0) { + output("`&%s rows affected.`n`n",db_affected_rows()); + } + rawoutput(""); + $number = db_num_rows($r); + for ($i = 0; $i < $number; $i++) { + $row = db_fetch_assoc($r); + if ($i == 0) { + rawoutput(""); + $keys = array_keys($row); + foreach ($keys as $value) { + rawoutput(""); + } + rawoutput(""); + } + rawoutput(""); + foreach ($keys as $value) { + rawoutput(""); + } + rawoutput(""); + } + rawoutput("
$value
{$row[$value]}
"); + } + } + + output("Type your query"); + $execute = translate_inline("Execute"); + $ret = modulehook("rawsql-modsql",array("sql"=>$sql)); + $sql = $ret['sql']; + rawoutput("
"); + rawoutput("
"); + rawoutput(""); + rawoutput("
"); + addnav("", "rawsql.php"); +}else{ + $php = stripslashes(httppost("php")); + $source = translate_inline("Source:"); + $execute = translate_inline("Execute"); + if ($php>""){ + rawoutput("
$source
"); + rawoutput(highlight_string("",true)); + rawoutput("
"); + output("`bResults:`b`n"); + modulehook("rawsql-execphp",array("php"=>$php)); + ob_start(); + eval($php); + output_notl(ob_get_contents(),true); + ob_end_clean(); + debuglog('Ran Raw PHP: ' . $php); + } + output("`n`nType your code:"); + $ret = modulehook("rawsql-modphp",array("php"=>$php)); + $php = $ret['php']; + rawoutput("
"); + rawoutput("<?php

?>
"); + rawoutput(""); + rawoutput("
"); + addnav("", "rawsql.php?op=php"); +} +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/referers.php b/lotgd-web/lotgd/referers.php new file mode 100755 index 0000000..a3357f3 --- /dev/null +++ b/lotgd-web/lotgd/referers.php @@ -0,0 +1,107 @@ + 0) $sql = "DELETE FROM " . db_prefix("referers") . " WHERE last<'".date("Y-m-d H:i:s",strtotime("-".$expire." days"))."'"; +db_query($sql); +$op = httpget('op'); + +if ($op=="rebuild"){ + $sql = "SELECT * FROM " . db_prefix("referers"); + $result = db_query($sql); + $number=db_num_rows($result); + for ($i=0;$i<$number;$i++){ + $row = db_fetch_assoc($result); + $site = str_replace("http://","",$row['uri']); + if (strpos($site,"/")) $site = substr($site,0,strpos($site,"/")); + $sql = "UPDATE " . db_prefix("referers") . " SET site='".addslashes($site)."' WHERE refererid='{$row['refererid']}'"; + db_query($sql); + } +} +require_once("lib/superusernav.php"); +superusernav(); +addnav("Referer Options"); +addnav("",$_SERVER['REQUEST_URI']); +$sort = httpget('sort'); +addnav("Refresh","referers.php?sort=".URLEncode($sort).""); +addnav("C?Sort by Count","referers.php?sort=count".($sort=="count DESC"?"":"+DESC")); +addnav("U?Sort by URL","referers.php?sort=uri".($sort=="uri"?"+DESC":"")); +addnav("T?Sort by Time","referers.php?sort=last".($sort=="last DESC"?"":"+DESC")); + +addnav("Rebuild Sites","referers.php?op=rebuild"); + +page_header("Referers"); +$order = "count DESC"; +if ($sort!="") $order=$sort; +$sql = "SELECT SUM(count) AS count, MAX(last) AS last,site FROM " . db_prefix("referers") . " GROUP BY site ORDER BY $order LIMIT 100"; +$count = translate_inline("Count"); +$last = translate_inline("Last"); +$dest = translate_inline("Destination"); +$none = translate_inline("`iNone`i"); +$notset = translate_inline("`iNot set`i"); +$skipped = translate_inline("`i%s records skipped (over a week old)`i"); +rawoutput(""); +$result = db_query($sql); +$number=db_num_rows($result); +for ($i=0;$i<$number;$i++){ + $row = db_fetch_assoc($result); + + rawoutput(""); + + $sql = "SELECT count,last,uri,dest,ip FROM " . db_prefix("referers") . " WHERE site='".addslashes($row['site'])."' ORDER BY {$order} LIMIT 25"; + $result1 = db_query($sql); + $skippedcount=0; + $skippedtotal=0; + $number=db_num_rows($result1); + for ($k=0;$k<$number;$k++){ + $row1=db_fetch_assoc($result1); + $diffsecs = strtotime("now")-strtotime($row1['last']); + if ($diffsecs<=604800){ + rawoutput(""); + }else{ + $skippedcount++; + $skippedtotal+=$row1['count']; + } + } + if ($skippedcount>0){ + rawoutput(""); + } + //output("",true); +} +rawoutput("
$count$lastURL$destIP
"); + output_notl("`b".$row['count']."`b"); + rawoutput(""); + $diffsecs = strtotime("now")-strtotime($row['last']); + //output((int)($diffsecs/86400)."d ".(int)($diffsecs/3600%3600)."h ".(int)($diffsecs/60%60)."m ".(int)($diffsecs%60)."s"); + output_notl("`b".dhms($diffsecs)."`b"); + rawoutput(""); + output_notl("`b".($row['site']==""?$none:$row['site'])."`b"); + rawoutput("
"); + output_notl($row1['count']); + rawoutput(""); + //output((int)($diffsecs/86400)."d".(int)($diffsecs/3600%3600)."h".(int)($diffsecs/60%60)."m".(int)($diffsecs%60)."s"); + output_notl(dhms($diffsecs)); + rawoutput(""); + if ($row1['uri']>"") + rawoutput("".HTMLEntities(substr($row1['uri'],0,100)).""); + else + output_notl($none); + output_notl("`n"); + rawoutput(""); + output_notl($row1['dest']==''?$notset:$row1['dest']); + rawoutput(""); + output_notl($row1['ip']==''?$notset:$row1['ip']); + rawoutput("
$skippedtotal"); + output_notl(sprintf($skipped,$skippedcount)); + rawoutput("
"); +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/referral.php b/lotgd-web/lotgd/referral.php new file mode 100755 index 0000000..f30ff8a --- /dev/null +++ b/lotgd-web/lotgd/referral.php @@ -0,0 +1,72 @@ +$name$level$awarded"); + $number=db_num_rows($result); + for ($i=0;$i<$number;$i++){ + $row = db_fetch_assoc($result); + rawoutput(""); + output_notl($row['name']); + rawoutput(""); + output_notl($row['level']); + rawoutput(""); + output_notl($row['refererawarded']?$yes:$no); + rawoutput(""); + } + if (db_num_rows($result)==0){ + rawoutput(""); + output_notl($none); + rawoutput(""); + } + rawoutput("",true); + page_footer(); +}else{ + page_header("Welcome to Legend of the Green Dragon"); + output("`@Legend of the Green Dragon is a remake of the classic BBS Door Game Legend of the Red Dragon."); + output("Adventure into the classic realm that was one of the world's very first multiplayer roleplaying games!"); + addnav("Create a character","create.php?r=".HTMLEntities(httpget('r'), ENT_COMPAT, getsetting("charset", "ISO-8859-1"))); + addnav("Login Page","index.php"); + page_footer(); +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/rock.php b/lotgd-web/lotgd/rock.php new file mode 100755 index 0000000..5522969 --- /dev/null +++ b/lotgd-web/lotgd/rock.php @@ -0,0 +1,43 @@ +0 || + $session['user']['superuser'] & SU_EDIT_COMMENTS){ + addcommentary(); +} + +checkday(); +if ($session['user']['dragonkills']>0 || + $session['user']['superuser'] & SU_EDIT_COMMENTS){ + page_header("The Veteran's Club"); + + output("`b`c`2The Veteran's Club`0`c`b"); + + output("`n`n`4Something in you compels you to examine the curious rock. Some dark magic, locked up in age old horrors.`n`n"); + output("When you arrive at the rock, an old scar on your arm begins to throb in succession with a mysterious light that now seems to come from the rock. "); + output("As you stare at it, the rock shimmers, shaking off an illusion. You realize that this is more than a rock. "); + output("It is, in fact, a doorway, and over the threshold you see others bearing an identical scar to yours. "); + output("It somehow reminds you of the head of one of the great serpents from legend.`n`n"); + output("You have discovered The Veteran's Club.`n`n"); + + modulehook("rock"); + + commentdisplay("", "veterans","Boast here",30,"boasts"); +}else{ + page_header("Curious looking rock"); + output("You approach the curious looking rock. "); + output("After staring and looking at it for a little while, it continues to look just like a curious looking rock.`n`n"); + output("Bored, you decide to leave the rock alone."); +} +villagenav(); + +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/runmodule.php b/lotgd-web/lotgd/runmodule.php new file mode 100755 index 0000000..f1769a2 --- /dev/null +++ b/lotgd-web/lotgd/runmodule.php @@ -0,0 +1,53 @@ += 1.00 && ($session['user']['superuser'] & SU_DEBUG_OUTPUT))){ + debug("Slow Module (".round($endtime-$starttime,2)."s): $mostrecentmodule`n"); + } + tlschema(); +}else{ + do_forced_nav(false,false); + + tlschema("badnav"); + + page_header("Error"); + if ($session['user']['loggedin']){ + villagenav(); + }else{ + addnav("L?Return to the Login","index.php"); + } + output("You are attempting to use a module which is no longer active, or has been uninstalled."); + page_footer(); +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/shades.php b/lotgd-web/lotgd/shades.php new file mode 100755 index 0000000..d924c2a --- /dev/null +++ b/lotgd-web/lotgd/shades.php @@ -0,0 +1,55 @@ + \ No newline at end of file diff --git a/lotgd-web/lotgd/source.php b/lotgd-web/lotgd/source.php new file mode 100755 index 0000000..ae7138e --- /dev/null +++ b/lotgd-web/lotgd/source.php @@ -0,0 +1,200 @@ +DragonPrime.", true); + output("You may then work with that code within the restrictions of its license."); + output("`n`nHopefully this will help put an end to actions like the following:"); + rawoutput("
  • "); + output("Releasing code which they do not own without permission."); + rawoutput("
  • "); + output("Removing valid copyright information from code and replacing it."); + rawoutput("
  • "); + output("Removing portions of the code required to be kept intact by licensing."); + rawoutput("
  • "); + output("Claiming copyright of items which they did not create."); + rawoutput("
"); + popup_footer(); +} else { + $legal_start_dirs = array( + "" => 1, + "lib/*" => 1, + "modules/*" => 1, + "modules/avatar" => 0, // No PHP files, so don't show + ); + if ($url) { + $dirname = dirname($url); + foreach ($legal_start_dirs as $dirs=>$value) { + if (strpos($dirs,"/") === false || !$value) { + continue; + } + if (strpos($dirs,"/*")) { + $ghjkl = str_replace("/*","",$dirs); + $dirname = preg_replace("!".$ghjkl."/?\\w*/?!","",$dirname); + }else { + $ghjkl = str_replace("/","",$dirs); + $dirname = preg_replace("!".$ghjkl."/?!","",$dirname); + } + } + $dirname = preg_replace("/\\A\\./","",$dirname); + $length = strlen($dirname); + $url = substr($url,$length); + if (strpos($url,"/") === 0) { + $url = substr($url,1); + } + } + $select_dir = httpget("dir"); + if (!$select_dir) { + $select_dir = ""; + } + $select_dir = "./$select_dir"; + $illegal_files = array( + "dbconnect.php"=>"Contains sensitive information specific to this installation.", + "dragon.php"=>"If you want to read the dragon script, I suggest you do so by defeating it!", + "output_translator.php"=>"X", // hidden + "pavilion.php"=>"Not released at least for now.", + "source.php"=>"X", //hide completely -- so that people can't see the names of the other completely hidden files. + "remotebackup.php"=>"X", // hide completely + "remotequery.php"=>"X", // hide completely + "lib/datatable.php"=>"X", // hide completely + "lib/dbremote.php"=>"X", //hide completely + "lib/smsnotify.php"=>"X", //hide completely + "modules/battlearena.php"=>"X", // not for dist + "modules/blog.php"=>"X", // not for dist + "modules/clues.php"=>"X", // hidden + "modules/lycanthropy.php"=>"X", // hidden + "modules/mutagens.php"=>"X", // hidden + "modules/privacy.php"=>"X", // hidden + "modules/store.php"=>"X", // not for dist + "modules/tournament.php"=>"X", // hide + ); + $legal_files=array(); + + rawoutput("

"); + output("View Source: "); + output_notl("%s", htmlentities($url, ENT_COMPAT, getsetting("charset", "ISO-8859-1"))); + rawoutput("

"); + if($url) output("Click here for the source, OR`n", true); + output("`bOther files that you may wish to view the source of:`b"); + rawoutput("
    "); + // Gather all the legal dirs + $legal_dirs = array(); + foreach ($legal_start_dirs as $dir=>$value) { + // If this is a dir to exclude, skip it + if (!$value) continue; + + $sdir = $dir; + $base = "./$sdir"; + + // If this is not a 'recursive' dir, add it and continue + if (!strstr($base, "/*")) { + array_push($legal_dirs, $base); + continue; + } + + // Strip of the /* + $base = substr($base, 0, -2); + array_push($legal_dirs, $base . "/"); + $d = dir("$base"); + while($entry = $d->read()) { + // Skip any . files + if ($entry[0] == '.') continue; + // skip any php files + if (substr($entry,strrpos($entry, '.')) == ".php") continue; + $ndir = $base . "/" . $entry; + // Okay, check if it's a directory + $test = preg_replace("!^\\./!", "", $ndir); + if (is_dir($ndir)) { + if ((!isset($legal_start_dirs[$test]) || + $legal_start_dirs[$test] != 0) && ((strpos(strtolower($select_dir),strtolower($ndir)) !== false) || (strpos(strtolower($ndir),strtolower($select_dir)) !== false)) && $select_dir != "./") { + array_push($legal_dirs, $ndir . "/"); + } + } + } + } + foreach ($legal_dirs as $key) { + //$skey = substr($key,strlen($subdir)); + //if ($key==dirname($_SERVER['SCRIPT_NAME'])) $skey=""; + //$d = dir("./$skey"); + //if (substr($key,0,2)=="//") $key = substr($key,1); + //if ($key=="//") $key="/"; + // Gaurentee a sort order on source files - Hidehisa Yasuda + $key1 = substr($key, 2); + $key2 = $key1; + $skey = "//" . $key1; + if ($key != $select_dir) { + rawoutput("
  • Folder: ".($key1==""?"/":$key1)."
  • \n"); + continue; + } + + $d = dir("$key"); + $files = array(); + while (false !== ($entry = $d->read())) { + if (substr($entry,strrpos($entry,"."))==".php"){ + array_push($files, "$entry"); + } + } + $d->close(); + asort($files); + foreach($files as $entry) { + if (isset($illegal_files["$key2$entry"]) && + $illegal_files["$key2$entry"]!=""){ + if ($illegal_files["$key2$entry"]=="X"){ + //we're hiding the file completely. + }else{ + rawoutput("
  • $key1$entry"); + $reason = translate_inline($illegal_files[$key2 . $entry]); + output("— This file cannot be viewed: %s", $reason, true); + rawoutput("
  • \n"); + } + }else{ + rawoutput("
  • $key1$entry — ".date("Y-m-d H:i:s",filemtime($key."/".$entry))."
  • \n"); + $legal_files["$key1$entry"]=true; + } + } + } + rawoutput("
"); + if ($url) { + rawoutput("

"); + output("Source of: %s", htmlentities($url, ENT_COMPAT, getsetting("charset", "ISO-8859-1"))); + rawoutput("

"); + + $page_name = $url; + if (substr($page_name,0,1)=="/") $page_name=substr($page_name,1); + if ($legal_files[$url]){ + rawoutput(""); + rawoutput("
"); + rawoutput(""); + ob_start(); + show_source($page_name); + $t = ob_get_contents(); + ob_end_clean(); + rawoutput($t); + rawoutput("", true); + rawoutput("
", true); + }else if ($illegal_files[$url]!="" && $illegal_files[$url]!="X"){ + $reason = translate_inline($illegal_files[$url]); + output("`nCannot view this file: %s`n", $reason); + }else { + output("`nCannot view this file.`n"); + } + } + popup_footer(); +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/stables.php b/lotgd-web/lotgd/stables.php new file mode 100755 index 0000000..35493cd --- /dev/null +++ b/lotgd-web/lotgd/stables.php @@ -0,0 +1,300 @@ +"Merick's Stables", + "desc"=>array( + "`7Behind the inn, and a little to the left of Ye Olde Bank, is as fine a stable as one might expect to find in any village. ", + "In it, Merick, a burly looking dwarf tends to various beasts.`n`n", + array("You approach, and he whirls around, pointing a pitchfork in your general direction, \"`&Ach, sorry m'%s, I dinnae hear ya' comin' up on me, an' I thoht fer sure ye were %s`&; he what been tryin' to improve on his dwarf tossin' skills. ",translate_inline($session['user']['sex']?'lass':'lad'),getsetting('barkeep','`tCedrik')), + "Naahw, wha' can oye do fer ya?`7\" he asks.", + ), + "nosuchbeast"=>"`7\"`&Ach, thar dinnae be any such beestie here!`7\" shouts the dwarf!", + "finebeast"=>array( + "`7\"`&Aye, tha' be a foyne beastie indeed!`7\" comments the dwarf.`n`n", + "`7\"`&Ye cert'nly have an oye fer quality!`7\" exclaims the dwarf.`n`n", + "`7\"`&Och, this beastie will serve ye well indeed,`7\" says the dwarf.`n`n", + "`7\"`&That beastie be one o' me finest!`7\" says the dwarf with pride.`n`n", + "`7\"`&Ye couldnae hae made a foyner choice o' beasts!`7\" says the dwarf with pride.`n`n" + ), + "toolittle"=>"`7Merick looks at you sorta sideways. \"`&'Ere, whadday ya think yeer doin'? Cannae ye see that %s`& costs `^%s`& gold an' `%%s`& gems?`7\"", + "replacemount"=>"`7You hand over the reins to %s`7 and the purchase price of your new critter, and Merick leads out a fine new `&%s`7 for you!`n`n", + "newmount"=>"`7You hand over the purchase price of your new critter, and Merick leads out a fine `&%s`7 for you!`n`n", + "nofeed"=>"`7\"`&Ach, m'%s, what dae ye think this is, a hostelry? I cannae feed yer critter here!`7\"`nMerick thumps you on the back good naturedly, and sends you on your way.", + "nothungry"=>"%s`7 isn't hungry. Merick hands your gold back.", + "halfhungry"=>"%s`7 pinches a bit of the given food and leaves the rest alone. %s`7 is fully restored. Because there is still more than half of the food left, Merick gives you 50%% discount.`nYou only pay %s gold.", + "hungry"=>"%s`7 eats all the food greedily.`n%s`7 is fully restored and you give your %s gold to Merick.", + "mountfull"=>"`n`7\"`&Aye, there ye go %s, yer %s`& be full o' foyne grub. I willnae be able t' feed 'em again 'til the morrow though. Well, enjoy ye day!`7\"`nMerick whistles a jaunty tune and heads back to work.", + "nofeedgold"=>"`7You don't have enough gold with you to pay for the food. Merick refuses to feed your creature and advises you to look for somewhere else to let %s`7 graze for free, such as in the `@Forest`7.", + "confirmsale"=>"`n`n`7Merick whistles. \"`&Yer mount shure is a foyne one, %s. Are ye sure ye wish t' part wae it?`7\"`n`nHe waits for your answer.`0", + "mountsold"=>"`7As sad as it is to do so, you give up your precious %s`7, and a lone tear escapes your eye.`n`nHowever, the moment you spot the %s, you find that you're feeling quite a bit better.", + "offer"=>"`n`n`&Merick offers you `^%s`& gold and `%%s`& gems for %s`7.", + "lass"=>"lass", + "lad"=>"lad", +); +$schemas = array( + 'title'=>'stables', + 'desc'=>'stables', + 'nosuchbeast'=>'stables', + 'finebeast'=>'stables', + 'toolittle'=>'stables', + 'replacemount'=>'stables', + 'newmount'=>'stables', + 'nofeed'=>'stables', + 'nothungry'=>'stables', + 'halfhungry'=>'stables', + 'hungry'=>'stables', + 'mountfull'=>'stables', + 'nofeedgold'=>'stables', + 'confirmsale'=>'stables', + 'mountsold'=>'stables', + 'offer'=>'stables', +); +$basetext['schemas']=$schemas; +$texts = modulehook("stabletext", $basetext); +$schemas = $texts['schemas']; + +tlschema($schemas['title']); +page_header($texts['title']); +tlschema(); + +addnav("Other"); +villagenav(); +modulehook("stables-nav"); + +require_once("lib/mountname.php"); +list($name, $lcname) = getmountname(); + +$repaygold = 0; +$repaygems = 0; +$grubprice = 0; + +if ($playermount) { + $repaygold = round($playermount['mountcostgold']*2/3,0); + $repaygems = round($playermount['mountcostgems']*2/3,0); + $grubprice = round($session['user']['level']*$playermount['mountfeedcost'], 0); +} +$confirm = 0; + +$op = httpget('op'); +$id = httpget('id'); + +global $playermount; + +if ($op==""){ + checkday(); + tlschema($schemas['desc']); + if (is_array($texts['desc'])) { + foreach ($texts['desc'] as $description) { + output_notl(sprintf_translate($description)); + } + } else { + output($texts['desc']); + } + tlschema(); + modulehook("stables-desc"); +}elseif($op=="examine"){ + $sql = "SELECT * FROM " . db_prefix("mounts") . " WHERE mountid='$id'"; + $result = db_query_cached($sql, "mountdata-$id", 3600); + if (db_num_rows($result)<=0){ + tlschema($schemas['nosuchbeast']); + output($texts['nosuchbeast']); + tlschema(); + }else{ + // Idea taken from Robert of dragonprime.cawsquad.net + $t = e_rand(0,count($texts['finebeast'])-1); + tlschema($schemas['finebeast']); + output($texts['finebeast'][$t]); + tlschema(); + $mount = db_fetch_assoc($result); + output("`7Creature: `&%s`0`n", $mount['mountname']); + output("`7Description: `&%s`0`n", $mount['mountdesc']); + output("`7Cost: `^%s`& gold, `%%s`& gems`n`n", $mount['mountcostgold'], $mount['mountcostgems']); + addnav(array("New %s", $mount['mountname'])); + addnav("Buy this creature","stables.php?op=buymount&id={$mount['mountid']}"); + } +}elseif($op=='buymount'){ + if ($session['user']['hashorse']) { + tlschema($schemas['confirmsale']); + output($texts['confirmsale'], + ($session['user']['sex']?$texts["lass"]:$texts["lad"])); + tlschema(); + addnav("Confirm trade"); + addnav("Yes", "stables.php?op=confirmbuy&id=$id"); + addnav("No","stables.php"); + $confirm = 1; + } else { + $op="confirmbuy"; + httpset("op",$op); + } +} +if ($op == 'confirmbuy') { + $sql = "SELECT * FROM " . db_prefix("mounts") . " WHERE mountid='$id'"; + $result = db_query_cached($sql, "mountdata-$id", 3600); + if (db_num_rows($result)<=0){ + tlschema($schemas['nosuchbeast']); + output($texts['nosuchbeast']); + tlschema(); + }else{ + $mount = db_fetch_assoc($result); + if (($session['user']['gold']+$repaygold) < $mount['mountcostgold'] || + ($session['user']['gems']+$repaygems) < $mount['mountcostgems']){ + tlschema($schemas['toolittle']); + output($texts['toolittle'], $mount['mountname'], $mount['mountcostgold'], $mount['mountcostgems']); + tlschema(); + }else{ + if ($session['user']['hashorse']>0){ + tlschema($schemas['replacemount']); + output($texts['replacemount'], $lcname, $mount['mountname']); + tlschema(); + }else{ + tlschema($schemas['newmount']); + output($texts['newmount'], $mount['mountname']); + tlschema(); + } + $debugmount1=isset($playermount['mountname'])?$playermount['mountname']:false; + if ($debugmount1) $debugmount1="a ".$debugmount1; + $session['user']['hashorse']=$mount['mountid']; + $debugmount2=$mount['mountname']; + $goldcost = $repaygold-$mount['mountcostgold']; + $session['user']['gold']+=$goldcost; + $gemcost = $repaygems-$mount['mountcostgems']; + $session['user']['gems']+=$gemcost; + debuglog(($goldcost <= 0?"spent ":"gained ") . abs($goldcost) . " gold and " . ($gemcost <= 0?"spent ":"gained ") . abs($gemcost) . " gems trading $debugmount1 for a new mount, a $debugmount2"); + $buff = unserialize($mount['mountbuff']); + if ($buff['schema'] == "") $buff['schema'] = "mounts"; + apply_buff('mount',unserialize($mount['mountbuff'])); + // Recalculate so the selling stuff works right + $playermount = getmount($mount['mountid']); + $repaygold = round($playermount['mountcostgold']*2/3,0); + $repaygems = round($playermount['mountcostgems']*2/3,0); + // Recalculate the special name as well. + modulehook("stable-mount", array()); + modulehook("boughtmount"); + require_once("lib/mountname.php"); + list($name, $lcname) = getmountname(); + $grubprice = round($session['user']['level']*$playermount['mountfeedcost'], 0); + } + } +}elseif($op=='feed'){ + if (getsetting("allowfeed", 0) == 0) { + tlschema($schemas['nofeed']); + output($texts['nofeed'], + ($session['user']['sex']?$texts["lass"]:$texts["lad"])); + tlschema(); + } elseif($session['user']['gold']>=$grubprice) { + $buff = unserialize($playermount['mountbuff']); + if (!isset($buff['schema']) || $buff['schema'] == "") $buff['schema'] = "mounts"; + if (isset($session['bufflist']['mount']) && $session['bufflist']['mount']['rounds'] == $buff['rounds']) { + tlschema($schemas['nothungry']); + output($texts['nothungry'],$name); + tlschema(); + } else { + if (isset($session['bufflist']['mount']) && $session['bufflist']['mount']['rounds'] > $buff['rounds']*.5) { + $grubprice=round($grubprice/2,0); + tlschema($schemas['halfhungry']); + output($texts['halfhungry'], $name, $name, $grubprice); + tlschema(); + $session['user']['gold']-=$grubprice; + }else{ + $session['user']['gold']-=$grubprice; + tlschema($schemas['hungry']); + output($texts['hungry'], $name, $name, $grubprice); + tlschema(); + } + debuglog("spent $grubprice feeding their mount"); + apply_buff('mount',$buff); + $session['user']['fedmount'] = 1; + tlschema($schemas['mountfull']); + output($texts['mountfull'], + ($session['user']['sex']?$texts["lass"]:$texts["lad"]), + ($playermount['basename']? + $playermount['basename']:$playermount['mountname'])); + tlschema(); + } + } else { + tlschema($schemas['nofeedgold']); + output($texts['nofeedgold'], $lcname); + tlschema(); + } +}elseif($op=='sellmount'){ + tlschema($schemas['confirmsale']); + output($texts['confirmsale'], + ($session['user']['sex']?$texts["lass"]:$texts["lad"])); + tlschema(); + addnav("Confirm sale"); + addnav("Yes", "stables.php?op=confirmsell"); + addnav("No","stables.php"); + $confirm = 1; +}elseif($op=='confirmsell'){ + $session['user']['gold']+=$repaygold; + $session['user']['gems']+=$repaygems; + $debugmount=$playermount['mountname']; + debuglog("gained $repaygold gold and $repaygems gems selling their mount, a $debugmount"); + strip_buff('mount'); + $session['user']['hashorse']=0; + modulehook("soldmount"); + + $amtstr = ""; + if ($repaygold > 0) { + $amtstr .= "%s gold"; + } + if ($repaygems > 0) { + if ($repaygold) $amtstr .= " and "; + $amtstr .= "%s gems"; + } + if ($repaygold > 0 && $repaygems > 0) { + $amtstr = sprintf_translate($amtstr, $repaygold, $repaygems); + } elseif ($repaygold > 0) { + $amtstr = sprintf_translate($amtstr, $repaygold); + } else { + $amtstr = sprintf_translate($amtstr, $repaygems); + } + + tlschema($schemas['mountsold']); + output($texts['mountsold'], + ($playermount['newname']? + $playermount['newname']:$playermount['mountname']), + $amtstr); + tlschema(); +} + +if ($confirm == 0) { + if ($session['user']['hashorse']>0){ + addnav(array("%s", color_sanitize($name))); + tlschema($schemas['offer']); + output($texts['offer'], $repaygold, $repaygems, $lcname); + tlschema(); + addnav(array("Sell %s`0", $lcname),"stables.php?op=sellmount"); + if (getsetting("allowfeed", 0) && $session['user']['fedmount']==0) { + addnav(array("Feed %s`0 (`^%s`0 gold)", $lcname, $grubprice), + "stables.php?op=feed"); + } + } + + $sql = "SELECT mountname,mountid,mountcategory,mountdkcost FROM " . db_prefix("mounts") . " WHERE mountactive=1 AND mountlocation IN ('all','{$session['user']['location']}') ORDER BY mountcategory,mountcostgems,mountcostgold"; + $result = db_query($sql); + $category=""; + $number=db_num_rows($result); + for ($i=0;$i<$number;$i++){ + $row = db_fetch_assoc($result); + if ($category!=$row['mountcategory']){ + addnav(array("%s", $row['mountcategory'])); + $category = $row['mountcategory']; + } + if ($row['mountdkcost'] <= $session['user']['dragonkills']) + addnav(array("Examine %s`0", $row['mountname']),"stables.php?op=examine&id={$row['mountid']}"); + } +} + +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/stats.php b/lotgd-web/lotgd/stats.php new file mode 100755 index 0000000..a14f778 --- /dev/null +++ b/lotgd-web/lotgd/stats.php @@ -0,0 +1,89 @@ +"); + $name = translate_inline("Name"); + $refs = translate_inline("Referrals"); + rawoutput("$name$refs"); + $sql = "SELECT count(*) AS c, acct.acctid,acct.name AS referer FROM " . db_prefix("accounts") . " INNER JOIN " . db_prefix("accounts") . " AS acct ON acct.acctid = " . db_prefix("accounts") . ".referer WHERE " . db_prefix("accounts") . ".referer>0 GROUP BY " . db_prefix("accounts") . ".referer DESC ORDER BY c DESC"; + $result = db_query($sql); + $number=db_num_rows($result); + for ($i=0;$i<$number;$i++){ + $row = db_fetch_assoc($result); + rawoutput(""); + output_notl("`@{$row['referer']}`0"); + rawoutput(""); + output_notl("`^{$row['c']}:`0 "); + $sql = "SELECT name,refererawarded FROM " . db_prefix("accounts") . " WHERE referer = ${row['acctid']} ORDER BY acctid ASC"; + $res2 = db_query($sql); + $number2=db_num_rows($res2); + for ($j = 0; $j < $number2; $j++) { + $r = db_fetch_assoc($res2); + output_notl(($r['refererawarded']?"`&":"`$") . $r['name'] . "`0"); + if ($j != $number2-1) output_notl(","); + } + rawoutput(""); + } + rawoutput(""); +}elseif($op=="graph"){ + $sql = "SELECT count(acctid) AS c, substring(laston,1,10) AS d FROM " . db_prefix("accounts") . " GROUP BY d DESC ORDER BY d DESC"; + $result = db_query($sql); + output("`n`%`bDate accounts last logged on:`b"); + rawoutput(""); + $class="trlight"; + $odate=date("Y-m-d"); + $j=0; + $cumul = 0; + $number=db_num_rows($result); + for ($i=0;$i<$number;$i++){ + $row = db_fetch_assoc($result); + $diff = (strtotime($odate)-strtotime($row['d']))/86400; + for ($x=1;$x<$diff;$x++){ + //if ($j%7==0) $class=($class=="trlight"?"trdark":"trlight"); + //$j++; + $class=(date("W",strtotime("$odate -$x days"))%2?"trlight":"trdark"); + rawoutput(""); + } + // if ($j%7==0) $class=($class=="trlight"?"trdark":"trlight"); + // $j++; + $class=(date("W",strtotime($row['d']))%2?"trlight":"trdark"); + $cumul+=$row['c']; + rawoutput(""); + $odate = $row['d']; + } + rawoutput("
".date("Y-m-d",strtotime("$odate -$x days"))."  0  $cumul
{$row['d']}  {$row['c']}  $cumul
"); +} +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/superuser.php b/lotgd-web/lotgd/superuser.php new file mode 100755 index 0000000..de6f1fa --- /dev/null +++ b/lotgd-web/lotgd/superuser.php @@ -0,0 +1,85 @@ +'.date("Y-m-d H:i:s").""; + exit(); +}elseif ($op=="newsdelete"){ + $sql = "DELETE FROM " . db_prefix("news") . " WHERE newsid='".httpget('newsid')."'"; + db_query($sql); + $return = httpget('return'); + $return = cmd_sanitize($return); + $return = substr($return,strrpos($return,"/")+1); + redirect($return); +} + +page_header("Superuser Grotto"); + +output("`^You duck into a secret cave that few know about. "); +if ($session['user']['sex']){ + output("Inside you are greeted by the sight of numerous muscular bare-chested men who wave palm fronds at you and offer to feed you grapes as you lounge on Greco-Roman couches draped with silk.`n`n"); +}else{ + output("Inside you are greeted by the sight of numerous scantily clad buxom women who wave palm fronds at you and offer to feed you grapes as you lounge on Greco-Roman couches draped with silk.`n`n"); +} +commentdisplay("", "superuser","Engage in idle conversation with other gods:",25); +addnav("Actions"); +if ($session['user']['superuser'] & SU_EDIT_PETITIONS) addnav("Petition Viewer","viewpetition.php"); +if ($session['user']['superuser'] & SU_EDIT_COMMENTS) addnav("C?Recent Commentary","moderate.php"); +if ($session['user']['superuser'] & SU_EDIT_COMMENTS) addnav("B?Player Bios","bios.php"); +if ($session['user']['superuser'] & SU_EDIT_DONATIONS) addnav("Donator Page","donators.php"); +if (file_exists("paylog.php") && + ($session['user']['superuser'] & SU_EDIT_PAYLOG)) { + addnav("Payment Log","paylog.php"); +} +if ($session['user']['superuser'] & SU_RAW_SQL) addnav("Q?Run Raw SQL", "rawsql.php"); +if ($session['user']['superuser'] & SU_IS_TRANSLATOR) addnav("U?Untranslated Texts", "untranslated.php"); + +addnav("Editors"); +if ($session['user']['superuser'] & SU_EDIT_USERS) addnav("User Editor","user.php"); +if ($session['user']['superuser'] & SU_EDIT_USERS) addnav("Title Editor","titleedit.php"); +if ($session['user']['superuser'] & SU_EDIT_CREATURES) addnav("E?Creature Editor","creatures.php"); +if ($session['user']['superuser'] & SU_EDIT_MOUNTS) addnav("Mount Editor","mounts.php"); +if ($session['user']['superuser'] & SU_EDIT_MOUNTS) addnav("Companion Editor","companions.php"); +if ($session['user']['superuser'] & SU_EDIT_CREATURES) addnav("Taunt Editor","taunt.php"); +if ($session['user']['superuser'] & SU_EDIT_CREATURES) addnav("Master Editor","masters.php"); +if (file_exists("looteditor.php") && + $session['user']['superuser'] & SU_EDIT_ITEMS) { + addnav("Loot Editor","looteditor.php"); +} +if ($session['user']['superuser'] & SU_EDIT_EQUIPMENT) addnav("Weapon Editor","weaponeditor.php"); +if ($session['user']['superuser'] & SU_EDIT_EQUIPMENT) addnav("Armor Editor","armoreditor.php"); +if ($session['user']['superuser'] & SU_EDIT_COMMENTS) addnav("Nasty Word Editor","badword.php"); +if ($session['user']['superuser'] & SU_MANAGE_MODULES) addnav("Manage Modules","modules.php"); + +if ($session['user']['superuser'] & SU_EDIT_CONFIG) addnav("Mechanics"); +if ($session['user']['superuser'] & SU_EDIT_CONFIG) addnav("Game Settings","configuration.php"); +if ($session['user']['superuser'] & SU_EDIT_CONFIG) addnav("Referring URLs","referers.php"); +if ($session['user']['superuser'] & SU_EDIT_CONFIG) addnav("Stats","stats.php"); +/*//*/if (file_exists("gamelog.php") && +/*//*/ $session['user']['superuser'] & SU_EDIT_CONFIG) { +/*//*/ addnav("Gamelog Viewer","gamelog.php"); +/*//*/} + +addnav("Module Configurations"); + +modulehook("superuser", array(), true); + +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/taunt.php b/lotgd-web/lotgd/taunt.php new file mode 100755 index 0000000..6ce4030 --- /dev/null +++ b/lotgd-web/lotgd/taunt.php @@ -0,0 +1,96 @@ +",true); + addnav("","taunt.php?op=save&tauntid=$tauntid"); + if ($tauntid!=""){ + $sql = "SELECT * FROM " . db_prefix("taunts") . " WHERE tauntid=\"$tauntid\""; + $result = db_query($sql); + $row = db_fetch_assoc($result); + require_once("lib/substitute.php"); + $badguy=array('creaturename'=>'Baron Munchausen', 'creatureweapon'=>'Bad Puns'); + $taunt = substitute_array($row['taunt']); + $taunt = call_user_func_array("sprintf_translate", $taunt); + output("Preview: %s`0`n`n", $taunt); + } else { + $row = array('tauntid'=>0, 'taunt'=>""); + } + output("Taunt: "); + rawoutput("
"); + output("The following codes are supported (case matters):`n"); + output("%w = The player's name (also can be specified as {goodguy}`n"); + output("%x = The player's weapon (also can be specified as {weapon}`n"); + output("%a = The player's armor (also can be specified as {armor}`n"); + output("%s = Subjective pronoun for the player (him her)`n"); + output("%p = Possessive pronoun for the player (his her)`n"); + output("%o = Objective pronoun for the player (he she)`n"); + output("%W = The monster's name (also can be specified as {badguy}`n"); + output("%X = The monster's weapon (also can be specified as {creatureweapon}`n"); + $save = translate_inline("Save"); + rawoutput(""); + rawoutput(""); +}else if($op=="del"){ + $sql = "DELETE FROM " . db_prefix("taunts") . " WHERE tauntid=\"$tauntid\""; + db_query($sql); + $op = ""; + httpset("op", ""); +}else if($op=="save"){ + $taunt = httppost('taunt'); + if ($tauntid!=""){ + $sql = "UPDATE " . db_prefix("taunts") . " SET taunt=\"$taunt\",editor=\"".addslashes($session['user']['login'])."\" WHERE tauntid=\"$tauntid\""; + }else{ + $sql = "INSERT INTO " . db_prefix("taunts") . " (taunt,editor) VALUES (\"$taunt\",\"".addslashes($session['user']['login'])."\")"; + } + db_query($sql); + $op = ""; + httpset("op", ""); +} +if ($op == "") { + $sql = "SELECT * FROM " . db_prefix("taunts"); + $result = db_query($sql); + rawoutput(""); + $op = translate_inline("Ops"); + $t = translate_inline("Taunt String"); + $auth = translate_inline("Author"); + rawoutput(""); + $number=db_num_rows($result); + for ($i=0;$i<$number;$i++){ + $row=db_fetch_assoc($result); + rawoutput("",true); + rawoutput(""); + } + addnav("","taunt.php?c=".httpget('c')); + rawoutput("
$op$t$auth
"); + $edit = translate_inline("Edit"); + $del = translate_inline("Del"); + $conf = translate_inline("Are you sure you wish to delete this taunt?"); + $id = $row['tauntid']; + rawoutput("[ $edit | $del ]"); + addnav("","taunt.php?op=edit&tauntid=$id"); + addnav("","taunt.php?op=del&tauntid=$id"); + rawoutput(""); + output_notl("%s", $row['taunt']); + rawoutput(""); + output_notl("%s", $row['editor']); + rawoutput("
"); + addnav("Taunts"); + addnav("Add a new taunt","taunt.php?op=edit"); +} +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/templates/Aware.htm b/lotgd-web/lotgd/templates/Aware.htm new file mode 100755 index 0000000..38a2e17 --- /dev/null +++ b/lotgd-web/lotgd/templates/Aware.htm @@ -0,0 +1,171 @@ + + + + {title} - LoGD + +{headscript}{script} + + + + + + + + + + + + +
+ + + + + +
+ {title} +
+
+ + + + +
+ + +
+
+ + + + +
+
+ + + + + + {title} - LoGD + +{headscript}{script} + + + + + + + + + + + + + +
+ + + + + + + +
+ {title} + Legend of the Green Dragon
{headerad}
+ + + + + +
{motd}
{mail}
{petition}
{petitiondisplay}
+
+
+ + + + + + +
+ + + + + +
{navad}{nav}
+
{verticalad}
{bodyad} + +
+ + + + + +
{stats}
{paypal}
{source}
+
+
+ + + + + +
+
+ + + + + + +
{title}
{title}{value}
{title}
{value}
+—{title}—
+{text}
+{text}
+
{petitioncount}
+ + + +
{content}
+ + + + + + + + +
+ + + + + + + + + + + + +
{username}:{password}:

+
+ + + + + + + + +
+ + + + +
Server Full!
+
diff --git a/lotgd-web/lotgd/templates/Classic.css b/lotgd-web/lotgd/templates/Classic.css new file mode 100755 index 0000000..11c6eac --- /dev/null +++ b/lotgd-web/lotgd/templates/Classic.css @@ -0,0 +1,229 @@ +/* CSS Document */ +caption { + white-space: nowrap; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; +} + +td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + border-top: 1px none #666666; + border-right: 1px solid #666666; + border-bottom: 1px solid #666666; + border-left: 1px none #666666; +} +a{ + color: #0099FF; + text-decoration: none; +} +a.nav { + text-decoration: none; + width: 150px; + height: auto; + padding: 1px; + float: left; + clear: none; + background-color: #000066; + border-top: thin solid #000066; + border-bottom: thin solid #000066; + border-right: thin none #000066; + border-left: thin none #000066; +} +a:hover.nav { + background-color: #003366; + border-top: thin outset #0000CC; + border-right: thin none #0000CC; + border-bottom: thin outset #0000CC; + border-left: thin none #0000CC; +} +a.navhilite { + text-decoration: none; + width: 150px; + height: auto; + padding: 1px; + float: right; + clear: none; + color:#FFFF00; + background-color: #330000; + border-top: thin solid #330000; + border-bottom: thin solid #330000; + border-right: thin none #330000; + border-left: thin none #330000; +} +a:hover.navhilite { + background-color: #990000; + border-top: thin outset #CC0000; + border-right: thin none #CC0000; + border-bottom: thin outset #CC0000; + border-left: thin none #CC0000; +} +a.motd { + text-decoration: none; + width: 150px; + height: auto; + padding: 1px; + float: right; + clear: none; + color:#FFFF00; + background-color: #330000; + border-top: thin solid #330000; + border-bottom: thin solid #330000; + border-right: thin none #330000; + border-left: thin none #330000; +} +a:hover.motd { + background-color: #990000; + border-top: thin outset #CC0000; + border-right: thin none #CC0000; + border-bottom: thin outset #CC0000; + border-left: thin none #CC0000; +} +.navhead { + text-decoration: none; + width: 150px; + border: thin #000033; + height: auto; + padding: 1px; + line-height: 18px; + float: left; + clear: none; + background-color: #003366; + font-weight: bold; + color: #00CCFF; + cursor: default; +} +.navhelp { + text-decoration: none; + width: 150px; + height: auto; + padding: 1px; + float: left; + clear: none; + background-color: #000066; + border-top: thin solid #000066; + border-bottom: thin solid #000066; + border-right: thin none #000066; + border-left: thin none #000066; +} +table { + border-top: 1px solid #666666; + border-right: 1px none #666666; + border-bottom: 1px none #666666; + border-left: 1px solid #666666; +} +td.charinfo { + border-top-width: 1px; + border-top-style: solid; + border-top-color: #990000; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + cursor: default; +} +td.charhead { + background-color: #990000; + border: none; + cursor: default; +} +table.charinfo { border: none; } +td.pageheader { background-color: #000066; } +td.noborder { border: none; } +table.noborder { border: none; } +input { + background-color: #333333; + border: 1px dotted #999999; + color: #CCCCCC; +} +.input { + background-color: #333333; + border: 1px dotted #999999; + color: #CCCCCC; +} +select { + background-color: #333333; + border: 1px dotted #999999; + color: #CCCCCC; +} + +a.t { + width: 7px; + height: 7px; + border: 1px dotted #0000FF; + background-color: #9999FF; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +a.thot { + width: 7px; + height: 7px; + border: 1px dotted #FF0000; + background-color: #FF9999; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +div.debug { + background-color: #FFFFFF; + color: #000000; + border: 1px dotted #000000; + width: auto; + height: auto; + font-size: 10px; +} +.navhi { color: #00FF00; } +.colDkBlue { color: #0000B0; } +.colDkGreen { color: #00B000; } +.colDkCyan { color: #00B0B0; } +.colDkRed { color: #B00000; } +.colDkMagenta { color: #B000CC; } +.colDkYellow { color: #B0B000; } +.colDkWhite { color: #B0B0B0; } +.colLtBlue { color: #0000FF; } +.colLtGreen { color: #00FF00; } +.colLtCyan { color: #00FFFF; } +.colLtRed { color: #FF0000; } +.colLtMagenta { color: #FF00FF; } +.colLtYellow { color: #FFFF00; } +.colLtWhite { color: #FFFFFF; } +.colLtBlack { color: #999999; } +.colDkOrange { color: #994400; } +.colLtOrange { color: #FF9900; } +.colBlue { color: #0070FF; } +.colLime { color: #DDFFBB; } +.colBlack { color: #000000; } +.colRose { color: #EEBBEE; } +.colblueviolet { color: #9A5BEE; } +.coliceviolet { color: #AABBEE; } +.colLtBrown { color: #F8DB83; } +.colDkBrown { color: #6b563f; } +.colXLtGreen { color: #aaff99; } +.colAttention { background-color: #00FF00; color: #FF0000; } +.colWhiteBlack { background-color: #FFFFFF; color: #000000; } +.colBack { background-color: #00FFFF; color: #000000; } +.colbeige { color: #F5F5DC; } +.colkhaki { color: #F0E68C; } +.coldarkkhaki { color: #BDB76B; } +.colaquamarine { color: #7FFFD4; } +.coldarkseagreen { color: #8FBC8F; } +.collightsalmon { color: #FFA07A; } +.colsalmon { color: #FA8072; } +.colwheat { color: #F5DEB3; } +.coltan { color: #D2B48C; }.colLtLinkBlue { color: #0099FF; } +.colDkLinkBlue { color: #006BB3; } +.colDkRust { color: #8D6060; } +.colLtRust { color: #B07878; } +.colMdBlue { color: #0000F0; } +.colMdGrey { color: #DDDDDD; } +.colburlywood { color: #DEB887; } +.trhead { background-color:#990000; color:#FFFFFF; } +.trlight { background-color:#330000; } +.trdark { background-color:#000000; } +.trhilight { background-color: #550000; } diff --git a/lotgd-web/lotgd/templates/Classic.htm b/lotgd-web/lotgd/templates/Classic.htm new file mode 100755 index 0000000..6f92536 --- /dev/null +++ b/lotgd-web/lotgd/templates/Classic.htm @@ -0,0 +1,119 @@ + + + +{title} + +{headscript}{script} + + + + + + + + + + +
+
{copyright}
+ + + + + +{title} + +{headscript}{script} + + + + + + + + +
+ {navad} + {nav}

+ {mail}
+ {petition} +
+
{verticalad}
{bodyad} + +{petitiondisplay} +
+{stats} +{paypal} +{version} +
+ +
{copyright}{pagegen}
+
{source}{petition}
+
+ + + + +
{title}
{title}{value}
{title}
{value}
+—{title}— +{text}
+{text} +
{petitioncount}
+ + + +
{content}
+ + + + + + + + +
+ + + + + + + + + + + + +
{username}:{password}:

+
+ + + + + + + + +
+ + + + +
Server Full!
+
+ +style:classic diff --git a/lotgd-web/lotgd/templates/Cupertino.htm b/lotgd-web/lotgd/templates/Cupertino.htm new file mode 100755 index 0000000..244391c --- /dev/null +++ b/lotgd-web/lotgd/templates/Cupertino.htm @@ -0,0 +1,149 @@ + + + + +{title} + +{headscript} {script} + + + + + + + + + + + + + + + + + + + +
{title}
  + +  
 {copyright} 
+ + + + + +{title} + +{headscript} {script} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  +
{headerad}
+ + + + + + + + + + +
{motd} {mail} {petition}    {source}
+
 
 {title} 
{verticalad}
 

{navad}
{nav}
{bodyad}
+ + {petitiondisplay} +
{stats}
+ Other +
+ + + + +
{paypal}
+
 
 {copyright} {pagegen}{version}  
+ + + +{title} +{title}: {value}
+{title} {value} + +—{title}—
+{text}
+{text}
+
{petitioncount}
+ + + +
{content}
+ + + + + + + + + + + + + + + + +
+
+ {username}:

+ {password}:

+
+ + +
+ + + + + + + + + + + + + + + +
+
Server

full!



+ +
diff --git a/lotgd-web/lotgd/templates/Red.css b/lotgd-web/lotgd/templates/Red.css new file mode 100755 index 0000000..ea2e9fb --- /dev/null +++ b/lotgd-web/lotgd/templates/Red.css @@ -0,0 +1,313 @@ +/* CSS Document for the LoGD Red skin by Red Yates, based on amber skin by Ben Wong */ + +/* -------------------------------------------------------------------- +** General Tag Defaults +*/ + +/** tables **/ +table { +} +td { + font-family: "Lucida Console", "Terminal", monospace; + font-size: 12px; +} + +/** links **/ +a { + color: #ff0000; + text-decoration: none; +} +a:hover { + color: #ff0000; +} + +/** input fields (e.g. village chats) **/ +input { + font-family: "Lucida Console", "Terminal", monospace; + font-size: 11px; + background-color: #000000; + border: 1px solid #cc0000; + color: #ff0000; +} + +/** select boxes (e.g. user preference drop-downs) **/ +select { + background-color: #000000; + border: 1px solid #cc0000; + color: #ff0000; +} + +/* -------------------------------------------------------------------- +** Global Classes +*/ + +/** the main page heading (e.g. "Degolburg, the Capital City", "LoGD News") **/ +.pagetitle { + font-family: "Lucida Console", "Terminal", monospace; + font-size: 16px; + font-weight: bold; + font-style: normal; + color: #ff0000; +} + +/** nav menu categories (e.g. City Gates, Store Street, Info) **/ +.navhead { + text-decoration: underline; + width: 175px; + border: thin none #cc0000; + height: auto; + padding: 1px; + line-height: 18px; + float: left; + clear: none; + background-color: #190000; + font-weight: bold; + color: #ff0000; + cursor: default; + text-align: left; +} + +/** help for nav menu categories **/ +.navhelp { + text-decoration: none; + width: 175px; + height: auto; + padding: 1px; + float: left; + clear: none; + border: thin none #cc0000; + cursor: default; +} + +/** nav hot keys (e.g. [F]orest, [T]ravel) **/ +.navhi { + background-color: #ff0000; + width: 10px; + color: #000000; + text-decoration: none; + padding: 1px; +} + +/** input fields (e.g. the textarea in YOMs) **/ +.input { + background-color: #000000; + border: 1px solid #cc0000; + color: #ff0000; +} + +/** input buttons (e.g. Submit, Search, Add) **/ +.button { + font-family: "Lucida Console", "Terminal", monospace; + font-size: 11px; + color: #ff0000; + background-color: #330000; + border-top: 1px solid #cc0000; + border-left: 1px solid #cc0000; + border-right: 1px solid #990000; + border-bottom: 1px solid #990000; +} + +/** text colours **/ +.colDkBlue { color: #0000aa; } +.colDkGreen { color: #00aa00; } +.colDkCyan { color: #00aaaa; } +.colDkRed { color: #aa0000; } +.colDkMagenta { color: #aa00aa; } +.colDkYellow { color: #aaaa00; } +.colDkWhite { color: #cccccc; } +.colLtBlue { color: #0000ff; } +.colLtGreen { color: #00ff00; } +.colLtCyan { color: #00ffff; } +.colLtRed { color: #ff0000; } +.colLtMagenta { color: #ff00ff; } +.colLtYellow { color: #ffff00; } +.colLtWhite { color: #ffffff; } +.colLtBlack { color: #777777; } +.colDkOrange { color: #aa4400; } +.colLtOrange { color: #ffaa00; } +.colBlue { color: #0070FF; } +.colLime { color: #DDFFBB; } +.colBlack { color: #000000; } +.colRose { color: #EEBBEE; } +.colblueviolet { color: #9A5BEE; } +.coliceviolet { color: #AABBEE; } +.colLtBrown { color: #F8DB83; } +.colDkBrown { color: #6b563f; } +.colXLtGreen { color: #aaff99; } +.colAttention { background-color: #00FF00; color: #FF0000; } +.colWhiteBlack { background-color: #FFFFFF; color: #000000; } +.colBack { background-color: #00FFFF; color: #000000; } +.colbeige { color: #F5F5DC; } +.colkhaki { color: #F0E68C; } +.coldarkkhaki { color: #BDB76B; } +.colaquamarine { color: #7FFFD4; } +.coldarkseagreen { color: #8FBC8F; } +.collightsalmon { color: #FFA07A; } +.colsalmon { color: #FA8072; } +.colwheat { color: #F5DEB3; } +.coltan { color: #D2B48C; }.colLtLinkBlue { color: #0099FF; } +.colDkLinkBlue { color: #006BB3; } +.colDkRust { color: #8D6060; } +.colLtRust { color: #B07878; } +.colMdBlue { color: #0000F0; } +.colMdGrey { color: #DDDDDD; } +.colburlywood { color: #DEB887; } + +/** table rows (e.g. Game Setup Info, Hall o' Fame) **/ +.trhead { background-color:#660000; color:#ff0000; } +.trlight { background-color:#330000; color:#ff0000; } +.trdark { background-color:#000000; color:#ff0000; } +.trhilight { background-color: #660000; color: #ff0000} + +/* -------------------------------------------------------------------- +** Specific Tags and Classes +*/ + +/** links - navigation **/ +a.nav { /* nav link (e.g. Forest, Quit, Travel) */ + text-decoration: none; + width: auto; + height: auto; + padding: 1px 1px 1px 4px; + float: left; + clear: none; +} +a:hover.nav { /* nav link on mouseover */ + background-color: #660000; + color: #ff0000; +} + +/** links - motd **/ +a.motd { /* for motd, yom, and petition */ + text-decoration: none; + text-align: center; + color:#ff0000; + width: auto; + height: auto; + clear: none; + background-color: #190000; +} +a:hover.motd { /* mouseover for motd, yom, and petition */ + height: auto; + width: auto; + background-color: #660000; + color: #ff0000; +} +a.hotmotd { /* when a new motd or yom is available */ + font-weight: bold; + text-decoration: none; + text-align: center; + color:#ffffff; + width: auto; + height: auto; + clear: none; + background-color: #190000; +} + +/** links - translator tool **/ +a.t { + width: 8px; + height: 10px; + border: 1px dotted #0000ee; + background-color: #000000; + color: #ff0000; + font-size: 11px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} +a.thot { + width: 8px; + height: 10px; + border: 1px solid #00ee00; + background-color: #000000; + color: #ff0000; + font-size: 11px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +/** tables - navigation **/ +table.nav { + background-color: #190000; + border: none; + border-right: thin solid #cc0000; + width: 175px; +} +td.nav a.thot { + position: absolute; + left: 0px; + height: auto; +} +td.nav a.t { + position: absolute; + left: 0px; + height: auto; +} + +/** tables - character stats (i.e. "vital info") **/ +table.vitalinfo { /* the whole vital info 'wrapper' table */ + background-color: #190000; + border: none; + border-left: thin solid #cc0000; + width: auto; +} +table.charinfo { /* the sub-table with the data */ + background-color: #190000; + width: auto; +} +td.charhead { /* vital info category heading */ + padding-left: 2px; + background-color: #190000; + border-top: none; + cursor: default; + color: #ff0000; + text-decoration: underline; +} +td.charinfo { /* vital info data */ + padding-left: 8px; + border-top: none; + border-bottom: none; + cursor: default; + color: #ff0000; +} + +/** tables - main page **/ +td.pageheader { /* heading for the main page */ + background-image: url(Red/redtitle.gif); + background-position: bottom right; + background-repeat: no-repeat; + background-color: #190000; + border-bottom: thin solid #cc0000; +} + +/** tables - popups **/ +td.popupheader { /* heading in a popup (e.g. motd, yom)*/ + background-color: #190000; + border-bottom: thin solid #cc0000; + height: 50px; +} + +/** tables - footers **/ +table.noborder { /* table in the footer */ + border: none; +} +td.footer { /* data for a footer */ + border-top: thin solid #cc0000; + background-position: top; +} +td.noborder { /* borderless data in the footer */ + border: none; +} + +/** debugging **/ +div.debug { + background-color: #330000; + color: #ffffff; + border: 1px dotted #cc0000; + width: auto; + height: auto; + font-size: 10px; +} + diff --git a/lotgd-web/lotgd/templates/Red.htm b/lotgd-web/lotgd/templates/Red.htm new file mode 100755 index 0000000..87b81f0 --- /dev/null +++ b/lotgd-web/lotgd/templates/Red.htm @@ -0,0 +1,195 @@ + + + + +{title} + +{headscript}{script} + + + + + + + + + + + + +
+ LotGD +
{title}
+
+ +
+ + + + + + +{title} + +{headscript}{script} + + + + + + + + + + + + +
+
{navad}
+ + + + + +
+
+ + + + + +
+ {headerad}{bodyad} + + + + + + + + + +
{stats}
+
+ {paypal}{verticalad} +
+
+
+ + + +{title}
+ +{text}
+ +{text}
+ + + + + + + + + + + + + + + + + + + +
{title}
{title}{value}
{title}
{value}
+ + + + + +
{petitioncount}
+ + + +
{content}
+ +

+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ {username}: + + {password}: +
+ + + +
+
+
+
+ + + + + + + + +
+ +
+ Server Full! +
diff --git a/lotgd-web/lotgd/templates/Red/reddragon.gif b/lotgd-web/lotgd/templates/Red/reddragon.gif new file mode 100755 index 0000000..4eead39 Binary files /dev/null and b/lotgd-web/lotgd/templates/Red/reddragon.gif differ diff --git a/lotgd-web/lotgd/templates/Red/redtitle.gif b/lotgd-web/lotgd/templates/Red/redtitle.gif new file mode 100755 index 0000000..a6e0106 Binary files /dev/null and b/lotgd-web/lotgd/templates/Red/redtitle.gif differ diff --git a/lotgd-web/lotgd/templates/ailean.css b/lotgd-web/lotgd/templates/ailean.css new file mode 100755 index 0000000..afb363b --- /dev/null +++ b/lotgd-web/lotgd/templates/ailean.css @@ -0,0 +1,357 @@ +/* CSS Document for the LoGD ailean skin by Ben Wong, + based on a concept by Ailean */ + +/* -------------------------------------------------------------------- +** General Tag Defaults +*/ + +/** tables **/ +table { +} +td { + font-family: "Trebuchet MS", "Verdana", "Helvetica", "Arial", sans-serif; + font-size: 12px; +} + +/** links **/ +a { + color: #d0a700; + text-decoration: none; +} +a:hover { + color: #767676; + text-decoration: none; +} + +/** input fields (e.g. village chats) **/ +input { + font-family: "Trebuchet MS", "Verdana", "Helvetica", "Arial", sans-serif; + font-size: 12px; + background-color: #303030; + border: 1px solid; + border-color: #000000 #707070 #707070 #000000; + color: #e7e7e7; +} + +/** select boxes (e.g. user preference drop-downs) **/ +select { + background-color: #303030; + border: 1px solid #000000; + color: #d0a700; +} + +fieldset { + border: 1px solid; + border-color: #707070 #000000 #000000 #707070; +} +legend { + padding: 3px; + color: #639ace; + font-weight: bold; + margin-top: 0px; + margin-right: 0px; + margin-left: 0px; +} + +/* -------------------------------------------------------------------- +** Global Classes +*/ + +/** the main page heading (e.g. "Degolburg, the Capital City", "LoGD News") **/ +.pagetitle { + font-family: "Trebuchet MS", "Verdana", "Helvetica", "Arial", sans-serif; + font-size: 14px; + font-weight: bold; + font-style: normal; + color: #e7e7e7 +} + +/** nav menu categories (e.g. City Gates, Store Street, Info) **/ +.navhead { + text-decoration: none; + width: 175px; + border: 1px solid; + border-color: #707070 #000000 #000000 #707070; + height: auto; + padding-left: 2px; + line-height: 20px; + float: left; + clear: none; + background-color: #191919; + font-weight: bold; + text-align: left; + background: url(ailean/navhdr.gif) +} + +/** help for nav menu categories **/ +.navhelp { + text-decoration: none; + width: 175px; + height: auto; + padding: 1px; + float: left; + clear: none; + border: thin none; + border-color: #707070 #000000 #000000 #707070; +} + +/** nav hot keys (e.g. [F]orest, [T]ravel) **/ +.navhi { + color: #d0a700; + text-decoration: underline; + font-weight: bold; + padding: 1px; +} + +/** input fields (e.g. the textarea in YOMs) **/ +.input { + background-color: #303030; + border: 1px solid; + border-color: #000000 #707070 #707070 #000000; + color: #e7e7e7; +} + +/** input buttons (e.g. Submit, Search, Add) **/ +.button { + font-family: "Trebuchet MS", "Verdana", "Helvetica", "Arial", sans-serif; + font-size: 12px; + color: #d0a700; + background-color: #303030; + border: 1px solid; + border-color: #707070 #000000 #000000 #707070; +} + +.block { + padding: 3px; + margin-right: 0px; + margin-left: 0px; + margin-bottom: 2px; + line-height: 120%; +} + +/** text colours **/ +.colDkBlue { color: #2080ff; } +.colDkGreen { color: #009900; } +.colDkCyan { color: #009999; } +.colDkRed { color: #aa4444; } +.colDkMagenta { color: #990099; } +.colDkYellow { color: #999900; } +.colDkWhite { color: #cccccc; } +.colLtBlue { color: #74abdf; } +.colLtGreen { color: #00ee00; } +.colLtCyan { color: #00eeee; } +.colLtRed { color: #ee0000; } +.colLtMagenta { color: #ee00ee; } +.colLtYellow { color: #eeee00; } +.colLtWhite { color: #ffffff; } +.colLtBlack { color: #777777; } +.colDkOrange { color: #994400; } +.colLtOrange { color: #ff9900; } +.colBlue { color: #0070FF; } +.colLime { color: #DDFFBB; } +.colBlack { color: #000000; } +.colRose { color: #EEBBEE; } +.colblueviolet { color: #9A5BEE; } +.coliceviolet { color: #AABBEE; } +.colLtBrown { color: #F8DB83; } +.colDkBrown { color: #6b563f; } +.colXLtGreen { color: #aaff99; } +.colAttention { background-color: #00FF00; color: #FF0000; } +.colWhiteBlack { background-color: #FFFFFF; color: #000000; } +.colbeige { color: #F5F5DC; } +.colkhaki { color: #F0E68C; } +.coldarkkhaki { color: #BDB76B; } +.colaquamarine { color: #7FFFD4; } +.coldarkseagreen { color: #8FBC8F; } +.collightsalmon { color: #FFA07A; } +.colsalmon { color: #FA8072; } +.colwheat { color: #F5DEB3; } +.coltan { color: #D2B48C; }.colBack { background-color: #00FFFF; color: #000000; } +.colLtLinkBlue { color: #0099FF; } +.colDkLinkBlue { color: #006BB3; } +.colDkRust { color: #8D6060; } +.colLtRust { color: #B07878; } +.colMdBlue { color: #0000F0; } +.colMdGrey { color: #DDDDDD; } +.colburlywood { color: #DEB887; } +/** table rows (e.g. Game Setup Info, Hall o' Fame) **/ +.trhead { background-color:#d6d6d6; color:#000000; } +.trlight { background-color:#414141; color:#d0a700; } +.trdark { background-color:#191919; color:#d0a700; } +.trhilight { background-color: #303030; color: #d0a700} + + +/* -------------------------------------------------------------------- +** Specific Tags and Classes +*/ + +/** links - navigation **/ +a.nav { /* nav link (e.g. Forest, Quit, Travel) */ + text-decoration: none; + width: 176px; + height: auto; + padding: 1px; + float: left; + clear: none; + background-color: #272727; + border-left: 0px solid #707070; +} +a:hover.nav { /* nav link on mouseover */ + background-color: #636363; + color: #d0a700; +} + +/** for adding things to the bottom of the nav table */ +div.nav { + text-decoration: none; + width: 170px; + height: auto; + padding: 1px 1px 1px 4px; + float: left; + clear: none; + background-color: #272727; + border-left: 1px solid #707070; + border-right: 1px solid #000000; + border-bottom: 1px solid #000000; + margin-left: 2px; +} + + +/** links - motd **/ +a.motd { /* for motd, yom, and petition */ + text-decoration: none; + text-align: center; + color:#d0a700; + width: auto; + height: auto; + clear: none; + background-color: #303030; +} +a:hover.motd { /* mouseover for motd, yom, and petition */ + height: auto; + width: auto; + background-color: #303030; + color: #767676; +} +a.hotmotd { /* when a new motd or yom is available */ + font-weight: bold; + text-decoration: none; + text-align: center; + color:#d0a700; + width: auto; + height: auto; + clear: none; + background-color: #303030; +} + +/** links - translator tool **/ +a.t { + width: 8px; + height: 11px; + border: 1px dotted #0000ee; + background-color: #303030; + color: #d0a700; + font-size: 11px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} +a.thot { + width: 8px; + height: 11px; + border: 1px solid #ee0000; + background-color: #303030; + color: #d0a700; + font-size: 11px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +/** tables - navigation **/ +table.nav { + background-color: #272727; + border-left: 1px solid #707070; + border-right: 1px solid #000000; + width: 175px; +} +td.nav a.thot { + position: absolute; + left: 0px; + height: auto; +} +td.nav a.t { + position: absolute; + left: 0px; + height: auto; +} + +/** tables - character stats (i.e. "vital info") **/ +table.vitalinfo { /* the whole vital info 'wrapper' table */ + background-color: #303030; + border: none; + width: auto; +} +table.charinfo { /* the sub-table with the data */ + background-color: #303030; + width: auto; + border-left: 1px solid #707070; + border-right: 1px solid #000000; + +} +td.charhead { /* vital info category heading */ + padding-left: 2px; + background-color: #191919; + border-top: none; + cursor: default; + font-weight: bold; + background: url(ailean/navhdr.gif); + border: 1px solid; + border-color: #707070 #000000 #000000 #707070; +} +td.charinfo { /* vital info data */ + padding-left: 8px; + /*border-top: 1px solid #707070;*/ + border-bottom: 1px solid #000000; + cursor: default; +} + +/** tables - main page **/ +td.pageheader { /* heading for the main page */ + background-color: #303030; + border-bottom: 2px solid #000000; +} + +/** tables - popups **/ +td.popupheader { /* heading in a popup (e.g. motd, yom)*/ + background-color: #303030; + border-bottom: 2px solid #000000; + height: 64px; +} + +/** tables - footers **/ +table.noborder { /* table in the footer */ + border: none; + +} +table.withborder { /* table in the footer */ + border-top: 2px solid #000000; +} +td.footer { /* data for a footer */ + /*border-top: thin solid #663300;*/ + background-position: top; +} +td.noborder { /* borderless data in the footer */ + border: none; +} + +/** debugging **/ +div.debug { + background-color: #000000; + color: #e7e7e7; + border: 1px dotted #707070; + width: auto; + height: auto; + font-size: 11px; +} + diff --git a/lotgd-web/lotgd/templates/ailean.htm b/lotgd-web/lotgd/templates/ailean.htm new file mode 100755 index 0000000..9c64625 --- /dev/null +++ b/lotgd-web/lotgd/templates/ailean.htm @@ -0,0 +1,220 @@ + + + + +{title} + +{headscript}{script} + + + + + + + + + + + + + +
+ + +
{title}
+
+ +
+ + + + + + +{title} + +{headscript}{script} + + + + + + + + + + + + + + +
+
{navad}
+ + + + + + + + +
+
+ + + + + +
+ {bodyad} +
+ {title} +
+ +
+
+
+ + + + + + + +
{stats}
+
+ {paypal}{verticalad} +
+
+
+ + + + + +{title}
+ +{text}
+ +{text}
+ + + + + + + + + + + + + + + + + + + +
+ + {title} +
{title}{value}
{title}
{value}
+ + {petitioncount} + + + +
{content}
+ +

+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ {username}: + + {password}: +
+ + + +
+
+
+
+ + + + + + + + +
+ +
+ Server Full! +
diff --git a/lotgd-web/lotgd/templates/ailean/bullet.gif b/lotgd-web/lotgd/templates/ailean/bullet.gif new file mode 100755 index 0000000..a8803e2 Binary files /dev/null and b/lotgd-web/lotgd/templates/ailean/bullet.gif differ diff --git a/lotgd-web/lotgd/templates/ailean/check.gif b/lotgd-web/lotgd/templates/ailean/check.gif new file mode 100755 index 0000000..ba66113 Binary files /dev/null and b/lotgd-web/lotgd/templates/ailean/check.gif differ diff --git a/lotgd-web/lotgd/templates/ailean/larrow.gif b/lotgd-web/lotgd/templates/ailean/larrow.gif new file mode 100755 index 0000000..484e100 Binary files /dev/null and b/lotgd-web/lotgd/templates/ailean/larrow.gif differ diff --git a/lotgd-web/lotgd/templates/ailean/logo.jpg b/lotgd-web/lotgd/templates/ailean/logo.jpg new file mode 100755 index 0000000..026323b Binary files /dev/null and b/lotgd-web/lotgd/templates/ailean/logo.jpg differ diff --git a/lotgd-web/lotgd/templates/ailean/navhdr.gif b/lotgd-web/lotgd/templates/ailean/navhdr.gif new file mode 100755 index 0000000..7cd7bcf Binary files /dev/null and b/lotgd-web/lotgd/templates/ailean/navhdr.gif differ diff --git a/lotgd-web/lotgd/templates/ailean/rarrow.gif b/lotgd-web/lotgd/templates/ailean/rarrow.gif new file mode 100755 index 0000000..8e7b740 Binary files /dev/null and b/lotgd-web/lotgd/templates/ailean/rarrow.gif differ diff --git a/lotgd-web/lotgd/templates/aileans.htm b/lotgd-web/lotgd/templates/aileans.htm new file mode 100755 index 0000000..488d3c7 --- /dev/null +++ b/lotgd-web/lotgd/templates/aileans.htm @@ -0,0 +1,212 @@ + + + + +{title} + +{headscript}{script} + + + + + + + + + + + + + +
+ + +
{title}
+
+ +
+ + + + + + +{title} + +{headscript}{script} + + + + + + + + + + + + + + +
+
{navad}
+ + + + + +
+ + + + + + + +
{stats}
+
{verticalad} +
+
+
+ {bodyad} +
+ {title} + + +
{paypal}
+
+ +
+
+
+
+ + + + + +{title}
+ +{text}
+ +{text}
+ + + + + + + + + + + + + + + + + + + +
+ + {title} +
{title}{value}
{title}
{value}
+ + {petitioncount} + + + +
{content}
+ +

+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ {username}: + + {password}: +
+ + + +
+
+
+
+ + + + + + + + +
+ +
+ Server Full! +
diff --git a/lotgd-web/lotgd/templates/amber.css b/lotgd-web/lotgd/templates/amber.css new file mode 100755 index 0000000..63af94d --- /dev/null +++ b/lotgd-web/lotgd/templates/amber.css @@ -0,0 +1,313 @@ +/* CSS Document for the LoGD amber skin, by Ben Wong */ + +/* -------------------------------------------------------------------- +** General Tag Defaults +*/ + +/** tables **/ +table { +} +td { + font-family: "Lucida Console", "Terminal", monospace; + font-size: 12px; +} + +/** links **/ +a { + color: #ff9900; + text-decoration: none; +} +a:hover { + color: #ff6600; +} + +/** input fields (e.g. village chats) **/ +input { + font-family: "Lucida Console", "Terminal", monospace; + font-size: 11px; + background-color: #000000; + border: 1px solid #cc6600; + color: #ff9900; +} + +/** select boxes (e.g. user preference drop-downs) **/ +select { + background-color: #000000; + border: 1px solid #cc6600; + color: #ff9900; +} + +/* -------------------------------------------------------------------- +** Global Classes +*/ + +/** the main page heading (e.g. "Degolburg, the Capital City", "LoGD News") **/ +.pagetitle { + font-family: "Lucida Console", "Terminal", monospace; + font-size: 16px; + font-weight: bold; + font-style: normal; + color: #ff9933; +} + +/** nav menu categories (e.g. City Gates, Store Street, Info) **/ +.navhead { + text-decoration: underline; + width: 175px; + border: thin none #cc6600; + height: auto; + padding: 1px; + line-height: 18px; + float: left; + clear: none; + background-color: #000000; + font-weight: bold; + color: #ff9933; + cursor: default; + text-align: left; +} + +/** help for nav menu categories **/ +.navhelp { + text-decoration: none; + width: 175px; + height: auto; + padding: 1px; + float: left; + clear: none; + border: thin none #cc6600; + cursor: default; +} + +/** nav hot keys (e.g. [F]orest, [T]ravel) **/ +.navhi { + background-color: #ff9900; + width: 10px; + color: #000000; + text-decoration: none; + padding: 1px; +} + +/** input fields (e.g. the textarea in YOMs) **/ +.input { + background-color: #000000; + border: 1px solid #cc6600; + color: #ff9900; +} + +/** input buttons (e.g. Submit, Search, Add) **/ +.button { + font-family: "Lucida Console", "Terminal", monospace; + font-size: 11px; + color: #000000; + background-color: #cc6600; + border-top: 1px solid #ff9933; + border-left: 1px solid #ff9933; + border-right: 1px solid #663300; + border-bottom: 1px solid #663300; +} + +/** text colours **/ +.colDkBlue { color: #000099; } +.colDkGreen { color: #009900; } +.colDkCyan { color: #009999; } +.colDkRed { color: #990000; } +.colDkMagenta { color: #990099; } +.colDkYellow { color: #999900; } +.colDkWhite { color: #cccccc; } +.colLtBlue { color: #0000ee; } +.colLtGreen { color: #00ee00; } +.colLtCyan { color: #00eeee; } +.colLtRed { color: #ee0000; } +.colLtMagenta { color: #ee00ee; } +.colLtYellow { color: #eeee00; } +.colLtWhite { color: #ffffff; } +.colLtBlack { color: #666666; } +.colDkOrange { color: #994400; } +.colLtOrange { color: #ff9900; } +.colBlue { color: #0070FF; } +.colLime { color: #DDFFBB; } +.colBlack { color: #000000; } +.colRose { color: #EEBBEE; } +.colblueviolet { color: #9A5BEE; } +.coliceviolet { color: #AABBEE; } +.colLtBrown { color: #F8DB83; } +.colDkBrown { color: #6b563f; } +.colXLtGreen { color: #aaff99; } +.colAttention { background-color: #00FF00; color: #FF0000; } +.colWhiteBlack { background-color: #FFFFFF; color: #000000; } +.colbeige { color: #F5F5DC; } +.colkhaki { color: #F0E68C; } +.coldarkkhaki { color: #BDB76B; } +.colaquamarine { color: #7FFFD4; } +.coldarkseagreen { color: #8FBC8F; } +.collightsalmon { color: #FFA07A; } +.colsalmon { color: #FA8072; } +.colwheat { color: #F5DEB3; } +.coltan { color: #D2B48C; }.colBack { background-color: #00FFFF; color: #000000; } +.colLtLinkBlue { color: #0099FF; } +.colDkLinkBlue { color: #006BB3; } +.colDkRust { color: #8D6060; } +.colLtRust { color: #B07878; } +.colMdBlue { color: #0000F0; } +.colMdGrey { color: #DDDDDD; } +.colburlywood { color: #DEB887; } + +/** table rows (e.g. Game Setup Info, Hall o' Fame) **/ +.trhead { background-color:#ff9900; color:#000000; } +.trlight { background-color:#663300; color:#ff9933; } +.trdark { background-color:#330000; color:#ff9933; } +.trhilight { background-color: #ff9900; color: #000000} + +/* -------------------------------------------------------------------- +** Specific Tags and Classes +*/ + +/** links - navigation **/ +a.nav { /* nav link (e.g. Forest, Quit, Travel) */ + text-decoration: none; + width: auto; + height: auto; + padding: 1px 1px 1px 4px; + float: left; + clear: none; +} +a:hover.nav { /* nav link on mouseover */ + background-color: #000000; + color: #ff6600; +} + +/** links - motd **/ +a.motd { /* for motd, yom, and petition */ + text-decoration: none; + text-align: center; + color:#ff9933; + width: auto; + height: auto; + clear: none; + background-color: #000000; +} +a:hover.motd { /* mouseover for motd, yom, and petition */ + height: auto; + width: auto; + background-color: #000000; + color: #ff6633; +} +a.hotmotd { /* when a new motd or yom is available */ + font-weight: bold; + text-decoration: none; + text-align: center; + color:#ff6633; + width: auto; + height: auto; + clear: none; + background-color: #000000; +} + +/** links - translator tool **/ +a.t { + width: 8px; + height: 10px; + border: 1px dotted #0000ee; + background-color: #000000; + color: #ff9933; + font-size: 11px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} +a.thot { + width: 8px; + height: 10px; + border: 1px solid #ee0000; + background-color: #000000; + color: #ff9933; + font-size: 11px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +/** tables - navigation **/ +table.nav { + background-color: #000000; + border: none; + border-right: thin solid #663300; + width: 175px; +} +td.nav a.thot { + position: absolute; + left: 0px; + height: auto; +} +td.nav a.t { + position: absolute; + left: 0px; + height: auto; +} + +/** tables - character stats (i.e. "vital info") **/ +table.vitalinfo { /* the whole vital info 'wrapper' table */ + background-color: #000000; + border: none; + border-left: thin solid #663300; + width: auto; +} +table.charinfo { /* the sub-table with the data */ + background-color: #000000; + width: auto; +} +td.charhead { /* vital info category heading */ + padding-left: 2px; + background-color: #000000; + border-top: none; + cursor: default; + color: #ff9933; + text-decoration: underline; +} +td.charinfo { /* vital info data */ + padding-left: 8px; + border-top: none; + border-bottom: none; + cursor: default; + color: #cc9966; +} + +/** tables - main page **/ +td.pageheader { /* heading for the main page */ + background-image: url(amber/ambtitle.gif); + background-position: bottom right; + background-repeat: no-repeat; + background-color: #000000; + border-bottom: thin solid #663300; +} + +/** tables - popups **/ +td.popupheader { /* heading in a popup (e.g. motd, yom)*/ + background-color: #000000; + border-bottom: thin solid #663300; + height: 50px; +} + +/** tables - footers **/ +table.noborder { /* table in the footer */ + border: none; +} +td.footer { /* data for a footer */ + border-top: thin solid #663300; + background-position: top; +} +td.noborder { /* borderless data in the footer */ + border: none; +} + +/** debugging **/ +div.debug { + background-color: #333333; + color: #ff9900; + border: 1px dotted #cc6600; + width: auto; + height: auto; + font-size: 10px; +} + diff --git a/lotgd-web/lotgd/templates/amber.htm b/lotgd-web/lotgd/templates/amber.htm new file mode 100755 index 0000000..2d43bec --- /dev/null +++ b/lotgd-web/lotgd/templates/amber.htm @@ -0,0 +1,193 @@ + + + + +{title} + +{headscript}{script} + + + + + + + + + + + + +
+ LotGD +
{title}
+
+ +
+ + + + + + +{title} + +{headscript}{script} + + + + + + + + + + + + +
+
{navad}
+ + + + + +
+
+ + + + + +
+ {headerad}{bodyad} + + + + + + + + + +
{stats}
+
+ {paypal}{verticalad} +
+
+
+ + + +{title}
+ +{text}
+ +{text}
+ + + + + + + + + + + + + + + + + + + +
{title}
{title}{value}
{title}
{value}
+ + + + + +
{petitioncount}
+ + + +
{content}
+ +

+ + + + + + + +
+ +
+ + + + + + + + + + + + +
+ {username}: + + {password}: +
+ + + +
+
+
+
+ + + + + + + + +
+ +
+ Server Full! +
diff --git a/lotgd-web/lotgd/templates/amber/ambdragon.gif b/lotgd-web/lotgd/templates/amber/ambdragon.gif new file mode 100755 index 0000000..49848b5 Binary files /dev/null and b/lotgd-web/lotgd/templates/amber/ambdragon.gif differ diff --git a/lotgd-web/lotgd/templates/amber/ambtitle.gif b/lotgd-web/lotgd/templates/amber/ambtitle.gif new file mode 100755 index 0000000..e1dd192 Binary files /dev/null and b/lotgd-web/lotgd/templates/amber/ambtitle.gif differ diff --git a/lotgd-web/lotgd/templates/aware2.css b/lotgd-web/lotgd/templates/aware2.css new file mode 100755 index 0000000..18e702a --- /dev/null +++ b/lotgd-web/lotgd/templates/aware2.css @@ -0,0 +1,244 @@ +.sessioninfo { + font-family: Arial, Helvetica, sans-serif; + font-size: 10px; + font-style: normal; + line-height: normal; + color: #CC4500; + text-decoration: none; + border: 1px none #993300; +} +.stats { + + font-family: Arial, Helvetica, sans-serif; + font-size: 10px; + font-style: normal; + line-height: normal; + color: #CC4500; + text-decoration: none; + border: 1px solid #993300; +} +.menu { + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + font-style: normal; + line-height: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + color: #CCCCCC; +} +.footer { + + font-family: Arial, Helvetica, sans-serif; + font-size: 10px; + font-style: normal; + line-height: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + color: #CCCCCC; +} +.tableheader { + font-family: Arial, Helvetica, sans-serif; + font-size: 14px; + font-weight: bold; + color: #CC6600; + background-color: #333333; +} +.table2 { + font-family: Arial, Helvetica, sans-serif; + font-size: 13px; + font-style: normal; + line-height: normal; + font-weight: bold; + font-variant: normal; + text-transform: none; + color: #FFFFFF; + background-color: #151515; +} +.table1 { + + font-family: Arial, Helvetica, sans-serif; + font-size: 14px; + font-style: normal; + line-height: normal; + font-weight: bold; + font-variant: normal; + text-transform: none; + color: #CCCCCC; + background-color: #151515; +} +.table3 { + + font-family: Arial, Helvetica, sans-serif; + font-size: 13px; + font-style: normal; + line-height: normal; + font-weight: bold; + font-variant: normal; + text-transform: none; + color: #FF6600; + background-color: #000000; +} + +caption { + white-space: nowrap; + font-family: Tahoma, Arial, Helvetica, sans-serif; + font-size: 11px; +} +td { + font-family: Tahoma, Arial, Helvetica, sans-serif; + font-size: 11px; +} +a { + color: #3366CC; +} +a:hover { + color: #FFFFFF; +} +a.nav { + color: #999999; +} +a:hover.nav { + color: #FFFFFF; +} +.navhead { + text-decoration: none; + font-weight: bold; + color: #CC0000; + cursor: default; + display: table; +} +.navhelp { + text-decoration: none; + color: #999999; + cursor: default; + display: table; +} +a.motd { + text-decoration: none; + color:#FFFFFF; +} +a:hover.motd { + color: #FF0000; +} +a.hotmotd { + text-decoration: none; + color:#FF0000; +} +td.charinfo { + border-top-width: 1px; + border-top-style: solid; + border-top-color: #999999; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + cursor: default; +} +td.charhead { + background-color: #1478EB; + color: #FFFFFF; + font-weight: bold; + cursor: default; +} +table.charinfo { border: none; } +td.pageheader { background-color: #000066; } +td.noborder { border: none; } +table.noborder { border: none; } +input { + background-color: #000000; + border: 1px solid #666666; + color: #999999; +} +.input { + background-color: #000000; + border: 1px solid #666666; + color: #999999; +} +select { + background-color: #FFFFFF; + border: 1px solid #999999; + color: #000000; +} + +a.t { + width: 7px; + height: 7px; + border: 1px dotted #0000FF; + background-color: #9999FF; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +a.thot { + width: 7px; + height: 7px; + border: 1px dotted #FF0000; + background-color: #FF9999; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +div.debug { + background-color: #FFFFFF; + color: #000000; + border: 1px dotted #000000; + width: auto; + height: auto; + font-size: 10px; +} +.navhi { color: #FFFFFF; } +.colDkBlue { color: #3333CC; } +.colDkGreen { color: #33CC33; } +.colDkCyan { color: #33CCCC; } +.colDkRed { color: #CC3333; } +.colDkMagenta { color: #CC33CC; } +.colDkYellow { color: #CCCC33; } +.colDkWhite { color: #FFFFFF; } +.colLtBlue { color: #3333CC; } +.colLtGreen { color: #33CC33; } +.colLtCyan { color: #33CCCC; } +.colLtRed { color: #CC3333; } +.colLtMagenta { color: #CC33CC; } +.colLtYellow { color: #CCCC33; } +.colLtWhite { color: #CCCCCC; } +.colLtBlack { color: #FFFFFF; } +.colDkOrange { color: #994400; } +.colLtOrange { color: #FF9900; } +.colBlue { color: #0070FF; } +.colLime { color: #DDFFBB; } +.colBlack { color: #000000; } +.colRose { color: #EEBBEE; } +.colblueviolet { color: #9A5BEE; } +.coliceviolet { color: #AABBEE; } +.colLtBrown { color: #F8DB83; } +.colDkBrown { color: #6b563f; } +.colXLtGreen { color: #aaff99; } +.colAttention { background-color: #00FF00; color: #FF0000; } +.colWhiteBlack { background-color: #FFFFFF; color: #000000; } +.colbeige { color: #F5F5DC; } +.colkhaki { color: #F0E68C; } +.coldarkkhaki { color: #BDB76B; } +.colaquamarine { color: #7FFFD4; } +.coldarkseagreen { color: #8FBC8F; } +.collightsalmon { color: #FFA07A; } +.colsalmon { color: #FA8072; } +.colwheat { color: #F5DEB3; } +.coltan { color: #D2B48C; }.colBack { background-color: #00FFFF; color: #000000; } +.colLtLinkBlue { color: #0099FF; } +.colDkLinkBlue { color: #006BB3; } +.colDkRust { color: #8D6060; } +.colLtRust { color: #B07878; } +.colMdBlue { color: #0000F0; } +.colMdGrey { color: #DDDDDD; } +.colburlywood { color: #DEB887; } +.trhead { background-color:#454545; color:#FFFFFF; } +.trlight { background-color:#666666; } +.trdark { background-color:#333333; } +.trhilight { background-color:#888888; } diff --git a/lotgd-web/lotgd/templates/blarg.css b/lotgd-web/lotgd/templates/blarg.css new file mode 100755 index 0000000..a8430b1 --- /dev/null +++ b/lotgd-web/lotgd/templates/blarg.css @@ -0,0 +1,312 @@ +/* CSS Document for the LoGD blarg skin, by Ben Wong */ + +/* -------------------------------------------------------------------- +** General Tag Defaults +*/ + +/** tables **/ +table { + /*border: medium ridge #dddddd;*/ +} +td { + font-family: "Courier New", "Lucida Console", monospace; + font-size: 11px; +} + +/** links **/ +a { + color: #000066; + text-decoration: none; +} + +/** input fields (e.g. village chats) **/ +input { + font-family: "Courier New", "Lucida Console", monospace; + font-size: 10px; + background-color: #dddddd; + border: 1px solid #666666; + color: #333333; +} + +/** select boxes (e.g. user preference drop-downs) **/ +select { + background-color: #dddddd; + border: 1px solid #666666; + color: #333333; +} + +/* -------------------------------------------------------------------- +** Global Classes +*/ + +/** the main page heading (e.g. "Degolburg, the Capital City", "LoGD News") **/ +.pagetitle { + font-family: "Helvetica", "Arial", sans-serif; + font-size: 16px; + font-weight: bold; + font-style: italic; + color: #000000; +} + +/** nav menu categories (e.g. City Gates, Store Street, Info) **/ +.navhead { + text-decoration: none; + width: 200px; + border: thin #cccccc; + height: auto; + padding: 1px; + line-height: 18px; + float: left; + clear: none; + background-color: #f5f5f5; + font-weight: bold; + color: #000000; + cursor: default; + text-align: left; +} + +/** help for nav menu categories **/ +.navhelp { + text-decoration: none; + width: 200px; + height: auto; + padding: 1px; + float: left; + clear: none; + border: thin none #003366; + cursor: default; +} + +/** nav hot keys (e.g. [F]orest, [T]ravel) **/ +.navhi { + color: #0000cc; + text-decoration: underline; +} + +/** input fields (e.g. the textarea in YOMs) **/ +.input { + background-color: #eeeeee; + border: 1px solid #666666; + color: #333333; +} + +/** input buttons (e.g. Submit, Search, Add) **/ +.button { + font-family: "Courier New", "Lucida Console", monospace; + font-size: 11px; + color: #f5f5f5; + background-color: #999999; + border-top: 1px solid #cccccc; + border-left: 1px solid #cccccc; + border-right: 1px solid #333333; + border-bottom: 1px solid #333333; +} + +/** text colours **/ +.colDkBlue { color: #000066; } +.colDkGreen { color: #006600; } +.colDkCyan { color: #006666; } +.colDkRed { color: #660000; } +.colDkMagenta { color: #660066; } +.colDkYellow { color: #666600; } +.colDkWhite { color: #666666; } +.colLtBlue { color: #0000aa; } +.colLtGreen { color: #00aa00; } +.colLtCyan { color: #00aaaa; } +.colLtRed { color: #aa0000; } +.colLtMagenta { color: #aa00aa; } +.colLtYellow { color: #aaaa00; } +.colLtWhite { color: #333333; } +.colLtBlack { color: #999999; } +.colDkOrange { color: #994400; } +.colLtOrange { color: #ff9900; } +.colBlue { color: #0070FF; } +.colLime { color: #DDFFBB; } +.colBlack { color: #000000; } +.colRose { color: #EEBBEE; } +.colblueviolet { color: #9A5BEE; } +.coliceviolet { color: #AABBEE; } +.colLtBrown { color: #F8DB83; } +.colDkBrown { color: #6b563f; } +.colXLtGreen { color: #aaff99; } +.colAttention { background-color: #00FF00; color: #FF0000; } +.colWhiteBlack { background-color: #FFFFFF; color: #000000; } +.colBack { background-color: #00FFFF; color: #000000; } +.colbeige { color: #F5F5DC; } +.colkhaki { color: #F0E68C; } +.coldarkkhaki { color: #BDB76B; } +.colaquamarine { color: #7FFFD4; } +.coldarkseagreen { color: #8FBC8F; } +.collightsalmon { color: #FFA07A; } +.colsalmon { color: #FA8072; } +.colwheat { color: #F5DEB3; } +.coltan { color: #D2B48C; }.colLtLinkBlue { color: #0099FF; } +.colDkLinkBlue { color: #006BB3; } +.colDkRust { color: #8D6060; } +.colLtRust { color: #B07878; } +.colMdBlue { color: #0000F0; } +.colMdGrey { color: #DDDDDD; } +.colburlywood { color: #DEB887; } + +/** table rows (e.g. Game Setup Info, Hall o' Fame) **/ +.trhead { background-color:#666666; color:#f5f5f5; } +.trlight { background-color:#f5f5f5; color:#333333; } +.trdark { background-color:#dddddd; color:#333333; } +.trhilight { background-color: #c8c8c8; color: #333333} + +/* -------------------------------------------------------------------- +** Specific Tags and Classes +*/ + +/** links - navigation **/ +a.nav { /* nav link (e.g. Forest, Quit, Travel) */ + text-decoration: none; + width: 182px; + height: auto; + padding: 1px 1px 1px 20px; + float: left; + clear: none; +} +a:hover.nav { /* nav link on mouseover */ + background-color: #eeeeee; +} + +/** links - motd **/ +a.motd { /* for motd, yom, and petition */ + text-decoration: none; + text-align: center; + color:#000000; + width: 100px; + height: 14px; + clear: none; + background-color: #c8c8c8; +} +a:hover.motd { /* mouseover for motd, yom, and petition */ + height: 14px; + width: 100px; + background-color: #c8c8c8; + color: #aa0000; +} +a.hotmotd { /* when a new motd or yom is available */ + font-weight: bold; + text-decoration: none; + text-align: center; + color:#aa0000; + width: 100px; + height: auto; + clear: none; + background-color: #c8c8c8; +} + +/** links - translator tool **/ +a.t { + width: 10px; + height: 10px; + border: 1px dotted #0000ff; + background-color: #f5f5f5; + color: #000000; + font-size: 10px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} +a.thot { + width: 10px; + height: 10px; + border: 1px solid #ff0000; + background-color: #f5f5f5; + color: #000000; + font-size: 10px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +/** tables - login **/ +table.login { + height: 200px; + width: 232px; + background-image: url(blarg/login.gif); + background-repeat: no-repeat; +} + +/** tables - navigation **/ +table.nav { + background-color: #f5f5f5; + border: medium ridge #eeeeee; + width: 200px; +} +td.nav a.thot { + position: absolute; + left: 0px; + height: auto; +} +td.nav a.t { + position: absolute; + left: 0px; + height: auto; +} + +/** tables - character stats (i.e. "vital info") **/ +table.vitalinfo { /* the whole vital info 'wrapper' table */ + background-color: #f5f5f5; + border: medium ridge #eeeeee; + width: 200px; +} +table.charinfo { /* the sub-table with the data */ + background-color: #f5f5f5; + width: 200px; +} +td.charhead { /* vital info category heading */ + background-color: #c8c8c8; + border: none; + cursor: default; + color: #333333; +} +td.charinfo { /* vital info data */ + padding-left: 20px; + border-top: thin solid #c8c8c8; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + cursor: default; + color: #333333; +} + +/** tables - main page **/ +td.pageheader { /* heading for the main page */ + background-color: #c8c8c8; + background-image: url(blarg/mainhdr.gif); + background-repeat: no-repeat; + height: 90px; +} + +/** tables - popups **/ +td.popupheader { /* heading in a popup (e.g. motd, yom)*/ + background-color: #c8c8c8; + height: 50px; +} + +/** tables - footers **/ +table.noborder { /* table in the footer */ + border: none; +} +td.footer { /* data for a footer */ + background-image: url(../images/rule.gif); + background-repeat: repeat-x; + background-position: top; +} +td.noborder { /* borderless data in the footer */ + border: none; +} + +/** debugging **/ +div.debug { + background-color: #333333; + color: #f5f5f5; + border: 1px dotted #f5f5f5; + width: auto; + height: auto; + font-size: 11px; +} + diff --git a/lotgd-web/lotgd/templates/blarg.htm b/lotgd-web/lotgd/templates/blarg.htm new file mode 100755 index 0000000..f4ab54f --- /dev/null +++ b/lotgd-web/lotgd/templates/blarg.htm @@ -0,0 +1,179 @@ + + + + +{title} + +{headscript}{script} + + + + + + + + + + + + +
+
{title}
+
+ +
+
+ + + + +
+ {copyright}Design: blarg skin by + Ben Wong +
+
+ + + + + + +{title} + +{headscript}{script} + + + + + + + + + + + + + + + + +
+
{navad}
+ [header] +
+ + + + + +
+ [heading] + + + + +
{stats}
+
+ {headerad}{bodyad} + + {petitiondisplay} +
+ {paypal}{verticalad} +
+
+ + + + + +
+ {copyright}Design: blarg skin by + Ben Wong + ({pagegen}) + + {source} +

+ {version} +
+
+ + + +— {title} —
+ +{text}
+ +{text}
+ + + + + + + + + + + + + + + + + + + +
{title}
{title}{value}
{title}
{value}
+ + + + + +
{petitioncount}
+ + + +
{content}
+ +

+ + + + + + + + + + + + + + + + + + + + + + diff --git a/lotgd-web/lotgd/templates/blarg/login.gif b/lotgd-web/lotgd/templates/blarg/login.gif new file mode 100755 index 0000000..d12e4dc Binary files /dev/null and b/lotgd-web/lotgd/templates/blarg/login.gif differ diff --git a/lotgd-web/lotgd/templates/blarg/mainhdr.gif b/lotgd-web/lotgd/templates/blarg/mainhdr.gif new file mode 100755 index 0000000..e10e365 Binary files /dev/null and b/lotgd-web/lotgd/templates/blarg/mainhdr.gif differ diff --git a/lotgd-web/lotgd/templates/blarg/tblhdr.gif b/lotgd-web/lotgd/templates/blarg/tblhdr.gif new file mode 100755 index 0000000..e8b9c4a Binary files /dev/null and b/lotgd-web/lotgd/templates/blarg/tblhdr.gif differ diff --git a/lotgd-web/lotgd/templates/cupertino.css b/lotgd-web/lotgd/templates/cupertino.css new file mode 100755 index 0000000..0aea31c --- /dev/null +++ b/lotgd-web/lotgd/templates/cupertino.css @@ -0,0 +1,212 @@ +/* CSS Document */ +caption { + white-space: nowrap; + font-family: Tahoma, Arial, Helvetica, sans-serif; + font-size: 11px; +} + +td { + font-family: Tahoma, Arial, Helvetica, sans-serif; + font-size: 11px; +} +a{ + color: #3366CC; + text-decoration: none; + +} +a:hover { + text-decoration: underline; + +} +a.nav { + color: #3366CC; + text-decoration: none; + +} +.navhead { + text-decoration: none; + font-weight: bold; + color: #FFFFFF; + cursor: default; + display: table; + background-color: #989DA5; + background-image: url(cupertino/navheadtop.gif); + width: 135px; + background-repeat: no-repeat; + text-align: center; + margin-top: 5px; + padding-top: 5px; +} +.navhelp { + color: #3366CC; + text-decoration: none; + cursor: default; + display: table; +} +a.motd { + text-decoration: none; + color:#000000; +} +a:hover.motd { + color: #FF0000; +} +a.hotmotd { + text-decoration: none; + color:#FF0000; +} +td.charinfo { + border-top-width: 1px; + border-top-style: solid; + border-top-color: #999999; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + cursor: default; +} +td.charhead { + text-decoration: none; + font-weight: bold; + color: #FFFFFF; + cursor: default; + display: table; + background-color: #989DA5; + background-image: url(cupertino/navheadtop.gif); + background-repeat: no-repeat; + text-align: center; + margin-top: 5px; + padding-top: 5px; +} +table.charinfo { border: none; } +td.pageheader { background-color: #000066; } +td.noborder { border: none; } +table.noborder { border: none; } +input { + background-color: #FFFFFF; + border: 1px solid #999999; + color: #000000; +} +.input { + background-color: #FFFFFF; + border: 1px solid #999999; + color: #000000; +} +select { + background-color: #FFFFFF; + border: 1px solid #999999; + color: #000000; +} +.navhi { color: #000000; } +.colDkBlue { color: #000033; } +.colDkGreen { color: #003300; } +.colDkCyan { color: #003333; } +.colDkRed { color: #330000; } +.colDkMagenta { color: #330033; } +.colDkYellow { color: #333300; } +.colDkWhite { color: #666666; } +.colLtBlue { color: #000099; } +.colLtGreen { color: #009900; } +.colLtCyan { color: #009999; } +.colLtRed { color: #990000; } +.colLtMagenta { color: #990099; } +.colLtYellow { color: #999900; } +.colLtWhite { color: #333333; } +.colLtBlack { color: #999999; } +.colDkOrange { color: #994400; } +.colLtOrange { color: #FF9900; } +.colBlue { color: #0070FF; } +.colLime { color: #DDFFBB; } +.colBlack { color: #000000; } +.colRose { color: #EEBBEE; } +.colblueviolet { color: #9A5BEE; } +.coliceviolet { color: #AABBEE; } +.colLtBrown { color: #F8DB83; } +.colDkBrown { color: #6b563f; } +.colXLtGreen { color: #aaff99; } +.colAttention { background-color: #00FF00; color: #FF0000; } +.colWhiteBlack { background-color: #FFFFFF; color: #000000; } +.colbeige { color: #F5F5DC; } +.colkhaki { color: #F0E68C; } +.coldarkkhaki { color: #BDB76B; } +.colaquamarine { color: #7FFFD4; } +.coldarkseagreen { color: #8FBC8F; } +.collightsalmon { color: #FFA07A; } +.colsalmon { color: #FA8072; } +.colwheat { color: #F5DEB3; } +.coltan { color: #D2B48C; }.colBack { background-color: #00FFFF; color: #000000; } +.colLtLinkBlue { color: #0099FF; } +.colDkLinkBlue { color: #006BB3; } +.colDkRust { color: #8D6060; } +.colLtRust { color: #B07878; } +.colMdBlue { color: #0000F0; } +.colMdGrey { color: #DDDDDD; } +.colburlywood { color: #DEB887; } +.trhead { background-color:#006699; color:#FFFFFF; } +.trlight { background-color:#FFFFFF; } +.trdark { background-color:#F0F0F0; } +.trhilight { background-color: #999999; } +.headrow { + background-image: url(cupertino/pinstripe.GIF); +} +.tab { + background-image: url(cupertino/tab.GIF); +} +.bartop { + background-image: url(cupertino/bartop.gif); + background-repeat: repeat-x; +} +.barbottom { + background-image: url(cupertino/barbottom.gif); + background-repeat: repeat-x; +} +.boxtop { + background-image: url(cupertino/boxupper.gif); + background-repeat: repeat-x; +} +.boxright { + background-image: url(cupertino/boxright.gif); + background-repeat: repeat-y; + background-position: right; +} +.boxleft { + background-image: url(cupertino/boxleft.gif); + background-repeat: repeat-y; + background-position: left; +} +.boxlower { + background-image: url(cupertino/boxlower.gif); + background-repeat: repeat-x; + background-position: bottom; +} + +a.t { + width: 7px; + height: 7px; + border: 1px dotted #0000FF; + background-color: #9999FF; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +a.thot { + width: 7px; + height: 7px; + border: 1px dotted #FF0000; + background-color: #FF9999; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +div.debug { + background-color: #FF0000; + color: #ffffff; + border: 1px dotted #000000; + width: auto; + height: auto; + font-size: 10px; +} diff --git a/lotgd-web/lotgd/templates/cupertino/barbottom.gif b/lotgd-web/lotgd/templates/cupertino/barbottom.gif new file mode 100755 index 0000000..7b25e8a Binary files /dev/null and b/lotgd-web/lotgd/templates/cupertino/barbottom.gif differ diff --git a/lotgd-web/lotgd/templates/cupertino/bartop.gif b/lotgd-web/lotgd/templates/cupertino/bartop.gif new file mode 100755 index 0000000..7df4cc4 Binary files /dev/null and b/lotgd-web/lotgd/templates/cupertino/bartop.gif differ diff --git a/lotgd-web/lotgd/templates/cupertino/boxleft.gif b/lotgd-web/lotgd/templates/cupertino/boxleft.gif new file mode 100755 index 0000000..09c2901 Binary files /dev/null and b/lotgd-web/lotgd/templates/cupertino/boxleft.gif differ diff --git a/lotgd-web/lotgd/templates/cupertino/boxll.gif b/lotgd-web/lotgd/templates/cupertino/boxll.gif new file mode 100755 index 0000000..593a0da Binary files /dev/null and b/lotgd-web/lotgd/templates/cupertino/boxll.gif differ diff --git a/lotgd-web/lotgd/templates/cupertino/boxlower.gif b/lotgd-web/lotgd/templates/cupertino/boxlower.gif new file mode 100755 index 0000000..1f4482d Binary files /dev/null and b/lotgd-web/lotgd/templates/cupertino/boxlower.gif differ diff --git a/lotgd-web/lotgd/templates/cupertino/boxlr.gif b/lotgd-web/lotgd/templates/cupertino/boxlr.gif new file mode 100755 index 0000000..a6a9c34 Binary files /dev/null and b/lotgd-web/lotgd/templates/cupertino/boxlr.gif differ diff --git a/lotgd-web/lotgd/templates/cupertino/boxright.gif b/lotgd-web/lotgd/templates/cupertino/boxright.gif new file mode 100755 index 0000000..8f21765 Binary files /dev/null and b/lotgd-web/lotgd/templates/cupertino/boxright.gif differ diff --git a/lotgd-web/lotgd/templates/cupertino/boxul.gif b/lotgd-web/lotgd/templates/cupertino/boxul.gif new file mode 100755 index 0000000..55041ad Binary files /dev/null and b/lotgd-web/lotgd/templates/cupertino/boxul.gif differ diff --git a/lotgd-web/lotgd/templates/cupertino/boxupper.gif b/lotgd-web/lotgd/templates/cupertino/boxupper.gif new file mode 100755 index 0000000..5c26647 Binary files /dev/null and b/lotgd-web/lotgd/templates/cupertino/boxupper.gif differ diff --git a/lotgd-web/lotgd/templates/cupertino/boxur.gif b/lotgd-web/lotgd/templates/cupertino/boxur.gif new file mode 100755 index 0000000..2688f04 Binary files /dev/null and b/lotgd-web/lotgd/templates/cupertino/boxur.gif differ diff --git a/lotgd-web/lotgd/templates/cupertino/navheadtop.gif b/lotgd-web/lotgd/templates/cupertino/navheadtop.gif new file mode 100755 index 0000000..b53b8f2 Binary files /dev/null and b/lotgd-web/lotgd/templates/cupertino/navheadtop.gif differ diff --git a/lotgd-web/lotgd/templates/cupertino/pinstripe.GIF b/lotgd-web/lotgd/templates/cupertino/pinstripe.GIF new file mode 100755 index 0000000..38c7a4f Binary files /dev/null and b/lotgd-web/lotgd/templates/cupertino/pinstripe.GIF differ diff --git a/lotgd-web/lotgd/templates/cupertino/steel.GIF b/lotgd-web/lotgd/templates/cupertino/steel.GIF new file mode 100755 index 0000000..c74fffe Binary files /dev/null and b/lotgd-web/lotgd/templates/cupertino/steel.GIF differ diff --git a/lotgd-web/lotgd/templates/cupertino/tab.GIF b/lotgd-web/lotgd/templates/cupertino/tab.GIF new file mode 100755 index 0000000..0eb2699 Binary files /dev/null and b/lotgd-web/lotgd/templates/cupertino/tab.GIF differ diff --git a/lotgd-web/lotgd/templates/cupertino/trans.gif b/lotgd-web/lotgd/templates/cupertino/trans.gif new file mode 100755 index 0000000..5bfd67a Binary files /dev/null and b/lotgd-web/lotgd/templates/cupertino/trans.gif differ diff --git a/lotgd-web/lotgd/templates/desert.css b/lotgd-web/lotgd/templates/desert.css new file mode 100755 index 0000000..a703c02 --- /dev/null +++ b/lotgd-web/lotgd/templates/desert.css @@ -0,0 +1,92 @@ +caption { white-space: nowrap; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; } +td { font-family: Verdana, Arial, Helvetica, sans-serif; font-size:11px; } +table.nav { background-color:#BFBD6A; border-bottom:1px solid #FFFFFF; height:auto; width:182px; } +.navhead { text-decoration:none; width:181px; height:auto; padding:3px; float:left; line-height:18px; clear:none; + background-color:#A89F6E; color:#5C5322; cursor:default; text-align:center; border-bottom:1px solid #C4BB8A; + font-variant:small-caps; font-size:14px; font-weight:bold; } +a { color:#674B0A; text-decoration:none; font-size:11px; } +a.nav { color:#FFFFFF; text-decoration:none; width:181px; height:auto; float:left; padding:3px; clear:none; + background-color:#A89F6E; border-bottom:1px solid #C4BB8A; text-align:left; } +.navhelp { text-decoration:none; width:181px; height:auto; padding:1px; float:left; clear: none; + background-color:#C4BB8A; border-bottom:1px solid #C4BB8A; font-size:11px; } +a:hover.nav { color:#5D3211; background-color:#E7E4CA; border-bottom:1px solid #C4BB8A; } +a.navhilite { text-decoration:none; width:150px; height:auto; padding:3px; float:left; clear:none; + color:#5C5322; background-color:#C4BB8A; border-bottom:thin none #C4BB8A; } +a:hover.navhilite { color:#FFFFFF; background-color:#665F35; border-bottom:thin none #C4BB8A; } +table { } +td.charinfo { border-top-width:1px; border-top-style:solid; border-top-color:#009900; + border-right-style:none; border-bottom-style:none; border-left-style:none; cursor:default; } +td.charhead { background-color:#868348; border:none; cursor:default; color:#FFFFFF; } +table.charinfo { border:none; width:182px; } +td.popupheader { background-color:#807C39; background-image:url(../images/headbkg.GIF); height:20px; } +td.noborder { border:none; } +table.noborder { border:none; } +td.village { background-image:url(../images/village.jpg); background-repeat:no-repeat; background-position:right bottom; } +td.forest { background-image:url(../images/forest.jpg); background-repeat:no-repeat; background-position:center bottom; } +td.dragon { background-image:url(../images/dragon.jpg); background-repeat:no-repeat; background-position:center center; background-attachment:fixed; } +input { background-color:#E6DCC6; border:1px solid #6C3812; color:#5C5322; font-size:11px; padding-left:4px; } +.button { font-family:verdana,arial,helvetica,sans-serif; font-size:11px; color:#C4BB8A; background-color:#5C5322; border:1px solid #000000; } +.input { background-color:#E6DCC6; border:1px solid #5C5322; color:#5C5322; font-size:11px; padding-left:4px; } +select { background-color:#E6DCC6; border:1px solid #5C5322; color:#5C5322; font-size:11px; padding-left:4px; } +table.vitalinfo { background-color:#A89F6E; border: 1px solid #5C5322; width:182px; } +a.motd { text-decoration:none; color:#5C5322; } +a:hover.motd { font-weight:none; color:#FF0000; } +a.hotmotd { font-weight:none; color:#5C5322; } +a:hover.hotmotd { font-weight:none; color:#FF0000; } +.pagetitle { font-family:"Arial Black", "Veradna"; font-variant:small-caps; font-size:20px; color:#5C5322; } +.navhi { color:#6F6126; text-decoration:underline; } +td.nav a.thot { position:absolute; left:0px; height:auto; } +td.nav a.t { position:absolute; left:0px; height:auto; } + +a.t { width:7px; height:7px; border:1px solid #0000FF; background-color:#9999FF; color:#FFFFFF; font-size:7px; + text-decoration:none; padding-left:1px; padding-right:1px; } + +a.thot { width:7px; height:7px; border:1px solid #FF0000; background-color:#FF9999; color:#FFFFFF; font-size:7px; + text-decoration:none; padding-left:1px; padding-right:1px; } + +div.debug { background-color:#FFFFFF; color:#000000; border:1px solid #009900; width:auto; height:auto; font-size:10px; } + +.colDkBlue { color: #000173; } +.colDkGreen { color: #006201; } +.colDkCyan { color: #006566; } +.colDkRed { color: #7B0000; } +.colDkMagenta { color: #5E006C; } +.colDkYellow { color: #6C6C00; } +.colDkWhite { color: #060606; } +.colLtBlue { color: #AC0000; } +.colLtGreen { color: #007D01; } +.colLtCyan { color: #007173; } +.colLtRed { color: #A40000; } +.colLtMagenta { color: #7F0080; } +.colLtYellow { color: #FFFFCA; font-weight:bold; } +.colLtWhite { color: #444444; } +.colLtBlack { color: #505050; } +.colDkOrange { color: #804600; } +.colLtOrange { color: #C47600; } + +.colWhiteBlack { background-color:#FFFFFF; color:#000000; } +.colBack { background-color: #FFE1B2; color: #000000; } +.colLtLinkBlue { color: #005388; } +.colDkLinkBlue { color: #002E4F; } +.colDkRust { color: #674343; } +.colLtRust { color: #905353; } +.colMdBlue { color: #0001B0; } +.colMdGrey { color: #474747; } +.colbeige { color: #F5F5DC; } +.colkhaki { color: #F0E68C; } +.coldarkkhaki { color: #BDB76B; } +.colaquamarine { color: #7FFFD4; } +.coldarkseagreen { color: #8FBC8F; } +.collightsalmon { color: #FFA07A; } +.colsalmon { color: #FA8072; } +.colwheat { color: #F5DEB3; } +.coltan { color: #D2B48C; } +.colburlywood { color: #DEB887; } + +ion { background-color:#9BFF9C; color:#A60000; } + +.trhead { background-color:#A89F6E; color:#000000; } +.trlight { background-color:#C4BB8A; color:#5C5322; } +.trdark { background-color:#5C5322; color:#C4BB8A; } +.trhilight { background-color: #333333; color:#AAAAAA; } + diff --git a/lotgd-web/lotgd/templates/desert.htm b/lotgd-web/lotgd/templates/desert.htm new file mode 100755 index 0000000..5fe8320 --- /dev/null +++ b/lotgd-web/lotgd/templates/desert.htm @@ -0,0 +1,325 @@ + + + + +{title} + + +{headscript}{script} + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
{title}
+
+ + + + + + + + + + + + + + + + +
+ + +
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
{copyright} - Design: Desert Template 1.0 - © 2005 by Juergen Buschbaum - The + DIVISION Dubai
+
+
+ + + + + + + + {title} + + {headscript}{script} + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
{title}
+
| {motd} | {petition} | {mail} | {petitiondisplay}
+
+ + + + + +
+ + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
{copyright}
Design: Desert Template 1.0
© 2005 by Juergen Buschbaum - The DIVISION Dubai
{source}
{version}
({pagegen})
+
+
+ + + + + + + + + + + + + + + + +
{title}
{title}{value}
{title}:
{value}
+ + +• {title} •
+ + +{text}
+ + +{text}
+ + +
{petitioncount}
+ + + + + + + + + + + + + + + + + + +
{content}
+ + + + + + + + + +
+ + + + + + + + + + + + +
{username}:{password}:

+
+ + + + + + + + + +
+ + + + +
Server voll!
+
diff --git a/lotgd-web/lotgd/templates/desert/blc.gif b/lotgd-web/lotgd/templates/desert/blc.gif new file mode 100755 index 0000000..87b6ccf Binary files /dev/null and b/lotgd-web/lotgd/templates/desert/blc.gif differ diff --git a/lotgd-web/lotgd/templates/desert/brc.gif b/lotgd-web/lotgd/templates/desert/brc.gif new file mode 100755 index 0000000..23bfc15 Binary files /dev/null and b/lotgd-web/lotgd/templates/desert/brc.gif differ diff --git a/lotgd-web/lotgd/templates/desert/btm.gif b/lotgd-web/lotgd/templates/desert/btm.gif new file mode 100755 index 0000000..e55e3e9 Binary files /dev/null and b/lotgd-web/lotgd/templates/desert/btm.gif differ diff --git a/lotgd-web/lotgd/templates/desert/logindragon.gif b/lotgd-web/lotgd/templates/desert/logindragon.gif new file mode 100755 index 0000000..996ea48 Binary files /dev/null and b/lotgd-web/lotgd/templates/desert/logindragon.gif differ diff --git a/lotgd-web/lotgd/templates/desert/logo.jpg b/lotgd-web/lotgd/templates/desert/logo.jpg new file mode 100755 index 0000000..ffc8508 Binary files /dev/null and b/lotgd-web/lotgd/templates/desert/logo.jpg differ diff --git a/lotgd-web/lotgd/templates/desert/spacer.gif b/lotgd-web/lotgd/templates/desert/spacer.gif new file mode 100755 index 0000000..5bfd67a Binary files /dev/null and b/lotgd-web/lotgd/templates/desert/spacer.gif differ diff --git a/lotgd-web/lotgd/templates/desert/tlc.gif b/lotgd-web/lotgd/templates/desert/tlc.gif new file mode 100755 index 0000000..dde9015 Binary files /dev/null and b/lotgd-web/lotgd/templates/desert/tlc.gif differ diff --git a/lotgd-web/lotgd/templates/desert/tlt.gif b/lotgd-web/lotgd/templates/desert/tlt.gif new file mode 100755 index 0000000..bbbc49f Binary files /dev/null and b/lotgd-web/lotgd/templates/desert/tlt.gif differ diff --git a/lotgd-web/lotgd/templates/desert/tm.gif b/lotgd-web/lotgd/templates/desert/tm.gif new file mode 100755 index 0000000..1147c3f Binary files /dev/null and b/lotgd-web/lotgd/templates/desert/tm.gif differ diff --git a/lotgd-web/lotgd/templates/desert/trc.gif b/lotgd-web/lotgd/templates/desert/trc.gif new file mode 100755 index 0000000..2fbabf8 Binary files /dev/null and b/lotgd-web/lotgd/templates/desert/trc.gif differ diff --git a/lotgd-web/lotgd/templates/desert/trt.gif b/lotgd-web/lotgd/templates/desert/trt.gif new file mode 100755 index 0000000..f41b221 Binary files /dev/null and b/lotgd-web/lotgd/templates/desert/trt.gif differ diff --git a/lotgd-web/lotgd/templates/jade.css b/lotgd-web/lotgd/templates/jade.css new file mode 100755 index 0000000..070ac91 --- /dev/null +++ b/lotgd-web/lotgd/templates/jade.css @@ -0,0 +1,274 @@ +/* CSS Document */ + +caption { + white-space: nowrap; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; +} + +td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; +} + + +table.nav { + background-color: #003800; + border: 1px solid #000000; + height: auto; + width: 182px; +} + +.navhead { + text-decoration: none; + width: 180px; + height: auto; + padding: 1px; + float: left; + line-height: 18px; + clear: none; + background-color: #003800; + font-weight: bold; + color: #FFFFFF; + cursor: default; + text-align: center; + font-variant: small-caps; +} + +a { + color: #D1FFD1; + text-decoration: none; +} + +a.nav { + color: #D1FFD1; + text-decoration: none; + width: 181px; + height: auto; + float: left; + padding: 1px; + clear: none; + background-color: #003800; + border: 1px solid #003800; + text-align: left; +} + +.navhelp { + text-decoration: none; + width: 181px; + height: auto; + padding: 1px; + float: left; + clear: none; + background-color: #015D01; + border: 1px solid #015D01; +} + +a:hover.nav { + background-color: #015D01; + border-top: 1px solid #029402; + border-left: 1px solid #029402; + border-bottom: 1px solid #013901; + border-right: 1px solid #013901; +} +a.navhilite { + text-decoration: none; + width: 150px; + height: auto; + padding: 1px; + float: left; + clear: none; + color:#FFFF00; + background-color: #330000; + border-top: thin solid #330000; + border-bottom: thin solid #330000; + border-right: thin none #330000; + border-left: thin none #330000; +} +a:hover.navhilite { + background-color: #CC0000; + border-top: thin outset #CC0000; + border-right: thin none #CC0000; + border-bottom: thin outset #CC0000; + border-left: thin none #CC0000; +} + + +table { +} +td.charinfo { + border-top-width: 1px; + border-top-style: solid; + border-top-color: #009900; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + cursor: default; +} +td.charhead { + background-color: #009900; + border: none; + cursor: default; + color: #FFFF00; +} +table.charinfo { + border: none; + width: 182px; +} +td.popupheader { + background-color: #333399; + background-image: url(../images/headbkg.GIF); + height: 20px; +} +td.noborder { + border: none; +} +table.noborder { + border: none; +} +input { + background-color: #015D01; + border: 1px solid #013901; + color: #CCCCCC; +} +.button { +font-family: verdana,arial,helvetica,sans-serif; + font-size: 12px; + color: #FFFFFF; + background-color: #015D01; + border-top: 1px solid #029402; + border-left: 1px solid #029402; + border-right: 1px solid #013901; + border-bottom: 1px solid #013901; +} +.input { + background-color: #015D01; + border: 1px solid #013901; + color: #CCCCCC; +} +select { + background-color: #015D01; + border: 1px solid #806B4D; + color: #CCCCCC; +} +table.vitalinfo { + background-color: #003300; + border: 1px solid #000000; + width: 182px; +} +a.motd { + text-decoration: none; + color:#D1FFD1; +} +a:hover.motd { + font-weight: normal; + color:#FFFF00; +} + +a.hotmotd { + font-weight: normal; + color:#FFFF00; +} + +.pagetitle { + font-family: "Arial Black", "Courier"; + font-variant: small-caps; + font-size: 20px; + color: #FFFFFF; +} +.navhi { + color: #00FF00; + text-decoration: underline; +} + +td.nav a.thot { + position: absolute; + left: 0px; + height: auto; +} +td.nav a.t { + position: absolute; + left: 0px; + height: auto; +} + +a.t { + width: 7px; + height: 7px; + border: 1px dotted #0000FF; + background-color: #9999FF; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +a.thot { + width: 7px; + height: 7px; + border: 1px dotted #FF0000; + background-color: #FF9999; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +div.debug { + background-color: #FFFFFF; + color: #000000; + border: 1px dotted #000000; + width: auto; + height: auto; + font-size: 10px; +} +.colDkBlue { color: #0000FF; } +.colDkGreen { color: #00B000; } +.colDkCyan { color: #00B0B0; } +.colDkRed { color: #BB0000; } +.colDkMagenta { color: #B000CC; } +.colDkYellow { color: #B0B000; } +.colDkWhite { color: #B0B0B0; } +.colLtBlue { color: #6262FF; } +.colLtGreen { color: #00FF00; } +.colLtCyan { color: #00FFFF; } +.colLtRed { color: #FF2222; } +.colLtMagenta { color: #FF00FF; } +.colLtYellow { color: #FFFF00; } +.colLtWhite { color: #FFFFFF; } +.colLtBlack { color: #777777; } +.colDkOrange { color: #995500; } +.colLtOrange { color: #FF9900; } +.colBlue { color: #0070FF; } +.colLime { color: #DDFFBB; } +.colBlack { color: #000000; } +.colRose { color: #EEBBEE; } +.colblueviolet { color: #9A5BEE; } +.coliceviolet { color: #AABBEE; } +.colLtBrown { color: #F8DB83; } +.colDkBrown { color: #6b563f; } +.colXLtGreen { color: #aaff99; } +.colAttention { background-color: #00FF00; color: #FF0000; } +.colWhiteBlack { background-color: #FFFFFF; color: #000000; } +.colBack { background-color: #00FFFF; color: #000000; } +.colbeige { color: #F5F5DC; } +.colkhaki { color: #F0E68C; } +.coldarkkhaki { color: #BDB76B; } +.colaquamarine { color: #7FFFD4; } +.coldarkseagreen { color: #8FBC8F; } +.collightsalmon { color: #FFA07A; } +.colsalmon { color: #FA8072; } +.colwheat { color: #F5DEB3; } +.coltan { color: #D2B48C; }.colLtLinkBlue { color: #0099FF; } +.colDkLinkBlue { color: #006BB3; } +.colDkRust { color: #8D6060; } +.colLtRust { color: #B07878; } +.colMdBlue { color: #0000F0; } +.colMdGrey { color: #DDDDDD; } +.colburlywood { color: #DEB887; } +.trhead { background-color:#006600; color:#FFFFFF; } +.trlight { background-color:#004000; } +.trdark { background-color:#003000; } +.trhilight { background-color: #333333; } diff --git a/lotgd-web/lotgd/templates/jade.htm b/lotgd-web/lotgd/templates/jade.htm new file mode 100755 index 0000000..36d9155 --- /dev/null +++ b/lotgd-web/lotgd/templates/jade.htm @@ -0,0 +1,307 @@ + + + + + {title} + + {headscript}{script} + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
• {title}
+
+ + + + + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
{copyright}Design: Jade Template © Josh Canning 2004 of HFS
+
+
+ + + + + + + {title} + + {headscript}{script} + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + +
• {title}
+
+
{headerad}
+
{motd} | {mail} | {petition}
{petitiondisplay}
+
+
+ + + + + +
+ + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
{verticalad}
{bodyad} + +
+ + + + + + + + + + + + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
{copyright}Design: Jade Template © Josh Canning 2004 of HFS{source}
{version}
({pagegen})
+
+
+ + + + + + + + + + + +
{title}
{title}{value}
{title}:
{value}
+ +—{title}—
+ +{text}
+ +{text}
+ +
{petitioncount}
+ + + + + + + + + + + + + + + + + +
{content}
+ + + + + + + + +
+ + + + + + + + + + + + +
{username}:{password}:

+
+ + + + + + + + +
+ + + + +
Server Full!
+
diff --git a/lotgd-web/lotgd/templates/jade/blc.gif b/lotgd-web/lotgd/templates/jade/blc.gif new file mode 100755 index 0000000..3a286d0 Binary files /dev/null and b/lotgd-web/lotgd/templates/jade/blc.gif differ diff --git a/lotgd-web/lotgd/templates/jade/brc.gif b/lotgd-web/lotgd/templates/jade/brc.gif new file mode 100755 index 0000000..06a7b55 Binary files /dev/null and b/lotgd-web/lotgd/templates/jade/brc.gif differ diff --git a/lotgd-web/lotgd/templates/jade/btm.gif b/lotgd-web/lotgd/templates/jade/btm.gif new file mode 100755 index 0000000..917e06f Binary files /dev/null and b/lotgd-web/lotgd/templates/jade/btm.gif differ diff --git a/lotgd-web/lotgd/templates/jade/logo.jpg b/lotgd-web/lotgd/templates/jade/logo.jpg new file mode 100755 index 0000000..d218b3d Binary files /dev/null and b/lotgd-web/lotgd/templates/jade/logo.jpg differ diff --git a/lotgd-web/lotgd/templates/jade/spacer.gif b/lotgd-web/lotgd/templates/jade/spacer.gif new file mode 100755 index 0000000..5bfd67a Binary files /dev/null and b/lotgd-web/lotgd/templates/jade/spacer.gif differ diff --git a/lotgd-web/lotgd/templates/jade/tlc.gif b/lotgd-web/lotgd/templates/jade/tlc.gif new file mode 100755 index 0000000..94cc550 Binary files /dev/null and b/lotgd-web/lotgd/templates/jade/tlc.gif differ diff --git a/lotgd-web/lotgd/templates/jade/tlt.gif b/lotgd-web/lotgd/templates/jade/tlt.gif new file mode 100755 index 0000000..12f140a Binary files /dev/null and b/lotgd-web/lotgd/templates/jade/tlt.gif differ diff --git a/lotgd-web/lotgd/templates/jade/tm.gif b/lotgd-web/lotgd/templates/jade/tm.gif new file mode 100755 index 0000000..da6688a Binary files /dev/null and b/lotgd-web/lotgd/templates/jade/tm.gif differ diff --git a/lotgd-web/lotgd/templates/jade/trc.gif b/lotgd-web/lotgd/templates/jade/trc.gif new file mode 100755 index 0000000..02f7b52 Binary files /dev/null and b/lotgd-web/lotgd/templates/jade/trc.gif differ diff --git a/lotgd-web/lotgd/templates/jade/trt.gif b/lotgd-web/lotgd/templates/jade/trt.gif new file mode 100755 index 0000000..b4aebb9 Binary files /dev/null and b/lotgd-web/lotgd/templates/jade/trt.gif differ diff --git a/lotgd-web/lotgd/templates/mer.css b/lotgd-web/lotgd/templates/mer.css new file mode 100755 index 0000000..475bacc --- /dev/null +++ b/lotgd-web/lotgd/templates/mer.css @@ -0,0 +1,273 @@ +/* CSS Document */ +caption { + white-space: nowrap; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; +} +td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; +} + +table.nav { + background-color: #55FF55; + border: 1px solid #000000; + height: auto; + width: 182px; +} + +.navhead { + text-decoration: none; + width: 180px; + height: auto; + padding: 1px; + line-height: 18px; + float: left; + clear: none; + background-color: #000033; + font-weight: bold; + color: #33CCFF; + cursor: default; + text-align: center; + font-variant: small-caps; +} + +a { + color: #33CCFF; + text-decoration: none; +} + +a.nav { + color: #CCFFFF; + text-decoration: none; + width: 181px; + height: auto; + padding: 1px; + float: left; + clear: none; + background-color: #003737; + border: 1px solid #003737; + text-align: left; +} + +.navhelp { + text-decoration: none; + width: 181px; + height: auto; + padding: 1px; + float: left; + clear: none; + background-color: #01015D; + border: 1px solid #01015D; +} + +a:hover.nav { + background-color: #000033; + border-top: 1px solid #000033; + border-left: 1px solid #000033; + border-bottom: 1px solid #000033; + border-right: 1px solid #000033; + color: #CCFFFF; +} +a.navhilite { + text-decoration: none; + width: 150px; + height: auto; + padding: 1px; + float: right; + clear: none; + color:#0000FF; + background-color: #000033; + border-top: thin solid #000033; + border-bottom: thin solid #000033; + border-right: thin none #000033; + border-left: thin none #000033; +} +a:hover.navhilite { + background-color: #006699; + border-top: thin outset #006699; + border-right: thin none #006699; + border-bottom: thin outset #006699; + border-left: thin none #006699; +} + + +table { +} +td.charinfo { + border-top-width: 1px; + border-top-style: solid; + border-top-color: #003737; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + cursor: default; + +} +td.charhead { + background-color: #000033; + border: none; + cursor: default; +} +table.charinfo { + border: none; + width: 182px; + color: #33CCFF; +} +td.popupheader { + background-color: #333399; + background-image: url(../images/headbkg.GIF); + height: 20px; +} +td.noborder { + border: none; +} +table.noborder { + border: none; +} +input { + background-color: #000033; + border: 1px solid #000033; + color: #33CCFF; +} +.button { +font-family: verdana,arial,helvetica,sans-serif; + font-size: 12px; + color: #33CCFF; + background-color: #000033; + border-top: 1px solid #000066; + border-left: 1px solid #000066; + border-right: 1px solid #000000; + border-bottom: 1px solid #000000; +} +.input { + background-color: #000033; + border: 1px solid #000033; + color: #33CCFF; +} +select { + background-color: #000033; + border: 1px solid #000033; + color: #33CCFF; +} +table.vitalinfo { + background-color: #000033; + border: 1px solid #000000; + width: 182px; +} +a.motd { + text-decoration: none; + color:#0099CC; +} +a:hover.motd { + font-weight: normal; + color:#FFFFFF; +} + +a.hotmotd { + font-weight: normal; + color:#00FF00; +} + +.pagetitle { + font-family: "Arial Black", "Courier"; + font-variant: small-caps; + font-size: 20px; + color: #CCFFFF; +} +.navhi { + color: #33BBCC; + text-decoration: underline; +} + +td.nav a.thot { + position: absolute; + left: 0px; + height: auto; +} +td.nav a.t { + position: absolute; + left: 0px; + height: auto; +} + +a.t { + width: 7px; + height: 7px; + border: 1px dotted #0000FF; + background-color: #9999FF; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +a.thot { + width: 7px; + height: 7px; + border: 1px dotted #0000FF; + background-color: #9999FF; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +div.debug { + background-color: #FFFFFF; + color: #000000; + border: 1px dotted #000000; + width: auto; + height: auto; + font-size: 10px; +} +.colDkBlue { color: #0000FF; } +.colDkGreen { color: #00B000; } +.colDkCyan { color: #00B0B0; } +.colDkRed { color: #BB0000; } +.colDkMagenta { color: #B000CC; } +.colDkYellow { color: #B0B000; } +.colDkWhite { color: #B0B0B0; } +.colLtBlue { color: #6262FF; } +.colLtGreen { color: #00FF00; } +.colLtCyan { color: #00FFFF; } +.colLtRed { color: #FF2222; } +.colLtMagenta { color: #FF00FF; } +.colLtYellow { color: #FFFF00; } +.colLtWhite { color: #FFFFFF; } +.colLtBlack { color: #777777; } +.colDkOrange { color: #995500; } +.colLtOrange { color: #FF9900; } +.colBlue { color: #0070FF; } +.colLime { color: #DDFFBB; } +.colBlack { color: #000000; } +.colRose { color: #EEBBEE; } +.colblueviolet { color: #9A5BEE; } +.coliceviolet { color: #AABBEE; } +.colLtBrown { color: #F8DB83; } +.colDkBrown { color: #6b563f; } +.colXLtGreen { color: #aaff99; } +.colAttention { background-color: #00FF00; color: #FF0000; } +.colWhiteBlack { background-color: #FFFFFF; color: #000000; } +.colBack { background-color: #00FFFF; color: #000000; } +.colbeige { color: #F5F5DC; } +.colkhaki { color: #F0E68C; } +.coldarkkhaki { color: #BDB76B; } +.colaquamarine { color: #7FFFD4; } +.coldarkseagreen { color: #8FBC8F; } +.collightsalmon { color: #FFA07A; } +.colsalmon { color: #FA8072; } +.colwheat { color: #F5DEB3; } +.coltan { color: #D2B48C; }.colLtLinkBlue { color: #0099FF; } +.colDkLinkBlue { color: #006BB3; } +.colDkRust { color: #8D6060; } +.colLtRust { color: #B07878; } +.colMdBlue { color: #0000F0; } +.colMdGrey { color: #DDDDDD; } +.colburlywood { color: #DEB887; } +.trhead { background-color:#000033; color:#FFFFFF; } +.trlight { background-color:#000040; } +.trdark { background-color:#000030; } +.trhilight { background-color: #333333; } diff --git a/lotgd-web/lotgd/templates/mer.htm b/lotgd-web/lotgd/templates/mer.htm new file mode 100755 index 0000000..d5fef1d --- /dev/null +++ b/lotgd-web/lotgd/templates/mer.htm @@ -0,0 +1,306 @@ + + + + + {title} + + {headscript}{script} + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
• {title}
+
+ + + + + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
{copyright}Design: Mer Template © 2005 Shannon Brown
based on Jade Template by Josh Canning of HFS
+
+
+ + + + + + + {title} + + {headscript}{script} + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + + + + + + +
• {title}
+
+
{headerad}
+
{motd} | {mail} | {petition}
{petitiondisplay}
+
+
+ + + + + +
+ + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
{verticalad}
{bodyad} + +
+ + + + + + + + + + + + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
{copyright}Design: Mer Template © 2005 Shannon Brown
based on Jade Template by Josh Canning of HFS
{source}
{version}
({pagegen})
+
+
+ + + + + + + + + + + +
{title}
{title}{value}
{title}:
{value}
+ +—{title}—
+ +{text}
+ +{text}
+ +
{petitioncount}
+ + + + + + + + + + + + + + + + + +
{content}
+ + + + + + + + +
+ + + + + + + + + + + + +
{username}:{password}:

+
+ + + + + + + + +
+ + + + +
Server Full!
+
diff --git a/lotgd-web/lotgd/templates/mer/blc.gif b/lotgd-web/lotgd/templates/mer/blc.gif new file mode 100755 index 0000000..bdff369 Binary files /dev/null and b/lotgd-web/lotgd/templates/mer/blc.gif differ diff --git a/lotgd-web/lotgd/templates/mer/brc.gif b/lotgd-web/lotgd/templates/mer/brc.gif new file mode 100755 index 0000000..c92c7a8 Binary files /dev/null and b/lotgd-web/lotgd/templates/mer/brc.gif differ diff --git a/lotgd-web/lotgd/templates/mer/btm.gif b/lotgd-web/lotgd/templates/mer/btm.gif new file mode 100755 index 0000000..d62a9f6 Binary files /dev/null and b/lotgd-web/lotgd/templates/mer/btm.gif differ diff --git a/lotgd-web/lotgd/templates/mer/logo.jpg b/lotgd-web/lotgd/templates/mer/logo.jpg new file mode 100755 index 0000000..fcb77d6 Binary files /dev/null and b/lotgd-web/lotgd/templates/mer/logo.jpg differ diff --git a/lotgd-web/lotgd/templates/mer/spacer.gif b/lotgd-web/lotgd/templates/mer/spacer.gif new file mode 100755 index 0000000..5bfd67a Binary files /dev/null and b/lotgd-web/lotgd/templates/mer/spacer.gif differ diff --git a/lotgd-web/lotgd/templates/mer/tlc.gif b/lotgd-web/lotgd/templates/mer/tlc.gif new file mode 100755 index 0000000..e41e3d5 Binary files /dev/null and b/lotgd-web/lotgd/templates/mer/tlc.gif differ diff --git a/lotgd-web/lotgd/templates/mer/tlt.gif b/lotgd-web/lotgd/templates/mer/tlt.gif new file mode 100755 index 0000000..bc5aa87 Binary files /dev/null and b/lotgd-web/lotgd/templates/mer/tlt.gif differ diff --git a/lotgd-web/lotgd/templates/mer/tm.gif b/lotgd-web/lotgd/templates/mer/tm.gif new file mode 100755 index 0000000..67854af Binary files /dev/null and b/lotgd-web/lotgd/templates/mer/tm.gif differ diff --git a/lotgd-web/lotgd/templates/mer/trc.gif b/lotgd-web/lotgd/templates/mer/trc.gif new file mode 100755 index 0000000..01514c9 Binary files /dev/null and b/lotgd-web/lotgd/templates/mer/trc.gif differ diff --git a/lotgd-web/lotgd/templates/mer/trt.gif b/lotgd-web/lotgd/templates/mer/trt.gif new file mode 100755 index 0000000..5b8e9fd Binary files /dev/null and b/lotgd-web/lotgd/templates/mer/trt.gif differ diff --git a/lotgd-web/lotgd/templates/mourn.css b/lotgd-web/lotgd/templates/mourn.css new file mode 100755 index 0000000..955b369 --- /dev/null +++ b/lotgd-web/lotgd/templates/mourn.css @@ -0,0 +1,271 @@ +/* CSS Document */ +caption { + white-space: nowrap; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; +} +td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; +} + +table.nav { + background-color: #1c1c1c; + border: 1px solid #000000; + height: auto; + width: 182px; +} + +.navhead { + text-decoration: none; + width: 180px; + height: auto; + padding: 1px; + float: left; + line-height: 18px; + clear: none; + background-color: #666666; + font-weight: bold; + color: #FFFFFF; + cursor: default; + text-align: center; + font-variant: small-caps; +} + +a { + color: #7777A1; + text-decoration: none; +} + +a.nav { + color: #7777A1; + text-decoration: none; + width: 181px; + height: auto; + float: left; + padding: 1px; + clear: none; + background-color: #1c1c1c; + border: 1px solid #1c1c1c; + text-align: left; +} + +.navhelp { + text-decoration: none; + width: 181px; + height: auto; + padding: 1px; + float: left; + clear: none; + background-color: #1c1c1c; + border: 1px solid #1c1c1c; +} + +a:hover.nav { + background-color: #333333; + border-top: 1px solid #000000; + border-left: 1px solid #000000; + border-bottom: 1px solid #202020; + border-right: 1px solid #202020; +} +a.navhilite { + text-decoration: none; + width: 150px; + height: auto; + padding: 1px; + float: left; + clear: none; + color:#FFFFFF; + background-color: #333333; + border-top: thin solid #333333; + border-bottom: thin solid #333333; + border-right: thin none #333333; + border-left: thin none #333333; +} +a:hover.navhilite { + background-color: #CCCCCC; + border-top: thin outset #CCCCCC; + border-right: thin none #CCCCCC; + border-bottom: thin outset #CCCCCC; + border-left: thin none #CCCCCC; +} + + +table { +} +td.charinfo { + border-top-width: 1px; + border-top-style: solid; + border-top-color: #999999; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + cursor: default; +} +td.charhead { + background-color: #666666; + border: none; + cursor: default; + color: #FFFFFF; +} +table.charinfo { + border: none; + width: 182px; +} +td.popupheader { + background-color: #333333; + background-image: url(../images/headbkg.GIF); + height: 20px; +} +td.noborder { + border: none; +} +table.noborder { + border: none; +} +input { + background-color: #010120; + border: 1px solid #010118; + color: #CCCCCC; +} +.button { +font-family: verdana,arial,helvetica,sans-serif; + font-size: 12px; + color: #FFFFFF; + background-color: #010120; + border-top: 1px solid #020230; + border-left: 1px solid #020230; + border-right: 1px solid #010118; + border-bottom: 1px solid #010118; +} +.input { + background-color: #010120; + border: 1px solid #010118; + color: #CCCCCC; +} +select { + background-color: #010120; + border: 1px solid #999999; + color: #CCCCCC; +} +table.vitalinfo { + background-color: #333333; + border: 1px solid #000000; + width: 182px; +} +a.motd { + text-decoration: none; + color:#D1D1FF; +} +a:hover.motd { + font-weight: normal; + color:#FFFFFF; +} + +a.hotmotd { + font-weight: normal; + color:#FFFFFF; +} + +.pagetitle { + font-family: "Arial Black", "Courier"; + font-variant: small-caps; + font-size: 20px; + color: #FFFFFF; +} +.navhi { + color: #FFFFFF; + text-decoration: underline; +} + +td.nav a.thot { + position: absolute; + left: 0px; + height: auto; +} +td.nav a.t { + position: absolute; + left: 0px; + height: auto; +} + +a.t { + width: 7px; + height: 7px; + border: 1px dotted #FFFFFF; + background-color: #999999; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +a.thot { + width: 7px; + height: 7px; + border: 1px dotted #FFFFFF; + background-color: #666666; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +div.debug { + background-color: #FFFFFF; + color: #000000; + border: 1px dotted #000000; + width: auto; + height: auto; + font-size: 10px; +} +.colDkBlue { color: #333388; } +.colDkGreen { color: #338833; } +.colDkCyan { color: #338888; } +.colDkRed { color: #883333; } +.colDkMagenta { color: #883388; } +.colDkYellow { color: #888833; } +.colDkWhite { color: #666666; } +.colLtBlue { color: #666688; } +.colLtGreen { color: #668866; } +.colLtCyan { color: #668888; } +.colLtRed { color: #886666; } +.colLtMagenta { color: #886688; } +.colLtYellow { color: #888866; } +.colLtWhite { color: #888888; } +.colLtBlack { color: #444444; } +.colDkOrange { color: #664433; } +.colLtOrange { color: #665544; } +.colBlue { color: #0070FF; } +.colLime { color: #DDFFBB; } +.colBlack { color: #000000; } +.colRose { color: #EEBBEE; } +.colblueviolet { color: #9A5BEE; } +.coliceviolet { color: #AABBEE; } +.colLtBrown { color: #F8DB83; } +.colDkBrown { color: #6b563f; } +.colXLtGreen { color: #aaff99; } +.colAttention { background-color: #00FF00; color: #FF0000; } +.colWhiteBlack { background-color: #FFFFFF; color: #000000; } +.colBack { background-color: #00FFFF; color: #000000; } +.colbeige { color: #F5F5DC; } +.colkhaki { color: #F0E68C; } +.coldarkkhaki { color: #BDB76B; } +.colaquamarine { color: #7FFFD4; } +.coldarkseagreen { color: #8FBC8F; } +.collightsalmon { color: #FFA07A; } +.colsalmon { color: #FA8072; } +.colwheat { color: #F5DEB3; } +.coltan { color: #D2B48C; }.colLtLinkBlue { color: #0099FF; } +.colDkLinkBlue { color: #006BB3; } +.colDkRust { color: #8D6060; } +.colLtRust { color: #B07878; } +.colMdBlue { color: #0000F0; } +.colMdGrey { color: #DDDDDD; } +.colburlywood { color: #DEB887; } +.trhead { background-color:#666666; color:#FFFFFF; } +.trlight { background-color:#404040; } +.trdark { background-color:#303030; } +.trhilight { background-color: #333333; } diff --git a/lotgd-web/lotgd/templates/mourn.htm b/lotgd-web/lotgd/templates/mourn.htm new file mode 100755 index 0000000..ef851aa --- /dev/null +++ b/lotgd-web/lotgd/templates/mourn.htm @@ -0,0 +1,307 @@ + + + + + {title} + + {headscript}{script} + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
• {title}
Rest in Peace, Lady Liberty
+
+ + + + + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
{copyright}Design: Mourn Template © JT Traub, base on Jade by Josh Canning 2004 of HFS
+
+
+ + + + + + + {title} + + {headscript}{script} + + + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + +
• {title}
Rest in Peace, Lady Liberty
+
+
{headerad}
+
{motd} | {mail} | {petition}
{petitiondisplay}
+
+
+ + + + + +
+ + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
{verticalad}
{bodyad} + +
+ + + + + + + + + + + + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
{copyright}Design: Mourn Template © JT Traub, based on Jade by Josh Canning 2004 of HFS{source}
{version}
({pagegen})
+
+
+ + + + + + + + + + + +
{title}
{title}{value}
{title}:
{value}
+ +—{title}—
+ +{text}
+ +{text}
+ +
{petitioncount}
+ + + + + + + + + + + + + + + + + +
{content}
+ + + + + + + + +
+ + + + + + + + + + + + +
{username}:{password}:

+
+ + + + + + + + +
+ + + + +
Server Full!
+
diff --git a/lotgd-web/lotgd/templates/mourn/blc.gif b/lotgd-web/lotgd/templates/mourn/blc.gif new file mode 100755 index 0000000..ff572b4 Binary files /dev/null and b/lotgd-web/lotgd/templates/mourn/blc.gif differ diff --git a/lotgd-web/lotgd/templates/mourn/brc.gif b/lotgd-web/lotgd/templates/mourn/brc.gif new file mode 100755 index 0000000..d6753f6 Binary files /dev/null and b/lotgd-web/lotgd/templates/mourn/brc.gif differ diff --git a/lotgd-web/lotgd/templates/mourn/btm.gif b/lotgd-web/lotgd/templates/mourn/btm.gif new file mode 100755 index 0000000..471d583 Binary files /dev/null and b/lotgd-web/lotgd/templates/mourn/btm.gif differ diff --git a/lotgd-web/lotgd/templates/mourn/logo.jpg b/lotgd-web/lotgd/templates/mourn/logo.jpg new file mode 100755 index 0000000..b4de840 Binary files /dev/null and b/lotgd-web/lotgd/templates/mourn/logo.jpg differ diff --git a/lotgd-web/lotgd/templates/mourn/spacer.gif b/lotgd-web/lotgd/templates/mourn/spacer.gif new file mode 100755 index 0000000..5f5ab01 Binary files /dev/null and b/lotgd-web/lotgd/templates/mourn/spacer.gif differ diff --git a/lotgd-web/lotgd/templates/mourn/tlc.gif b/lotgd-web/lotgd/templates/mourn/tlc.gif new file mode 100755 index 0000000..86be5a0 Binary files /dev/null and b/lotgd-web/lotgd/templates/mourn/tlc.gif differ diff --git a/lotgd-web/lotgd/templates/mourn/tlt.gif b/lotgd-web/lotgd/templates/mourn/tlt.gif new file mode 100755 index 0000000..8faf4e0 Binary files /dev/null and b/lotgd-web/lotgd/templates/mourn/tlt.gif differ diff --git a/lotgd-web/lotgd/templates/mourn/tm.gif b/lotgd-web/lotgd/templates/mourn/tm.gif new file mode 100755 index 0000000..a3e2006 Binary files /dev/null and b/lotgd-web/lotgd/templates/mourn/tm.gif differ diff --git a/lotgd-web/lotgd/templates/mourn/trc.gif b/lotgd-web/lotgd/templates/mourn/trc.gif new file mode 100755 index 0000000..5dbd371 Binary files /dev/null and b/lotgd-web/lotgd/templates/mourn/trc.gif differ diff --git a/lotgd-web/lotgd/templates/mourn/trt.gif b/lotgd-web/lotgd/templates/mourn/trt.gif new file mode 100755 index 0000000..6ecf2f1 Binary files /dev/null and b/lotgd-web/lotgd/templates/mourn/trt.gif differ diff --git a/lotgd-web/lotgd/templates/redmond.css b/lotgd-web/lotgd/templates/redmond.css new file mode 100755 index 0000000..6617705 --- /dev/null +++ b/lotgd-web/lotgd/templates/redmond.css @@ -0,0 +1,174 @@ +/* CSS Document */ +caption { + white-space: nowrap; + font-family: Tahoma, Arial, Helvetica, sans-serif; + font-size: 11px; +} +td { + font-family: Tahoma, Arial, Helvetica, sans-serif; + font-size: 11px; +} +a{ + color: #003399; +} +a:hover { + color: #FF0000; +} +a.nav { + color: #003399; +} +a.nav:hover { + color: #FF0000; +} +.navhelp { + text-decoration: none; + color: #003399; + cursor: default; + display: table; +} +.navhead { + text-decoration: none; + font-weight: bold; + color: #330000; + cursor: default; + display: table; +} +a.motd { + text-decoration: none; + color:#FFFFFF; + background-color: #000000; +} +a.motd:hover { + color: #FF0000; + background-color: #000000; +} +a.hotmotd { + text-decoration: none; + color:#FF0000; + background-color: #000000; +} +td.charinfo { + border-top-width: 1px; + border-top-style: solid; + border-top-color: #999999; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + cursor: default; +} +td.charhead { + background-color: #1478EB; + color: #FFFFFF; + font-weight: bold; + cursor: default; +} +table.charinfo { border: none; } +td.pageheader { background-color: #000066; } +td.noborder { border: none; } +table.noborder { border: none; } +input { + background-color: #FFFFFF; + border: 1px solid #999999; + color: #000000; +} +.input { + background-color: #FFFFFF; + border: 1px solid #999999; + color: #000000; +} +select { + background-color: #FFFFFF; + border: 1px solid #999999; + color: #000000; +} +td.nav a.thot { + position: absolute; + left: 0px; + height: auto; +} +td.nav a.t { + position: absolute; + left: 0px; + height: auto; +} +a.t { + width: 7px; + height: 7px; + border: 1px dotted #0000FF; + background-color: #9999FF; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +a.thot { + width: 7px; + height: 7px; + border: 1px dotted #FF0000; + background-color: #FF9999; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +div.debug { + background-color: #F0FFF0; + color: #003366; + border: 1px dotted #000000; + width: auto; + height: auto; + font-size: 10px; +} +.navhi { color: #000000; } +.colDkBlue { color: #000033; } +.colDkGreen { color: #003300; } +.colDkCyan { color: #003333; } +.colDkRed { color: #330000; } +.colDkMagenta { color: #330033; } +.colDkYellow { color: #333300; } +.colDkWhite { color: #666666; } +.colLtBlue { color: #000099; } +.colLtGreen { color: #009900; } +.colLtCyan { color: #009999; } +.colLtRed { color: #990000; } +.colLtMagenta { color: #990099; } +.colLtYellow { color: #999900; } +.colLtWhite { color: #333333; } +.colLtBlack { color: #999999; } +.colDkOrange { color: #994400; } +.colLtOrange { color: #FF9900; } +.colBlue { color: #0070FF; } +.colLime { color: #DDFFBB; } +.colBlack { color: #000000; } +.colRose { color: #EEBBEE; } +.colbeige { color: #F5F5DC; } +.colkhaki { color: #F0E68C; } +.coldarkkhaki { color: #BDB76B; } +.colaquamarine { color: #7FFFD4; } +.coldarkseagreen { color: #8FBC8F; } +.collightsalmon { color: #FFA07A; } +.colsalmon { color: #FA8072; } +.colwheat { color: #F5DEB3; } +.coltan { color: #D2B48C; }.colblueviolet { color: #9A5BEE; } +.coliceviolet { color: #AABBEE; } +.colLtBrown { color: #F8DB83; } +.colDkBrown { color: #6b563f; } +.colXLtGreen { color: #aaff99; } +.colAttention { background-color: #00FF00; color: #FF0000; } +.colWhiteBlack { background-color: #FFFFFF; color: #000000; } +.colBack { background-color: #00FFFF; color: #000000; } +.colLtLinkBlue { color: #0099FF; } +.colDkLinkBlue { color: #006BB3; } +.colDkRust { color: #8D6060; } +.colLtRust { color: #B07878; } +.colMdBlue { color: #0000F0; } +.colMdGrey { color: #DDDDDD; } +.colburlywood { color: #DEB887; } +.trhead { background-color:#006699; color:#FFFFFF; } +.trlight { background-color:#FFFFFF; } +.trdark { background-color:#F0F0F0; } +.trhilight { background-color:#999999; } diff --git a/lotgd-web/lotgd/templates/redmond.htm b/lotgd-web/lotgd/templates/redmond.htm new file mode 100755 index 0000000..a4d7b44 --- /dev/null +++ b/lotgd-web/lotgd/templates/redmond.htm @@ -0,0 +1,157 @@ + + + +{title} + +{headscript}{script} + + + + + + + + + + + + + + + + +
+ + + + + + +
+ + + + + +
 {title} 
+
+
  + +
 {copyright}
+ + + + + +{title} + +{headscript}{script} + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
{headerad} + + + + + + + + +
 {motd} |  {mail} |  {petition} 
+
+
+ + + +
+
+ + + + +
{paypal}{verticalad}
{bodyad} + +
+
{version}{copyright} ({pagegen})
+ + + + + + + +
{title}
{title}{value}
{title}
{value}
+—{title}—
+{text}
+{text}
+
{petitioncount}
+ + + +
{content}
+ + + + + + + + + + + + + + + + +
+ {username}:

+ + {password}:

+
+
+ + + + + + + + + + + + + + + + +
+ +
Server

full!
+
diff --git a/lotgd-web/lotgd/templates/redmond/curvey.GIF b/lotgd-web/lotgd/templates/redmond/curvey.GIF new file mode 100755 index 0000000..a52e0fc Binary files /dev/null and b/lotgd-web/lotgd/templates/redmond/curvey.GIF differ diff --git a/lotgd-web/lotgd/templates/redmond/ll.gif b/lotgd-web/lotgd/templates/redmond/ll.gif new file mode 100755 index 0000000..d8a6bd5 Binary files /dev/null and b/lotgd-web/lotgd/templates/redmond/ll.gif differ diff --git a/lotgd-web/lotgd/templates/redmond/lr.gif b/lotgd-web/lotgd/templates/redmond/lr.gif new file mode 100755 index 0000000..3e61d66 Binary files /dev/null and b/lotgd-web/lotgd/templates/redmond/lr.gif differ diff --git a/lotgd-web/lotgd/templates/redmond/title.gif b/lotgd-web/lotgd/templates/redmond/title.gif new file mode 100755 index 0000000..408c19a Binary files /dev/null and b/lotgd-web/lotgd/templates/redmond/title.gif differ diff --git a/lotgd-web/lotgd/templates/redmond/ul.gif b/lotgd-web/lotgd/templates/redmond/ul.gif new file mode 100755 index 0000000..40c4b96 Binary files /dev/null and b/lotgd-web/lotgd/templates/redmond/ul.gif differ diff --git a/lotgd-web/lotgd/templates/redmond/ur.gif b/lotgd-web/lotgd/templates/redmond/ur.gif new file mode 100755 index 0000000..5f45f35 Binary files /dev/null and b/lotgd-web/lotgd/templates/redmond/ur.gif differ diff --git a/lotgd-web/lotgd/templates/teksolo.css b/lotgd-web/lotgd/templates/teksolo.css new file mode 100755 index 0000000..a95b0e8 --- /dev/null +++ b/lotgd-web/lotgd/templates/teksolo.css @@ -0,0 +1,202 @@ +/* CSS Document */ +caption { + white-space: nowrap; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} +td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +table.nav { + background-color: #79835F; + border: 1px solid #87AE75; + height: auto; + width: 135px; +} + +.navhead { + text-decoration: none; + height: auto; + line-height: 18px; + font-weight: bold; + color: #000000; + cursor: default; + text-align: center; +} +a { + color: #173A07; + text-decoration: none; +} +a.nav { + text-decoration: none; +} + +.navhelp { + text-decoration: none; +} +a:hover.nav { + color: #8CD769; +} +a.navhilite { + color: #000000; +} + +table { +} +td.charinfo { + border-top-width: 1px; + border-top-style: solid; + border-top-color: #87AE75; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + cursor: default; +} +td.charhead { + background-color: #87AE75; + border: none; + cursor: default; + color: #476738; +} +table.charinfo { + border: none; + width: 140px; +} +td.pageheader { +} +td.popupheader { +} +td.noborder { + border: none; +} +table.noborder { + border: none; +} +input { + background-color: #79835F; + border: 1px solid #87AE75; + color: #000000; +} +.button { + font-family: verdana,arial,helvetica,sans-serif; + font-size: 12px; + color: #83DB83; + background-color: #79835F; + border-top: 1px solid #87AE75; + border-left: 1px solid #87AE75; + border-right: 1px solid #476738; + border-bottom: 1px solid #476738; +} +.input { + background-color: #79835F; + border: 1px solid #87AE75; + color: #000000; +} +select { + background-color: #79835F; + border: 1px solid #87AE75; + color: #000000; +} +table.vitalinfo { + background-color: #79835F; + border: 1px solid #476738; + width: 182px; +} +a.motd { + text-decoration: none; + color:#99FF00; +} +a:hover.motd { + font-weight: bold; +} + +a.hotmotd { + font-weight: bold; +} +.navhi { + color: #000000; + text-decoration: underline; +} + +a.t { + width: 7px; + height: 7px; + border: 1px dotted #0000FF; + background-color: #9999FF; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +a.thot { + width: 7px; + height: 7px; + border: 1px dotted #FF0000; + background-color: #FF9999; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +div.debug { + background-color: #FFFFFF; + color: #000000; + border: 1px dotted #000000; + width: auto; + height: auto; + font-size: 10px; +} +.colDkBlue { color: #898A9C; } +.colDkGreen { color: #89A185; } +.colDkCyan { color: #89A19C; } +.colDkRed { color: #A08A85; } +.colDkMagenta { color: #A08A9C; } +.colDkYellow { color: #A0A185; } +.colDkWhite { color: #A8A9A4; } +.colLtBlue { color: #8585B3; } +.colLtGreen { color: #85B385; } +.colLtCyan { color: #85B3B3; } +.colLtRed { color: #B38585; } +.colLtMagenta { color: #B385B3; } +.colLtYellow { color: #B3B385; } +.colLtWhite { color: #C3C3C3; } +.colLtBlack { color: #999999; } +.colDkOrange { color: #994400; } +.colLtOrange { color: #FF9900; } +.colBlue { color: #0070FF; } +.colLime { color: #DDFFBB; } +.colBlack { color: #000000; } +.colRose { color: #EEBBEE; } +.colblueviolet { color: #9A5BEE; } +.coliceviolet { color: #AABBEE; } +.colLtBrown { color: #F8DB83; } +.colDkBrown { color: #6b563f; } +.colXLtGreen { color: #aaff99; } +.colAttention { background-color: #00FF00; color: #FF0000; } +.colWhiteBlack { background-color: #FFFFFF; color: #000000; } +.colBack { background-color: #00FFFF; color: #000000; } +.colbeige { color: #F5F5DC; } +.colkhaki { color: #F0E68C; } +.coldarkkhaki { color: #BDB76B; } +.colaquamarine { color: #7FFFD4; } +.coldarkseagreen { color: #8FBC8F; } +.collightsalmon { color: #FFA07A; } +.colsalmon { color: #FA8072; } +.colwheat { color: #F5DEB3; } +.coltan { color: #D2B48C; }.colLtLinkBlue { color: #0099FF; } +.colDkLinkBlue { color: #006BB3; } +.colDkRust { color: #8D6060; } +.colLtRust { color: #B07878; } +.colMdBlue { color: #0000F0; } +.colMdGrey { color: #DDDDDD; } +.colburlywood { color: #DEB887; } +.trhead { background-color:#476738; color:#79835F; } +.trlight { background-color:#79835F; } +.trhilight { background-color:#99A37F; } +.trdark { background-color:#6C7555; } diff --git a/lotgd-web/lotgd/templates/teksolo.htm b/lotgd-web/lotgd/templates/teksolo.htm new file mode 100755 index 0000000..2096097 --- /dev/null +++ b/lotgd-web/lotgd/templates/teksolo.htm @@ -0,0 +1,129 @@ + + + + +{title} + +{headscript}{script} + + + + + + + + + + + + + + + + +
+ {title} +
  + +
 {copyright}
+ + + + + + +{title} + +{headscript}{script} + + + + + + + + + + + + + + + + +
{headerad}
+ + + + +
• {motd}
• {mail}
• {petition}
+
{paypal} + {petitiondisplay} +
{title}
+ + + + + + +
{navad}
{nav}
{stats}
+ + + +
{verticalad}
{bodyad} +
{version}
+ {source} +
{copyright} ({pagegen})
+ + + + + + +
{title}
{title}{value}
{title}
{value}
+—{title}—
+{text}
+{text}
+
{petitioncount}
+ + + +
{content}
+ + + + + + + + +
+ + + + + + + + + + + + +
{username}:{password}:

+
+ + + + + + + + +
+ + + + +
Server Full!
+
diff --git a/lotgd-web/lotgd/templates/teksolo/bar.gif b/lotgd-web/lotgd/templates/teksolo/bar.gif new file mode 100755 index 0000000..96f3cb7 Binary files /dev/null and b/lotgd-web/lotgd/templates/teksolo/bar.gif differ diff --git a/lotgd-web/lotgd/templates/teksolo/bkg.gif b/lotgd-web/lotgd/templates/teksolo/bkg.gif new file mode 100755 index 0000000..a1ac6d7 Binary files /dev/null and b/lotgd-web/lotgd/templates/teksolo/bkg.gif differ diff --git a/lotgd-web/lotgd/templates/teksolo/corner.jpg b/lotgd-web/lotgd/templates/teksolo/corner.jpg new file mode 100755 index 0000000..2143f63 Binary files /dev/null and b/lotgd-web/lotgd/templates/teksolo/corner.jpg differ diff --git a/lotgd-web/lotgd/templates/vcpp.css b/lotgd-web/lotgd/templates/vcpp.css new file mode 100755 index 0000000..e318988 --- /dev/null +++ b/lotgd-web/lotgd/templates/vcpp.css @@ -0,0 +1,317 @@ +/* CSS Document for the LoGD vcpp skin, by Ben Wong */ + +/* -------------------------------------------------------------------- +** General Tag Defaults +*/ + +/** tables **/ +table { +} +td { + font-family: "Helvetica", "Arial", sans-serif; + font-size: 11px; +} + +/** links **/ +a { + color: #000066; + text-decoration: none; +} + +/** input fields (e.g. village chats) **/ +input { + font-family: "Courier New", "Lucida Console", monospace; + font-size: 11px; + background-color: #ece7df; + border: 1px solid #666666; + color: #222222; +} + +/** select boxes (e.g. user preference drop-downs) **/ +select { + background-color: #ece7df; + border: 1px solid #666666; + color: #333333; +} + +/* -------------------------------------------------------------------- +** Global Classes +*/ + +/** the main page heading (e.g. "Degolburg, the Capital City", "LoGD News") **/ +.pagetitle { + font-family: "Helvetica", "Arial", sans-serif; + font-size: 16px; + font-weight: bold; + font-style: italic; + color: #000000; +} + +/** nav menu categories (e.g. City Gates, Store Street, Info) **/ +.navhead { + text-decoration: none; + width: 200px; + border: thin #cccccc; + height: auto; + padding: 1px; + line-height: 18px; + float: left; + clear: none; + background-color: #ffffff; + font-weight: bold; + color: #000000; + cursor: default; + text-align: left; +} + +/** help for nav menu categories **/ +.navhelp { + text-decoration: none; + width: 200px; + height: auto; + padding: 1px; + float: left; + clear: none; + border: thin none #003366; + cursor: default; +} + +/** nav hot keys (e.g. [F]orest, [T]ravel) **/ +.navhi { + color: #0000cc; + text-decoration: underline; +} + +/** input fields (e.g. the textarea in YOMs) **/ +.input { + background-color: #ece7df; + border: 1px solid #666666; + color: #222222; +} + +/** input buttons (e.g. Submit, Search, Add) **/ +.button { + font-family: "Courier New", "Lucida Console", monospace; + font-size: 12px; + color: #ffffff; + background-color: #938f87; + border-top: 1px solid #cccccc; + border-left: 1px solid #cccccc; + border-right: 1px solid #333333; + border-bottom: 1px solid #333333; +} + +/** text colours **/ +.colDkBlue { color: #000066; } +.colDkGreen { color: #006600; } +.colDkCyan { color: #006666; } +.colDkRed { color: #660000; } +.colDkMagenta { color: #660066; } +.colDkYellow { color: #666600; } +.colDkWhite { color: #666666; } +.colLtBlue { color: #0000aa; } +.colLtGreen { color: #00aa00; } +.colLtCyan { color: #00aaaa; } +.colLtRed { color: #aa0000; } +.colLtMagenta { color: #aa00aa; } +.colLtYellow { color: #aaaa00; } +.colLtWhite { color: #333333; } +.colLtBlack { color: #999999; } +.colDkOrange { color: #994400; } +.colLtOrange { color: #ff9900; } +.colBlue { color: #0070FF; } +.colLime { color: #DDFFBB; } +.colBlack { color: #000000; } +.colRose { color: #EEBBEE; } +.colblueviolet { color: #9A5BEE; } +.coliceviolet { color: #AABBEE; } +.colLtBrown { color: #F8DB83; } +.colDkBrown { color: #6b563f; } +.colXLtGreen { color: #aaff99; } +.colAttention { background-color: #00FF00; color: #FF0000; } +.colWhiteBlack { background-color: #FFFFFF; color: #000000; } +.colBack { background-color: #00FFFF; color: #000000; } +.colbeige { color: #F5F5DC; } +.colkhaki { color: #F0E68C; } +.coldarkkhaki { color: #BDB76B; } +.colaquamarine { color: #7FFFD4; } +.coldarkseagreen { color: #8FBC8F; } +.collightsalmon { color: #FFA07A; } +.colsalmon { color: #FA8072; } +.colwheat { color: #F5DEB3; } +.coltan { color: #D2B48C; }.colLtLinkBlue { color: #0099FF; } +.colDkLinkBlue { color: #006BB3; } +.colDkRust { color: #8D6060; } +.colLtRust { color: #B07878; } +.colMdBlue { color: #0000F0; } +.colMdGrey { color: #DDDDDD; } +.colburlywood { color: #DEB887; } + +/** table rows (e.g. Game Setup Info, Hall o' Fame) **/ +.trhead { background-color:#605c54; color:#ffffff; } +.trlight { background-color:#ece7df; color:#333333; } +.trdark { background-color:#c6c2ba; color:#333333; } +.trhilight { background-color: #d4d0c8; color: #333333} + +/* -------------------------------------------------------------------- +** Specific Tags and Classes +*/ + +/** links - navigation **/ +a.nav { /* nav link (e.g. Forest, Quit, Travel) */ + text-decoration: none; + width: 182px; + height: auto; + padding: 1px 1px 1px 20px; + float: left; + clear: none; +} +a:hover.nav { /* nav link on mouseover */ + background-color: #ece7df; +} + +/** links - motd **/ +a.motd { /* for motd, yom, and petition */ + text-decoration: none; + text-align: center; + color:#000000; + width: 100px; + height: 14px; + clear: none; + background-color: #d4d0c8; +} +a:hover.motd { /* mouseover for motd, yom, and petition */ + height: 14px; + width: 100px; + background-color: #d4d0c8; + color: #aa0000; +} +a.hotmotd { /* when a new motd or yom is available */ + font-weight: bold; + text-decoration: none; + text-align: center; + color:#aa0000; + width: 100px; + height: auto; + clear: none; + background-color: #d4d0c8; +} + +/** links - translator tool **/ +a.t { + width: 10px; + height: 10px; + border: 1px dotted #0000ff; + background-color: #ffffff; + color: #000000; + font-size: 10px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} +a.thot { + width: 10px; + height: 10px; + border: 1px solid #ff0000; + background-color: #ffffff; + color: #000000; + font-size: 10px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +/** tables - login **/ +table.login { + height: 200px; + width: 232px; + background-image: url(vcpp/login.gif); + background-repeat: no-repeat; +} + +/** tables - navigation **/ +table.nav { + background-color: #ffffff; + border: medium ridge #eeeeee; + width: 200px; +} +td.nav a.thot { + position: absolute; + left: 0px; + height: auto; +} +td.nav a.t { + position: absolute; + left: 0px; + height: auto; +} + +/** tables - character stats (i.e. "vital info") **/ +table.vitalinfo { /* the whole vital info 'wrapper' table */ + background-color: #ffffff; + border: medium ridge #eeeeee; + width: 200px; +} +table.charinfo { /* the sub-table with the data */ + background-color: #ffffff; + width: 200px; +} +td.charhead { /* vital info category heading */ + background-color: #d4d0c8; + border: none; + cursor: default; + color: #333333; +} +td.charinfo { /* vital info data */ + padding-left: 20px; + border-top: thin solid #d4d0c8; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + cursor: default; + color: #333333; +} + +/** tables - main page **/ +td.pageheader { /* heading for the main page */ + background-color: #d4d0c8; + background-image: url(vcpp/mainhdr.gif); + background-repeat: no-repeat; + height: 85px; +} +td.body { + font-family: "Courier New", "Lucida Console", monospace; + font-size: 12px; +} + +/** tables - popups **/ +td.popupheader { /* heading in a popup (e.g. motd, yom)*/ + background-color: #d4d0c8; + height: 50px; +} + +/** tables - footers **/ +table.noborder { /* table in the footer */ + border: none; + height: 75px; +} +td.footer { /* data for a footer */ + background-image: url(../images/rule.gif); + background-repeat: repeat-x; + background-position: top; +} +td.noborder { /* borderless data in the footer */ + font-family: "Courier New", "Lucida Console", monospace; + font-size: 12px; + border: none; +} + +/** debugging **/ +div.debug { + background-color: #605c54; + color: #ffffff; + border: 1px dotted #ffffff; + width: auto; + height: auto; + font-size: 11px; +} diff --git a/lotgd-web/lotgd/templates/vcpp.htm b/lotgd-web/lotgd/templates/vcpp.htm new file mode 100755 index 0000000..44626f5 --- /dev/null +++ b/lotgd-web/lotgd/templates/vcpp.htm @@ -0,0 +1,188 @@ + + + + +{title} + +{headscript}{script} + + + + + + + + + + + + +
+
{title}
+
+ +
+
+ + + + +
+ {copyright}Design: vcpp skin by + Ben Wong +
+
+ + + + + + +{title} + +{headscript}{script} + + + + + + + + + + + + + + + + + + + +
+
{navad}
+ [header] +
+ + + + + +
+
+ {headerad}{bodyad} + + {petitiondisplay} +
+ [heading] + + + + +
{stats}
+
+ {paypal}{verticalad} +
+
+ + + + + + + + +
+ {copyright}Design: vcpp skin by + Ben Wong + ({pagegen}) + + {source} +

+ {version} +
+ +
+
+ + + + — {title} —
+ + {text}
+ + {text}
+ + + + + + + + + + + + + + + + + + + +
{title}
{title}{value}
{title}
{value}
+ + + + + +
{petitioncount}
+ + + +
{content}
+ +

+ + + + + + + + + + + + + + + + + + + + + + diff --git a/lotgd-web/lotgd/templates/vcpp/ftrtabs.gif b/lotgd-web/lotgd/templates/vcpp/ftrtabs.gif new file mode 100755 index 0000000..2b5aafc Binary files /dev/null and b/lotgd-web/lotgd/templates/vcpp/ftrtabs.gif differ diff --git a/lotgd-web/lotgd/templates/vcpp/login.gif b/lotgd-web/lotgd/templates/vcpp/login.gif new file mode 100755 index 0000000..e51b33f Binary files /dev/null and b/lotgd-web/lotgd/templates/vcpp/login.gif differ diff --git a/lotgd-web/lotgd/templates/vcpp/mainhdr.gif b/lotgd-web/lotgd/templates/vcpp/mainhdr.gif new file mode 100755 index 0000000..b7ae2b7 Binary files /dev/null and b/lotgd-web/lotgd/templates/vcpp/mainhdr.gif differ diff --git a/lotgd-web/lotgd/templates/vcpp/tblhdr.gif b/lotgd-web/lotgd/templates/vcpp/tblhdr.gif new file mode 100755 index 0000000..7e3ac06 Binary files /dev/null and b/lotgd-web/lotgd/templates/vcpp/tblhdr.gif differ diff --git a/lotgd-web/lotgd/templates/volcano.css b/lotgd-web/lotgd/templates/volcano.css new file mode 100755 index 0000000..15ab531 --- /dev/null +++ b/lotgd-web/lotgd/templates/volcano.css @@ -0,0 +1,271 @@ +/* CSS Document */ +caption { + white-space: nowrap; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; +} +td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; +} + +table.nav { + background-color: #370800; + border: 1px solid #000000; + height: auto; + width: 182px; +} + +.navhead { + text-decoration: none; + width: 180px; + height: auto; + padding: 1px; + line-height: 18px; + float: left; + clear: none; + background-color: #370800; + font-weight: bold; + color: #FF0000; + cursor: default; + text-align: center; + font-variant: small-caps; +} + +a { + color: #B1B1B1; + text-decoration: none; +} + +a.nav { + color: #B1B1B1; + text-decoration: none; + width: 181px; + height: auto; + padding: 1px; + float: left; + clear: none; + background-color: #370800; + border: 1px solid #370800; + text-align: left; +} + +.navhelp { + text-decoration: none; + width: 181px; + height: auto; + padding: 1px; + float: left; + clear: none; + background-color: #5D0101; + border: 1px solid #5D0101; +} + +a:hover.nav { + background-color: #5D0101; + border-top: 1px solid #940202; + border-left: 1px solid #940202; + border-bottom: 1px solid #390101; + border-right: 1px solid #390101; +} +a.navhilite { + text-decoration: none; + width: 150px; + height: auto; + padding: 1px; + float: right; + clear: none; + color:#FF0000; + background-color: #330000; + border-top: thin solid #330000; + border-bottom: thin solid #330000; + border-right: thin none #330000; + border-left: thin none #330000; +} +a:hover.navhilite { + background-color: #CC0000; + border-top: thin outset #CC0000; + border-right: thin none #CC0000; + border-bottom: thin outset #CC0000; + border-left: thin none #CC0000; +} + + +table { +} +td.charinfo { + border-top-width: 1px; + border-top-style: solid; + border-top-color: #990000; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + cursor: default; +} +td.charhead { + background-color: #990000; + border: none; + cursor: default; + color: #999999; +} +table.charinfo { + border: none; + width: 182px; +} +td.popupheader { + background-color: #333399; + background-image: url(../images/headbkg.GIF); + height: 20px; +} +td.noborder { + border: none; +} +table.noborder { + border: none; +} +input { + background-color: #5D0101; + border: 1px solid #390101; + color: #CCCCCC; +} +.button { +font-family: verdana,arial,helvetica,sans-serif; + font-size: 12px; + color: #FFFFFF; + background-color: #5D0101; + border-top: 1px solid #940202; + border-left: 1px solid #940202; + border-right: 1px solid #390101; + border-bottom: 1px solid #390101; +} +.input { + background-color: #5D0101; + border: 1px solid #390101; + color: #CCCCCC; +} +select { + background-color: #5D0101; + border: 1px solid #AD6161; + color: #CCCCCC; +} +table.vitalinfo { + background-color: #330000; + border: 1px solid #000000; + width: 182px; +} +a.motd { + text-decoration: none; + color:#919191; +} +a:hover.motd { + font-weight: normal; + color:#FF0000; +} + +a.hotmotd { + font-weight: normal; + color:#FF0000; +} + +.pagetitle { + font-family: "Arial Black", "Courier"; + font-variant: small-caps; + font-size: 20px; + color: #666666; +} +.navhi { + color: #DD0000; + text-decoration: underline; +} + +td.nav a.thot { + position: absolute; + left: 0px; + height: auto; +} +td.nav a.t { + position: absolute; + left: 0px; + height: auto; +} + +a.t { + width: 7px; + height: 7px; + border: 1px dotted #0000FF; + background-color: #9999FF; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +a.thot { + width: 7px; + height: 7px; + border: 1px dotted #FF0000; + background-color: #FF9999; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +div.debug { + background-color: #FFFFFF; + color: #000000; + border: 1px dotted #000000; + width: auto; + height: auto; + font-size: 10px; +} +.colDkBlue { color: #0000B0; } +.colDkGreen { color: #00B000; } +.colDkCyan { color: #00B0B0; } +.colDkRed { color: #B00000; } +.colDkMagenta { color: #B000B0; } +.colDkYellow { color: #B0B000; } +.colDkWhite { color: #B0B0B0; } +.colLtBlue { color: #0000FF; } +.colLtGreen { color: #00FF00; } +.colLtCyan { color: #00FFFF; } +.colLtRed { color: #FF0000; } +.colLtMagenta { color: #FF00FF; } +.colLtYellow { color: #FFFF00; } +.colLtWhite { color: #FFFFFF; } +.colLtBlack { color: #777777; } +.colDkOrange { color: #995500; } +.colLtOrange { color: #FF9900; } +.colBlue { color: #0070FF; } +.colLime { color: #DDFFBB; } +.colBlack { color: #000000; } +.colRose { color: #EEBBEE; } +.colblueviolet { color: #9A5BEE; } +.coliceviolet { color: #AABBEE; } +.colLtBrown { color: #F8DB83; } +.colDkBrown { color: #6b563f; } +.colXLtGreen { color: #aaff99; } +.colAttention { background-color: #00FF00; color: #FF0000;} +.colWhiteBlack { background-color: #FFFFFF; color: #000000; } +.colBack { background-color: #00FFFF; color: #000000; } +.colbeige { color: #F5F5DC; } +.colkhaki { color: #F0E68C; } +.coldarkkhaki { color: #BDB76B; } +.colaquamarine { color: #7FFFD4; } +.coldarkseagreen { color: #8FBC8F; } +.collightsalmon { color: #FFA07A; } +.colsalmon { color: #FA8072; } +.colwheat { color: #F5DEB3; } +.coltan { color: #D2B48C; }.colLtLinkBlue { color: #0099FF; } +.colDkLinkBlue { color: #006BB3; } +.colDkRust { color: #8D6060; } +.colLtRust { color: #B07878; } +.colMdBlue { color: #0000F0; } +.colMdGrey { color: #DDDDDD; } +.colburlywood { color: #DEB887; } +.trhead { background-color:#660000; color:#FFFFFF; } +.trlight { background-color:#400000; } +.trdark { background-color:#300000; } +.trhilight { background-color: #333333; } diff --git a/lotgd-web/lotgd/templates/volcano.htm b/lotgd-web/lotgd/templates/volcano.htm new file mode 100755 index 0000000..20e88d6 --- /dev/null +++ b/lotgd-web/lotgd/templates/volcano.htm @@ -0,0 +1,306 @@ + + + + + {title} + + {headscript}{script} + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
• {title}
+
+ + + + + + + + + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
{copyright}Design: Volcano Template © 2004 JT Traub
based on Jade Template by Josh Canning of HFS
+
+
+ + + + + + + {title} + + {headscript}{script} + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + + + + + + +
• {title}
+
+
{headerad}
+
{motd} | {mail} | {petition}
{petitiondisplay}
+
+
+ + + + + +
+ + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
{verticalad}
{bodyad} + +
+ + + + + + + + + + + + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + +
+ + + + + +
{copyright}Design: Volcano Template © 2004 JT Traub
based on Jade Template by Josh Canning of HFS
{source}
{version}
({pagegen})
+
+
+ + + + + + + + + + + +
{title}
{title}{value}
{title}:
{value}
+ +—{title}—
+ +{text}
+ +{text}
+ +
{petitioncount}
+ + + + + + + + + + + + + + + + + +
{content}
+ + + + + + + + +
+ + + + + + + + + + + + +
{username}:{password}:

+
+ + + + + + + + +
+ + + + +
Server Full!
+
diff --git a/lotgd-web/lotgd/templates/volcano/blc.gif b/lotgd-web/lotgd/templates/volcano/blc.gif new file mode 100755 index 0000000..83be5f9 Binary files /dev/null and b/lotgd-web/lotgd/templates/volcano/blc.gif differ diff --git a/lotgd-web/lotgd/templates/volcano/brc.gif b/lotgd-web/lotgd/templates/volcano/brc.gif new file mode 100755 index 0000000..a5d27b0 Binary files /dev/null and b/lotgd-web/lotgd/templates/volcano/brc.gif differ diff --git a/lotgd-web/lotgd/templates/volcano/btm.gif b/lotgd-web/lotgd/templates/volcano/btm.gif new file mode 100755 index 0000000..e7b809c Binary files /dev/null and b/lotgd-web/lotgd/templates/volcano/btm.gif differ diff --git a/lotgd-web/lotgd/templates/volcano/logo.gif b/lotgd-web/lotgd/templates/volcano/logo.gif new file mode 100755 index 0000000..4c2aea2 Binary files /dev/null and b/lotgd-web/lotgd/templates/volcano/logo.gif differ diff --git a/lotgd-web/lotgd/templates/volcano/logo.jpg b/lotgd-web/lotgd/templates/volcano/logo.jpg new file mode 100755 index 0000000..d6300a5 Binary files /dev/null and b/lotgd-web/lotgd/templates/volcano/logo.jpg differ diff --git a/lotgd-web/lotgd/templates/volcano/logo2.gif b/lotgd-web/lotgd/templates/volcano/logo2.gif new file mode 100755 index 0000000..08b992d Binary files /dev/null and b/lotgd-web/lotgd/templates/volcano/logo2.gif differ diff --git a/lotgd-web/lotgd/templates/volcano/spacer.gif b/lotgd-web/lotgd/templates/volcano/spacer.gif new file mode 100755 index 0000000..5bfd67a Binary files /dev/null and b/lotgd-web/lotgd/templates/volcano/spacer.gif differ diff --git a/lotgd-web/lotgd/templates/volcano/tlc.gif b/lotgd-web/lotgd/templates/volcano/tlc.gif new file mode 100755 index 0000000..0cfe951 Binary files /dev/null and b/lotgd-web/lotgd/templates/volcano/tlc.gif differ diff --git a/lotgd-web/lotgd/templates/volcano/tlt.gif b/lotgd-web/lotgd/templates/volcano/tlt.gif new file mode 100755 index 0000000..75e4cb9 Binary files /dev/null and b/lotgd-web/lotgd/templates/volcano/tlt.gif differ diff --git a/lotgd-web/lotgd/templates/volcano/tm.gif b/lotgd-web/lotgd/templates/volcano/tm.gif new file mode 100755 index 0000000..ef09394 Binary files /dev/null and b/lotgd-web/lotgd/templates/volcano/tm.gif differ diff --git a/lotgd-web/lotgd/templates/volcano/trc.gif b/lotgd-web/lotgd/templates/volcano/trc.gif new file mode 100755 index 0000000..59bee06 Binary files /dev/null and b/lotgd-web/lotgd/templates/volcano/trc.gif differ diff --git a/lotgd-web/lotgd/templates/volcano/trt.gif b/lotgd-web/lotgd/templates/volcano/trt.gif new file mode 100755 index 0000000..38df917 Binary files /dev/null and b/lotgd-web/lotgd/templates/volcano/trt.gif differ diff --git a/lotgd-web/lotgd/templates/yar2.css b/lotgd-web/lotgd/templates/yar2.css new file mode 100755 index 0000000..bdf7fa2 --- /dev/null +++ b/lotgd-web/lotgd/templates/yar2.css @@ -0,0 +1,263 @@ +/* CSS Document */ +caption { + white-space: nowrap; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} +td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; +} + +table.nav { + background-color: #000033; + border: 1px solid #000000; + height: auto; + width: 135px; +} + +.navhead { + text-decoration: none; + width: 137px; + height: auto; + padding: 1px; + line-height: 18px; + float: left; + clear: none; + background-color: #000099; + font-weight: bold; + color: #FFFF00; + cursor: default; + text-align: center; +} + +a { + color: #0099FF; + text-decoration: none; +} + +a.nav { + text-decoration: none; + width: 135px; + height: auto; + padding: 1px; + float: left; + clear: none; + background-color: #000033; + border: 1px solid #000033; +} + +.navhelp { + text-decoration: none; + width: 135px; + height: auto; + padding: 1px; + float: left; + clear: none; + background-color: #000033; + border: 1px solid #000033; +} + +a:hover.nav { + background-color: #003366; + border-top: 1px solid #0364A3; + border-left: 1px solid #0364A3; + border-bottom: 1px solid #000000; + border-right: 1px solid #000000; +} +a.navhilite { + text-decoration: none; + width: 135px; + height: auto; + padding: 1px; + float: right; + clear: none; + color:#FFFF00; + background-color: #330000; + border-top: thin solid #330000; + border-bottom: thin solid #330000; + border-right: thin none #330000; + border-left: thin none #330000; +} +a:hover.navhilite { + background-color: #990000; + border-top: thin outset #CC0000; + border-right: thin none #CC0000; + border-bottom: thin outset #CC0000; + border-left: thin none #CC0000; +} + + +table { +} +td.charinfo { + border-top-width: 1px; + border-top-style: solid; + border-top-color: #009900; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + cursor: default; +} +td.charhead { + background-color: #009900; + border: none; + cursor: default; + color: #FFFF00; +} +table.charinfo { + border: none; + width: 140px; +} +td.pageheader { + background-color: #333399; + background-image: url(../images/headbkg.GIF); + height: 60px; +} +td.popupheader { + background-color: #333399; + background-image: url(../images/headbkg.GIF); + height: 20px; +} +td.noborder { + border: none; +} +table.noborder { + border: none; +} +input { + background-color: #433828; + border: 1px solid #806B4D; + color: #CCCCCC; +} +.button { +font-family: verdana,arial,helvetica,sans-serif; + font-size: 12px; + color: #F8DB83; + background-color: #6b563f; + border-top: 1px solid #947356; + border-left: 1px solid #947356; + border-right: 1px solid #403225; + border-bottom: 1px solid #403225; +} +.input { + background-color: #433828; + border: 1px solid #806B4D; + color: #CCCCCC; +} +select { + background-color: #433828; + border: 1px solid #806B4D; + color: #CCCCCC; +} +table.vitalinfo { + background-color: #003300; + border: 1px solid #000000; + width: 182px; +} +a.motd { + text-decoration: none; + color:#FF9900; +} +a:hover.motd { + font-weight: bold; +} + +a.hotmotd { + font-weight: bold; +} +.pagetitle { + font-family: "Old English Text MT", "Times New Roman"; + font-size: 20px; + color: #FFFFFF; +} +td.footer { + background-image: url(../images/rule.gif); + background-repeat: repeat-x; + background-position: top; +} +.navhi { + color: #00FF00; + text-decoration: underline; +} + +a.t { + width: 7px; + height: 7px; + border: 1px dotted #0000FF; + background-color: #9999FF; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +a.thot { + width: 7px; + height: 7px; + border: 1px dotted #FF0000; + background-color: #FF9999; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +div.debug { + background-color: #FFFFFF; + color: #000000; + border: 1px dotted #000000; + width: auto; + height: auto; + font-size: 10px; +} +.colDkBlue { color: #0000B0; } +.colDkGreen { color: #00B000; } +.colDkCyan { color: #00B0B0; } +.colDkRed { color: #B00000; } +.colDkMagenta { color: #B000CC; } +.colDkYellow { color: #B0B000; } +.colDkWhite { color: #B0B0B0; } +.colLtBlue { color: #0000FF; } +.colLtGreen { color: #00FF00; } +.colLtCyan { color: #00FFFF; } +.colLtRed { color: #FF0000; } +.colLtMagenta { color: #FF00FF; } +.colLtYellow { color: #FFFF00; } +.colLtWhite { color: #FFFFFF; } +.colLtBlack { color: #999999; } +.colDkOrange { color: #994400; } +.colLtOrange { color: #FF9900; } +.colBlue { color: #0070FF; } +.colLime { color: #DDFFBB; } +.colBlack { color: #000000; } +.colRose { color: #EEBBEE; } +.colblueviolet { color: #9A5BEE; } +.coliceviolet { color: #AABBEE; } +.colLtBrown { color: #F8DB83; } +.colDkBrown { color: #6b563f; } +.colXLtGreen { color: #aaff99; } +.colAttention { background-color: #00FF00; color: #FF0000; } +.colWhiteBlack { background-color: #FFFFFF; color: #000000; } +.colBack { background-color: #00FFFF; color: #000000; } +.colbeige { color: #F5F5DC; } +.colkhaki { color: #F0E68C; } +.coldarkkhaki { color: #BDB76B; } +.colaquamarine { color: #7FFFD4; } +.coldarkseagreen { color: #8FBC8F; } +.collightsalmon { color: #FFA07A; } +.colsalmon { color: #FA8072; } +.colwheat { color: #F5DEB3; } +.coltan { color: #D2B48C; }.colLtLinkBlue { color: #0099FF; } +.colDkLinkBlue { color: #006BB3; } +.colDkRust { color: #8D6060; } +.colLtRust { color: #B07878; } +.colMdBlue { color: #0000F0; } +.colMdGrey { color: #DDDDDD; } +.colburlywood { color: #DEB887; } +.trhead { background-color:#990000; color:#FFFFFF; } +.trlight { background-color:#330000; } +.trhilight { background-color:#550000; } +.trdark { background-color:#000000; } diff --git a/lotgd-web/lotgd/templates/yar2.htm b/lotgd-web/lotgd/templates/yar2.htm new file mode 100755 index 0000000..27d05cb --- /dev/null +++ b/lotgd-web/lotgd/templates/yar2.htm @@ -0,0 +1,151 @@ + + + + +{title} + +{headscript}{script} + + + + + + + + + + + + +
+ +
+ + + + + + +{title} + +{headscript}{script} + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
{navad}
+ + + +
{paypal}
+{headerad}{bodyad} + +
+ + + + +
+
{verticalad}
+
+ + + + + + + + + + + +
{title}
{title}{value}
{title}
{value}
+ +—{title}—
+ +{text}
+ +{text}
+• {petitioncount} + + + +
{content}
+ + + + + + + + +
+ + + + + + + + + + + + +
{username}:{password}:

+
+ + + + + + + + +
+ + + + +
Server Full!
+
diff --git a/lotgd-web/lotgd/templates/yarbrough.css b/lotgd-web/lotgd/templates/yarbrough.css new file mode 100755 index 0000000..60e535b --- /dev/null +++ b/lotgd-web/lotgd/templates/yarbrough.css @@ -0,0 +1,283 @@ +/* CSS Document */ +caption { + white-space: nowrap; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; +} +td { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; +} +a{ + color: #0099FF; + text-decoration: none; +} +a.nav { + text-decoration: none; + width: 181px; + height: auto; + padding: 1px; + float: left; + clear: none; + border-top: thin solid #003366; + border-bottom: thin solid #003366; + border-right: thin none #003366; + border-left: thin none #003366; +} +a:hover.nav { + background-color: #003366; + border-top: thin outset #003366; + border-right: thin none #003366; + border-bottom: thin outset #003366; + border-left: thin none #003366; +} +a.navhilite { + text-decoration: none; + width: 150px; + height: auto; + padding: 1px; + float: right; + clear: none; + color:#FFFF00; + background-color: #330000; + border-top: thin solid #330000; + border-bottom: thin solid #330000; + border-right: thin none #330000; + border-left: thin none #330000; +} +a:hover.navhilite { + background-color: #990000; + border-top: thin outset #CC0000; + border-right: thin none #CC0000; + border-bottom: thin outset #CC0000; + border-left: thin none #CC0000; +} +.navhelp { + text-decoration: none; + width: 181px; + height: auto; + padding: 1px; + float: left; + clear: none; + border-top: thin solid #003366; + border-bottom: thin solid #003366; + border-right: thin none #003366; + border-left: thin none #003366; + cursor: default; +} +.navhead { + text-decoration: none; + width: 180px; + border: thin #003366; + height: auto; + padding: 1px; + line-height: 18px; + float: left; + clear: none; +/* background-color: #000066; */ + font-weight: bold; + color: #00CCFF; + cursor: default; + text-align: center; +} +table { +} +td.charinfo { + border-top-width: 1px; + border-top-style: solid; + border-top-color: #009900; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + cursor: default; +} +td.charhead { + background-color: #009900; + border: none; + cursor: default; + color: #FFFF00; +} +table.charinfo { + border: none; + width: 182px; +} +td.pageheader { + background-color: #333399; + background-image: url(../images/headbkg.GIF); + height: 69px; +} +td.popupheader { + background-color: #333399; + background-image: url(../images/headbkg.GIF); + height: 20px; +} +td.noborder { + border: none; +} +table.noborder { + border: none; +} +input { + background-color: #433828; + border: 1px solid #806B4D; + color: #CCCCCC; +} +.button { +font-family: verdana,arial,helvetica,sans-serif; + font-size: 12px; + color: #F8DB83; + background-color: #6b563f; + border-top: 1px solid #947356; + border-left: 1px solid #947356; + border-right: 1px solid #403225; + border-bottom: 1px solid #403225; +} +.input { + background-color: #433828; + border: 1px solid #806B4D; + color: #CCCCCC; +} +select { + background-color: #433828; + border: 1px solid #806B4D; + color: #CCCCCC; +} +table.vitalinfo { + background-color: #003300; + border: 1px solid #000000; + width: 182px; +} +table.nav { + background-color: #003366; + border: 1px solid #000000; + width: 182px; +} +a.motd { + text-decoration: none; + text-align: center; + color:#FF9900; + width: 179px; + height: 14px; + padding: 1px; + float: left; + clear: none; + background-color: #433828; + border: thin solid #433828; +} +a:hover.motd { + height: 14px; + width: 179px; + background-color: #806B4D; + border: thin solid #FF9900; +} +a.hotmotd { + text-decoration: none; + text-align: center; + color:#FF9900; + width: 181px; + height: auto; + padding: 1px; + float: left; + clear: none; + + background-color: #806B4D; + border-top: thin solid #FF9900; + border-bottom: thin solid #FF9900; + border-right: thin solid #FF9900; + border-left: thin solid #FF9900; +} +.pagetitle { + font-family: "Old English Text MT", "Times New Roman"; + font-size: 20px; + color: #FFFFFF; +} +td.footer { + background-image: url(../images/rule.gif); + background-repeat: repeat-x; + background-position: top; +} +.navhi { + color: #00FF00; + text-decoration: underline; +} + +a.t { + width: 7px; + height: 7px; + border: 1px dotted #0000FF; + background-color: #9999FF; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +a.thot { + width: 7px; + height: 7px; + border: 1px dotted #FF0000; + background-color: #FF9999; + color: #FFFFFF; + font-size: 7px; + text-decoration: none; + padding-left: 1px; + padding-right: 1px; +} + +div.debug { + background-color: #FFFFFF; + color: #000000; + border: 1px dotted #000000; + width: auto; + height: auto; + font-size: 10px; +} +.colDkBlue { color: #0000B0; } +.colDkGreen { color: #00B000; } +.colDkCyan { color: #00B0B0; } +.colDkRed { color: #B00000; } +.colDkMagenta { color: #B000CC; } +.colDkYellow { color: #B0B000; } +.colDkWhite { color: #B0B0B0; } +.colLtBlue { color: #0000FF; } +.colLtGreen { color: #00FF00; } +.colLtCyan { color: #00FFFF; } +.colLtRed { color: #FF0000; } +.colLtMagenta { color: #FF00FF; } +.colLtYellow { color: #FFFF00; } +.colLtWhite { color: #FFFFFF; } +.colLtBlack { color: #999999; } +.colDkOrange { color: #994400; } +.colLtOrange { color: #FF9900; } +.colBlue { color: #0070FF; } +.colLime { color: #DDFFBB; } +.colBlack { color: #000000; } +.colRose { color: #EEBBEE; } +.colblueviolet { color: #9A5BEE; } +.coliceviolet { color: #AABBEE; } +.colLtBrown { color: #F8DB83; } +.colDkBrown { color: #6b563f; } +.colXLtGreen { color: #aaff99; } +.colAttention { background-color: #00FF00; color: #FF0000; } +.colWhiteBlack { background-color: #FFFFFF; color: #000000; } +.colBack { background-color: #00FFFF; color: #000000; } +.colbeige { color: #F5F5DC; } +.colkhaki { color: #F0E68C; } +.coldarkkhaki { color: #BDB76B; } +.colaquamarine { color: #7FFFD4; } +.coldarkseagreen { color: #8FBC8F; } +.collightsalmon { color: #FFA07A; } +.colsalmon { color: #FA8072; } +.colwheat { color: #F5DEB3; } +.coltan { color: #D2B48C; }.colLtLinkBlue { color: #0099FF; } +.colDkLinkBlue { color: #006BB3; } +.colDkRust { color: #8D6060; } +.colLtRust { color: #B07878; } +.colMdBlue { color: #0000F0; } +.colMdGrey { color: #DDDDDD; } +.colburlywood { color: #DEB887; } +.trhead { background-color:#990000; color:#FFFFFF; } +.trlight { background-color:#330000; } +.trhilight { background-color:#550000; } +.trdark { background-color:#000000; } diff --git a/lotgd-web/lotgd/templates/yarbrough.htm b/lotgd-web/lotgd/templates/yarbrough.htm new file mode 100755 index 0000000..1c89590 --- /dev/null +++ b/lotgd-web/lotgd/templates/yarbrough.htm @@ -0,0 +1,142 @@ + + + + +{title} + +{headscript}{script} + + + + + + + + + + + + +
+ +
+ + + + + + +{title} + +{headscript}{script} + + + + + + + + + + + + + + + + + + +
+
{navad}
+ + + + + + + +
+ {motd}
+ {mail}
+ {petition}
{paypal}{verticalad}
{headerad}{bodyad} + + {petitiondisplay} +
+ + + + + +
{stats}
+
+ + + + + + + +
{title}
{title}{value}
{title}
{value}
+—{title}—
+{text}
+{text}
+
{petitioncount}
+ + + +
{content}
+ + + + + + + + +
+ + + + + + + + + + + + +
{username}:{password}:

+
+ + + + + + + + +
+ + + + +
Server Full!
+
diff --git a/lotgd-web/lotgd/titleedit.php b/lotgd-web/lotgd/titleedit.php new file mode 100755 index 0000000..ec4ba93 --- /dev/null +++ b/lotgd-web/lotgd/titleedit.php @@ -0,0 +1,183 @@ +"Title Id,hidden", + "dk"=>"Dragon Kills,int|0", + // "ref"=>"Arbitrary Tag,int", + "male"=>"Male Title,text|", + "female"=>"Female Title,text|", +); +addnav("Other"); +require_once("lib/superusernav.php"); +superusernav(); +addnav("Functions"); + +if ($op=="save") { + $male = httppost('male'); + $female = httppost('female'); + $dk = httppost('dk'); + // Ref is currently unused + // $ref = httppost('ref'); + $ref = ''; + + if ((int)$id == 0) { + $sql = "INSERT INTO ".db_prefix("titles")." (titleid,dk,ref,male,female) VALUES ($id,$dk,'$ref','$male','$female')"; + $note = "`^New title added.`0"; + $errnote = "`\$Unable to add title.`0"; + }else { + $sql = "UPDATE " . db_prefix("titles") . " SET dk=$dk,ref='$ref',male='$male',female='$female' WHERE titleid=$id"; + $note = "`^Title modified.`0"; + $errnote = "`\$Unable to modify title.`0"; + } + db_query($sql); + if (db_affected_rows() == 0) { + output($errnote); + rawoutput(db_error()); + } else { + output($note); + } + $op = ""; +} elseif ($op == "delete") { + $sql = "DELETE FROM ".db_prefix("titles")." WHERE titleid='$id'"; + db_query($sql); + output("`^Title deleted.`0"); + $op = ""; +} + +if ($op == ""){ + $sql = "SELECT * FROM ".db_prefix("titles")." ORDER BY dk, titleid"; + $result = db_query($sql); + if (db_num_rows($result)<1){ + output(""); + }else{ + $row = db_fetch_assoc($result); + } + output("`@`c`b-=Title Editor=-`b`c"); + $ops = translate_inline("Ops"); + $dks = translate_inline("Dragon Kills"); + // $ref is currently unused + // $reftag = translate_inline("Reference Tag"); + $mtit = translate_inline("Male Title"); + $ftit = translate_inline("Female Title"); + $edit = translate_inline("Edit"); + $del = translate_inline("Delete"); + $delconfirm = translate_inline("Are you sure you wish to delete this title?"); + rawoutput(""); + // reference tag is currently unused + // rawoutput(""); + rawoutput(""); + $result = db_query($sql); + $i = 0; + while($row = db_fetch_assoc($result)) { + $id = $row['titleid']; + rawoutput(""); + rawoutput(""); + addnav("","titleedit.php?op=edit&id=$id"); + addnav("","titleedit.php?op=delete&id=$id"); + rawoutput(""); + $i++; + } + rawoutput("
$ops$dks$reftag$mtit$ftit
$ops$dks$mtit$ftit
[$edit|$del]"); + output_notl("`&%s`0",$row['dk']); + rawoutput(""); + // reftag is currently unused + // output("`^%s`0", $row['ref']); + // output(""); + output_notl("`2%s`0",$row['male']); + rawoutput(""); + output_notl("`6%s`0",$row['female']); + rawoutput("
"); + //modulehook("titleedit", array()); + addnav("Functions"); + addnav("Add a Title", "titleedit.php?op=add"); + addnav("Refresh List", "titleedit.php"); + addnav("Reset Users Titles", "titleedit.php?op=reset"); + title_help(); +} elseif ($op=="edit" || $op=="add") { + require_once("lib/showform.php"); + if ($op=="edit"){ + $sql = "SELECT * FROM ".db_prefix("titles")." WHERE titleid='$id'"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + } elseif ($op=="add") { + $row = array('titleid'=>0, 'male'=>'', 'female'=>'', 'dk'=>0); + $id = 0; + } + rawoutput("
"); + addnav("","titleedit.php?op=save&id=$id"); + showform($editarray,$row); + rawoutput("
"); + addnav("Functions"); + addnav("Main Title Editor", "titleedit.php"); + title_help(); +} elseif ($op == "reset") { + require_once("lib/titles.php"); + require_once("lib/names.php"); + + output("`^Rebuilding all titles.`0`n`n"); + $sql = "SELECT name,title,dragonkills,acctid,sex,ctitle FROM " . db_prefix("accounts"); + $result = db_query($sql); + $number=db_num_rows($result); + for ($i=0;$i<$number;$i++){ + $row = db_fetch_assoc($result); + $oname = $row['name']; + $dk = $row['dragonkills']; + $otitle = $row['title']; + $dk = (int)($row['dragonkills']); + if (!valid_dk_title($otitle, $dk, $row['sex'])) { + $sex = translate_inline($row['sex']?"female":"male"); + $newtitle = get_dk_title($dk, (int)$row['sex']); + $newname = change_player_title($newtitle, $row); + $id = $row['acctid']; + if ($oname != $newname) { + output("`@Changing `^%s`@ to `^%s `@(%s`@ [%s,%s])`n", + $oname,$newname,$newtitle,$dk,$sex); + if ($session['user']['acctid']==$row['acctid']){ + $session['user']['title']=$newtitle; + $session['user']['name']=$newname; + }else{ + $sql = "UPDATE " . db_prefix("accounts") . " SET name='" . + addslashes($newname)."', title='". + addslashes($newtitle)."' WHERE acctid='$id'"; + db_query($sql); + } + }elseif ($otitle != $newtitle){ + output("`@Changing only the title (not the name) of `^%s`@ `@(%s`@ [%s,%s])`n", + $oname,$newtitle,$dk,$sex); + if ($session['user']['acctid']==$row['acctid']){ + $session['user']['title']=$newtitle; + }else{ + $sql = "UPDATE " . db_prefix("accounts") . + " SET title='".addslashes($newtitle) . + "' WHERE acctid='$id'"; + db_query($sql); + } + } + } + } + output("`n`n`^Done.`0"); + addnav("Main Title Editor", "titleedit.php"); +} + +function title_help() +{ + output("`#You can have multiple titles for a given dragon kill rank."); + output("If you do, one of those titles will be chosen at random to give to the player when a title is assigned.`n`n"); + output("You can have gaps in the title order."); + output("If you have a gap, the title given will be for the DK rank less than or equal to the players current number of DKs.`n"); +} + +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/train.php b/lotgd-web/lotgd/train.php new file mode 100755 index 0000000..310c3a1 --- /dev/null +++ b/lotgd-web/lotgd/train.php @@ -0,0 +1,274 @@ + 0 && $session['user']['level'] <= 14){ + $master = db_fetch_assoc($result); + $mid = $master['creatureid']; + $master['creaturename'] = stripslashes($master['creaturename']); + $master['creaturewin'] = stripslashes($master['creaturewin']); + $master['creaturelose'] = stripslashes($master['creaturelose']); + $master['creatureweapon'] = stripslashes($master['creatureweapon']); + if ($master['creaturename'] == "Gadriel the Elven Ranger" && + $session['user']['race'] == "Elf") { + $master['creaturewin'] = "You call yourself an Elf?? Maybe Half-Elf! Come back when you've been better trained."; + $master['creaturelose'] = "It is only fitting that another Elf should best me. You make good progress."; + } + $level = $session['user']['level']; + $dks = $session['user']['dragonkills']; + $exprequired=exp_for_next_level($level, $dks); + + $op = httpget('op'); + if ($op==""){ + checkday(); + output("The sound of conflict surrounds you. The clang of weapons in grisly battle inspires your warrior heart. "); + output("`n`n`^%s stands ready to evaluate you.`0", + $master['creaturename']); + addnav("Question Master","train.php?op=question&master=$mid"); + addnav("M?Challenge Master","train.php?op=challenge&master=$mid"); + if ($session['user']['superuser'] & SU_DEVELOPER) { + addnav("Superuser Gain level","train.php?op=challenge&victory=1&master=$mid"); + } + villagenav(); + }else if($op=="challenge"){ + if (httpget('victory')) { + $victory=true; + $defeat=false; + if ($session['user']['experience'] < $exprequired) + $session['user']['experience'] = $exprequired; + $session['user']['seenmaster'] = 0; + } + if ($session['user']['seenmaster']){ + output("You think that, perhaps, you've seen enough of your master for today, the lessons you learned earlier prevent you from so willingly subjecting yourself to that sort of humiliation again."); + villagenav(); + }else{ + /* OK, let's fix the multimaster thing */ + $session['user']['seenmaster'] = 1; + debuglog("Challenged master, setting seenmaster to 1"); + + if ($session['user']['experience']>=$exprequired){ + $dk = 0; + restore_buff_fields(); + while(list($key, $val)=each($session['user']['dragonpoints'])) { + if ($val=="at" || $val=="de") $dk++; + } + $dk += (int)(($session['user']['maxhitpoints'] - + ($session['user']['level']*10))/5); + + $dk = round($dk * .33, 0); + + $atkflux = e_rand(0, $dk); + $atkflux = min($atkflux, round($dk*.25)); + $defflux = e_rand(0, ($dk-$atkflux)); + $defflux = min($defflux, round($dk*.25)); + + $hpflux = ($dk - ($atkflux+$defflux)) * 5; + debug("DEBUG: $dk modification points total.`n"); + debug("DEBUG: +$atkflux allocated to attack.`n"); + debug("DEBUG: +$defflux allocated to defense.`n"); + debug("DEBUG: +".($hpflux/5)."*5 to hitpoints`n"); + calculate_buff_fields(); + + $master['creatureattack']+=$atkflux; + $master['creaturedefense']+=$defflux; + $master['creaturehealth']+=$hpflux; + $attackstack['enemies'][0] = $master; + $attackstack['options']['type'] = 'train'; + $session['user']['badguy']=createstring($attackstack); + + $battle=true; + if ($victory) { + $badguy = unserialize($session['user']['badguy']); + $badguy = $badguy['enemies'][0]; + output("With a flurry of blows you dispatch your master.`n"); + } + }else{ + output("You ready your %s and %s and approach `^%s`0.`n`n",$session['user']['weapon'],$session['user']['armor'],$master['creaturename']); + output("A small crowd of onlookers has gathered, and you briefly notice the smiles on their faces, but you feel confident. "); + output("You bow before `^%s`0, and execute a perfect spin-attack, only to realize that you are holding NOTHING!", $master['creaturename']); + output("`^%s`0 stands before you holding your weapon.",$master['creaturename']); + output("Meekly you retrieve your %s, and slink out of the training grounds to the sound of boisterous guffaws.",$session['user']['weapon']); + villagenav(); + } + } + }else if($op=="question"){ + checkday(); + output("You approach `^%s`0 timidly and inquire as to your standing in the class.",$master['creaturename']); + if($session['user']['experience']>=$exprequired){ + output("`n`n`^%s`0 says, \"Gee, your muscles are getting bigger than mine...\"",$master['creaturename']); + }else{ + output("`n`n`^%s`0 states that you will need `%%s`0 more experience before you are ready to challenge him in battle.",$master['creaturename'],($exprequired-$session['user']['experience'])); + } + addnav("Question Master","train.php?op=question&master=$mid"); + addnav("M?Challenge Master","train.php?op=challenge&master=$mid"); + if ($session['user']['superuser'] & SU_DEVELOPER) { + addnav("Superuser Gain level","train.php?op=challenge&victory=1&master=$mid"); + } + villagenav(); + }else if($op=="autochallenge"){ + addnav("Fight Your Master","train.php?op=challenge&master=$mid"); + output("`^%s`0 has heard of your prowess as a warrior, and heard of rumors that you think you are so much more powerful than he that you don't even need to fight him to prove anything. ",$master['creaturename']); + output("His ego is understandably bruised, and so he has come to find you."); + output("`^%s`0 demands an immediate battle from you, and your own pride prevents you from refusing the demand.",$master['creaturename']); + if ($session['user']['hitpoints']<$session['user']['maxhitpoints']){ + output("`n`nBeing a fair person, your master gives you a healing potion before the fight begins."); + $session['user']['hitpoints']=$session['user']['maxhitpoints']; + } + modulehook("master-autochallenge"); + if (getsetting('displaymasternews',1)) addnews("`3%s`3 was hunted down by their master, `^%s`3, for being truant.",$session['user']['name'],$master['creaturename']); + } + if ($op=="fight"){ + $battle=true; + } + if ($op=="run"){ + output("`\$Your pride prevents you from running from this conflict!`0"); + $op="fight"; + $battle=true; + } + + if($battle){ + require_once("lib/battle-skills.php"); + require_once("lib/extended-battle.php"); + suspend_buffs('allowintrain', "`&Your pride prevents you from using extra abilities during the fight!`0`n"); + suspend_companions("allowintrain"); + if (!$victory) { + require_once("battle.php"); + } + if ($victory){ + $badguy['creaturelose']=substitute_array($badguy['creaturelose']); + output_notl("`b`&"); + output($badguy['creaturelose']); + output_notl("`0`b`n"); + output("`b`\$You have defeated %s!`0`b`n",$badguy['creaturename']); + + $session['user']['level']++; + $session['user']['maxhitpoints']+=10; + $session['user']['soulpoints']+=5; + $session['user']['attack']++; + $session['user']['defense']++; + // Fix the multimaster bug + if (getsetting("multimaster", 1) == 1) { + $session['user']['seenmaster']=0; + debuglog("Defeated master, setting seenmaster to 0"); + } + output("`#You advance to level `^%s`#!`n",$session['user']['level']); + output("Your maximum hitpoints are now `^%s`#!`n",$session['user']['maxhitpoints']); + output("You gain an attack point!`n"); + output("You gain a defense point!`n"); + if ($session['user']['level']<15){ + output("You have a new master.`n"); + }else{ + output("None in the land are mightier than you!`n"); + } + if ($session['user']['referer']>0 && ($session['user']['level']>=getsetting("referminlevel",4) || $session['user']['dragonkills'] > 0) && $session['user']['refererawarded']<1){ + $sql = "UPDATE " . db_prefix("accounts") . " SET donation=donation+".getsetting("refereraward",25)." WHERE acctid={$session['user']['referer']}"; + db_query($sql); + $session['user']['refererawarded']=1; + $subj=array("`%One of your referrals advanced!`0"); + $body=array("`&%s`# has advanced to level `^%s`#, and so you have earned `^%s`# points!", $session['user']['name'], $session['user']['level'], getsetting("refereraward", 25)); + systemmail($session['user']['referer'],$subj,$body); + } + increment_specialty("`^"); + + // Level-Up companions + // We only get one level per pageload. So we just add the per-level-values. + // No need to multiply and/or substract anything. + if (getsetting("companionslevelup", 1) == true) { + $newcompanions = $companions; + foreach ($companions as $name => $companion) { + $companion['attack'] = $companion['attack'] + $companion['attackperlevel']; + $companion['defense'] = $companion['defense'] + $companion['defenseperlevel']; + $companion['maxhitpoints'] = $companion['maxhitpoints'] + $companion['maxhitpointsperlevel']; + $companion['hitpoints'] = $companion['maxhitpoints']; + $newcompanions[$name] = $companion; + } + $companions = $newcompanions; + } + + invalidatedatacache("list.php-warsonline"); + + addnav("Question Master","train.php?op=question"); + addnav("M?Challenge Master","train.php?op=challenge"); + if ($session['user']['superuser'] & SU_DEVELOPER) { + addnav("Superuser Gain level","train.php?op=challenge&victory=1"); + } + villagenav(); + if ($session['user']['age'] == 1) { + if (getsetting('displaymasternews',1)) addnews("`%%s`3 has defeated ".($session['user']['sex']?"her":"his")." master, `%%s`3 to advance to level `^%s`3 after `^1`3 day!!", $session['user']['name'],$badguy['creaturename'],$session['user']['level']); + } else { + if (getsetting('displaymasternews',1)) addnews("`%%s`3 has defeated ".($session['user']['sex']?"her":"his")." master, `%%s`3 to advance to level `^%s`3 after `^%s`3 days!!", $session['user']['name'],$badguy['creaturename'],$session['user']['level'],$session['user']['age']); + } + if ($session['user']['hitpoints'] < $session['user']['maxhitpoints']) + $session['user']['hitpoints'] = $session['user']['maxhitpoints']; + modulehook("training-victory", $badguy); + }elseif($defeat){ + $taunt = select_taunt_array(); + + if (getsetting('displaymasternews',1)) addnews("`%%s`5 has challenged their master, %s and lost!`n%s",$session['user']['name'],$badguy['creaturename'],$taunt); + $session['user']['hitpoints']=$session['user']['maxhitpoints']; + output("`&`bYou have been defeated by `%%s`&!`b`n",$badguy['creaturename']); + output("`%%s`\$ halts just before delivering the final blow, and instead extends a hand to help you to your feet, and hands you a complementary healing potion.`n",$badguy['creaturename']); + $badguy['creaturewin']=substitute_array($badguy['creaturewin']); + output_notl("`^`b"); + output($badguy['creaturewin']); + output_notl("`b`0`n"); + addnav("Question Master","train.php?op=question&master=$mid"); + addnav("M?Challenge Master","train.php?op=challenge&master=$mid"); + if ($session['user']['superuser'] & SU_DEVELOPER) { + addnav("Superuser Gain level","train.php?op=challenge&victory=1&master=$mid"); + } + villagenav(); + modulehook("training-defeat", $badguy); + }else{ + fightnav(false,false, "train.php?master=$mid"); + } + if ($victory || $defeat) { + unsuspend_buffs('allowintrain', "`&You now feel free to make use of your buffs again!`0`n"); + unsuspend_companions("allowintrain"); + } + } +}else{ + checkday(); + output("You stroll into the battle grounds."); + output("Younger warriors huddle together and point as you pass by."); + output("You know this place well."); + output("Bluspring hails you, and you grasp her hand firmly."); + output("There is nothing left for you here but memories."); + output("You remain a moment longer, and look at the warriors in training before you turn to return to the village."); + villagenav(); +} +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/translatortool.php b/lotgd-web/lotgd/translatortool.php new file mode 100755 index 0000000..f350415 --- /dev/null +++ b/lotgd-web/lotgd/translatortool.php @@ -0,0 +1,142 @@ +"); + rawoutput("$namespace
"); + rawoutput("$texta
"); + rawoutput("
"); + rawoutput("$translation
"); + rawoutput("
"); + rawoutput(""); + rawoutput(""); + rawoutput(""); + popup_footer(); +}elseif ($_GET['op']=='save'){ + $uri = httppost('uri'); + $text = httppost('text'); + $trans = httppost('trans'); + + $page = $uri; + if (strpos($page,"?")!==false) $page = substr($page,0,strpos($page,"?")); + + if ($trans==""){ + $sql = "DELETE "; + }else{ + $sql = "SELECT * "; + } + $sql .= " + FROM ".db_prefix("translations")." + WHERE language='".LANGUAGE."' + AND intext='$text' + AND (uri='$page' OR uri='$uri')"; + if ($trans>""){ + $result = db_query($sql); + invalidatedatacache("translations-".$uri."-".$language); + //invalidatedatacache("translations-".$namespace."-".$language); + if (db_num_rows($result)==0){ + $sql = "INSERT INTO ".db_prefix("translations")." (language,uri,intext,outtext,author,version) VALUES ('".LANGUAGE."','$uri','$text','$trans','{$session['user']['login']}','$logd_version ')"; + $sql1 = "DELETE FROM " . db_prefix("untranslated") . + " WHERE intext='$text' AND language='" . LANGUAGE . + "' AND namespace='$url'"; + db_query($sql1); + }elseif(db_num_rows($result)==1){ + $row = db_fetch_assoc($result); + // MySQL is case insensitive so we need to do it here. + if ($row['intext'] == $text){ + $sql = "UPDATE ".db_prefix("translations")." SET author='{$session['user']['login']}', version='$logd_version', uri='$uri', outtext='$trans' WHERE tid={$row['tid']}"; + }else{ + $sql = "INSERT INTO " . db_prefix("translations") . " (language,uri,intext,outtext,author,version) VALUES ('" . LANGUAGE . "','$uri','$text','$trans','{$session['user']['login']}','$logd_version ')"; + $sql1 = "DELETE FROM " . db_prefix("untranslated") . " WHERE intext='$text' AND language='" . LANGUAGE . "' AND namespace='$url'"; + db_query($sql1); + } + }elseif(db_num_rows($result)>1){ + $rows = array(); + while ($row = db_fetch_assoc($result)){ + // MySQL is case insensitive so we need to do it here. + if ($row['intext'] == $text){ + $rows['tid']=$row['tid']; + } + } + $sql = "UPDATE ".db_prefix("translations")." SET author='{$session['user']['login']}', version='$logd_version', uri='$page', outtext='$trans' WHERE tid IN (".join(",",$rows).")"; + } + } + db_query($sql); + if (httppost("savenotclose")>""){ + header("Location: translatortool.php?op=list&u=$page"); + exit(); + }else{ + popup_header("Updated"); + rawoutput(""); + popup_footer(); + } +}elseif($op=="list"){ + popup_header("Translation List"); + $sql = "SELECT uri,count(*) AS c FROM " . db_prefix("translations") . " WHERE language='".LANGUAGE."' GROUP BY uri ORDER BY uri ASC"; + $result = db_query($sql); + rawoutput("
"); + rawoutput(""); + output("Known Namespaces:"); + rawoutput(""); + $show = translate_inline("Show"); + rawoutput(""); + rawoutput("
"); + $ops = translate_inline("Ops"); + $from = translate_inline("From"); + $to = translate_inline("To"); + $version = translate_inline("Version"); + $author = translate_inline("Author"); + $norows = translate_inline("No rows found"); + rawoutput(""); + rawoutput(""); + $sql = "SELECT * FROM " . db_prefix("translations") . " WHERE language='".LANGUAGE."' AND uri='".httpget("u")."'"; + $result = db_query($sql); + if (db_num_rows($result)>0){ + $i=0; + while ($row = db_fetch_assoc($result)){ + $i++; + rawoutput(""); + } + }else{ + rawoutput(""); + } + rawoutput("
$ops$from$to$version$author
"); + $edit = translate_inline("Edit"); + rawoutput("$edit"); + rawoutput(""); + rawoutput(htmlentities($row['intext'], ENT_COMPAT, getsetting("charset", "ISO-8859-1"))); + rawoutput(""); + rawoutput(htmlentities($row['outtext'], ENT_COMPAT, getsetting("charset", "ISO-8859-1"))); + rawoutput(""); + rawoutput($row['version']); + rawoutput(""); + rawoutput($row['author']); + rawoutput("
$norows
"); + popup_footer(); +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/untranslated.php b/lotgd-web/lotgd/untranslated.php new file mode 100755 index 0000000..46a70f9 --- /dev/null +++ b/lotgd-web/lotgd/untranslated.php @@ -0,0 +1,151 @@ + "") { + $login = $session['user']['login']; + $language = $session['user']['prefs']['language']; + $sql = "INSERT INTO " . db_prefix("translations") . " (language,uri,intext,outtext,author,version) VALUES" . " ('$language','$namespace','$intext','$outtext','$login','$logd_version')"; + db_query($sql); + $sql = "DELETE FROM " . db_prefix("untranslated") . " WHERE intext = '$intext' AND language = '$language' AND namespace = '$namespace'"; + db_query($sql); + } + } + + if ($mode == "edit") { + rawoutput("
"); + addnav("", "untranslated.php?op=list&mode=save&ns=".rawurlencode($namespace)); + } else { + rawoutput(""); + addnav("", "untranslated.php?op=list"); + } + + $sql = "SELECT namespace,count(*) AS c FROM " . db_prefix("untranslated") . " WHERE language='".$session['user']['prefs']['language']."' GROUP BY namespace ORDER BY namespace ASC"; + $result = db_query($sql); + rawoutput(""); + output("Known Namespaces:"); + rawoutput(""); + rawoutput(""); + rawoutput("
"); + + if ($mode == "edit") { + rawoutput(translate_inline("Text:"). "
"); + rawoutput("
"); + rawoutput(translate_inline("Translation:"). "
"); + rawoutput("
"); + rawoutput(""); + } else { + rawoutput(""); + rawoutput(""); + $sql = "SELECT * FROM " . db_prefix("untranslated") . " WHERE language='".$session['user']['prefs']['language']."' AND namespace='".$namespace."'"; + $result = db_query($sql); + if (db_num_rows($result)>0){ + $i = 0; + while ($row = db_fetch_assoc($result)){ + $i++; + rawoutput(""); + } + }else{ + rawoutput(""); + } + rawoutput("
". translate_inline("Ops") ."". translate_inline("Text") ."
"); + rawoutput("". translate_inline("Edit") .""); + addnav("", "untranslated.php?op=list&mode=edit&ns=". rawurlencode($row['namespace']) ."&intext=". rawurlencode($row['intext'])); + rawoutput(""); + rawoutput(htmlentities($row['intext'], ENT_COMPAT, getsetting("charset", "ISO-8859-1"))); + rawoutput("
". translate_inline("No rows found") ."
"); + } + + rawoutput("
"); + +} else { + if ($op == "step2") { + $intext = httppost('intext'); + $outtext = httppost('outtext'); + $namespace = httppost('namespace'); + $language = httppost('language'); + if ($outtext <> "") { + $login = $session['user']['login']; + $sql = "INSERT INTO " . db_prefix("translations") . " (language,uri,intext,outtext,author,version) VALUES" . " ('$language','$namespace','$intext','$outtext','$login','$logd_version')"; + db_query($sql); + $sql = "DELETE FROM " . db_prefix("untranslated") . " WHERE intext = '$intext' AND language = '$language' AND namespace = '$namespace'"; + db_query($sql); + invalidatedatacache("translations-".$namespace."-".$language); + } + } + + $sql = "SELECT count(intext) AS count FROM " . db_prefix("untranslated"); + $count = db_fetch_assoc(db_query($sql)); + if ($count['count'] > 0) { + $sql = "SELECT * FROM " . db_prefix("untranslated") . " WHERE language = '" . $session['user']['prefs']['language'] . "' ORDER BY rand(".e_rand().") LIMIT 1"; + $result = db_query($sql); + if (db_num_rows($result) == 1) { + $row = db_fetch_assoc($result); + $row['intext'] = stripslashes($row['intext']); + $submit = translate_inline("Save Translation"); + $skip = translate_inline("Skip Translation"); + rawoutput("
"); + output("`^`cThere are `&%s`^ untranslated texts in the database.`c`n`n", $count['count']); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput("
"); + output("Target Language: %s", $row['language']); + rawoutput("
"); + output("Namespace: %s", $row['namespace']); + rawoutput("
"); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput("
"); + rawoutput("
"); + rawoutput(""); + rawoutput("
"); + addnav("", "untranslated.php?op=step2"); + addnav("", "untranslated.php"); + } else { + output("There are `&%s`^ untranslated texts in the database, but none for your selected language.", $count['count']); + output("Please change your language to translate these texts."); + } + } else { + output("There are no untranslated texts in the database!"); + output("Congratulations!!!"); + } // end if +} // end list if +addnav("R?Restart Translator", "untranslated.php"); +addnav("N?Translate by Namespace", "untranslated.php?op=list"); +require_once("lib/superusernav.php"); +superusernav(); +page_footer(); + +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/user.php b/lotgd-web/lotgd/user.php new file mode 100755 index 0000000..e12aef5 --- /dev/null +++ b/lotgd-web/lotgd/user.php @@ -0,0 +1,287 @@ +"); +output("Search by any field below: "); +rawoutput(""); +$se = translate_inline("Search"); +rawoutput(""); +rawoutput(""); +rawoutput(""); +addnav("","user.php?op=search$m"); +require_once("lib/superusernav.php"); +superusernav(); +addnav("Bans"); +addnav("Add a ban","user.php?op=setupban"); +addnav("List/Remove bans","user.php?op=removeban"); + +// This doesn't seem to be used, so I'm going to comment it out now +//$msg = httpget('msg'); +//if ($msg>"") { +// output("Message: %s`n", $msg); +//} + +// Collect a list of the mounts +$mounts="0," . translate_inline("None"); +$sql = "SELECT mountid,mountname,mountcategory FROM " . db_prefix("mounts") . " ORDER BY mountcategory"; +$result = db_query($sql); +while ($row = db_fetch_assoc($result)){ + $mounts.=",{$row['mountid']},{$row['mountcategory']}: ".color_sanitize($row['mountname']); +} + +$specialties = array(""=>translate_inline("Undecided")); +$specialties = modulehook("specialtynames", $specialties); +$enum = ""; +foreach ($specialties as $key=>$name) { + if ($enum) $enum .= ","; + $enum .= "$key,$name"; +} + +//Inserted for v1.1.0 Dragonprime Edition to extend clan possibilities +$ranks = array(CLAN_APPLICANT=>"`!Applicant`0",CLAN_MEMBER=>"`#Member`0",CLAN_OFFICER=>"`^Officer`0",CLAN_LEADER=>"`&Leader`0", CLAN_FOUNDER=>"`\$Founder"); +$ranks = modulehook("clanranks", array("ranks"=>$ranks, "clanid"=>NULL, "userid"=>$userid)); +$ranks = $ranks['ranks']; +$rankstring = ""; +foreach($ranks as $rankid => $rankname) { + if ($rankstring != "") $rankstring .= ","; + $rankstring .= $rankid.",".sanitize($rankname); +} +$userinfo = array( + "Account info,title", + "acctid"=>"User id,viewonly", + "login"=>"Login", + "newpassword"=>"New Password", + "emailaddress"=>"Email Address", + "locked"=>"Account Locked,bool", + "banoverride"=>"Override Bans for this account,bool", + "referer"=>"ID of player who referred this player," . + (($session['user']['superuser'] & SU_EDIT_DONATIONS) ? "int" : "viewonly"), + "refererawarded"=>"Has the referring player been awarded points,viewonly", + + "Basic user info,title", + "name"=>"Character Name (Do NOT include ANY title information)", + "title"=>"Dragonkill Title (prepended to name if Custom Title unset)" . (getsetting("edittitles",1) ? "" : ",hidden"), + "ctitle"=>"Custom Title (prepended to name if set)", + "sex"=>"Sex,enum,0,Male,1,Female", + "age"=>"Days since level 1,int", + "dragonkills"=>"How many times has slain the dragon,int", + "dragonage"=>"How old when last killed dragon,int", + "bestdragonage"=>"Youngest days when killed dragon,int", + "pk"=>"Has user attacked in pvp?,bool", + "bio"=>"Bio", + + "Stats,title", + "level"=>"Level,int", + "race"=>"Race", + "experience"=>"Experience,int", + "hitpoints"=>"Current Hitpoints,int", + "maxhitpoints"=>"Max Hitpoints,int", + "turns"=>"Turns left,int", + "playerfights"=>"Playerfights left,int", + "attack"=>"Attack (includes weapon damage),int", + "defense"=>"Defense (includes armor defense),int", + "spirits"=>"Spirits (display only),enum,-6,Resurrected,-2,Very Low,-1,Low,0,Normal,1,High,2,Very High", + "resurrections"=>"Resurrections,int", + "location"=>"Where is the user currently", + + "Specialty,title", + "specialty"=>"Specialty,enumpretrans,". $enum, + + "Grave Fights,title", + "deathpower"=>array("Favor with %s`0,int", getsetting("deathoverlord", '`$Ramius')), + "gravefights"=>"Grave fights left,int", + "soulpoints"=>"Soulpoints (HP while dead),int", + + "Gear,title", + "gems"=>"Gems,int", + "gold"=>"Gold in hand,int", + "goldinbank"=>"Gold in bank,int", + "transferredtoday"=>"Number of transfers today,int", + "amountouttoday"=>"Total value of transfers from player today,int", + "weapon"=>"Weapon Name", + "weapondmg"=>"Damage of weapon,int", + "weaponvalue"=>"Purchase cost of weapon,int", + "armor"=>"Armor Name", + "armordef"=>"Armor defense,int", + "armorvalue"=>"Purchase cost of armor,int", + + "Special,title", + "charm"=>"Charm,int", + "seendragon"=>"Saw dragon today,bool", + "seenmaster"=>"Seen master,bool", + "hashorse"=>"Mount,enumpretrans,".$mounts, + "fedmount"=>"Fed mount today,bool", + "boughtroomtoday"=>"Bought a room today,bool", + "marriedto"=>"Is married to the player with AcctID," . + (($session['user']['superuser'] & SU_MEGAUSER) ? "int" : "viewonly"), + + "Clan Info,title", + "clanid"=>"Clan,enumpretrans,0,".translate_inline("None"), + "clanrank"=>"Clan Rank,enum,$rankstring", + "clanjoindate"=>"Clan Join Date", + + "Superuser Flags,title", + "superuser"=>"Superuser Permissions". + "
For the most part you can only set flags that you yourself possess;". + "
if you try to set one that you don't have; it won't stick.
,". + "bitfield,". + ($session['user']['superuser'] | SU_ANYONE_CAN_SET | + ($session['user']['superuser']&SU_MEGAUSER ? 0xFFFFFFFF : 0)).",". + SU_MEGAUSER. ",MEGA USER (enable all permissions)* (this applies to any future flags as well)". + "

Editors,". + SU_EDIT_CONFIG. ",Edit Game Configurations*,". + SU_EDIT_USERS. ",Edit Users*,". + SU_EDIT_MOUNTS. ",Edit Mounts,". + SU_EDIT_CREATURES. ",Edit Creatures & Taunts,". + SU_EDIT_EQUIPMENT. ",Edit Armor & Weapons,". + SU_EDIT_RIDDLES. ",Edit Riddles,". + SU_MANAGE_MODULES. ",Manage Modules". + "

Customer Service,". + SU_IS_GAMEMASTER. ",Can post comments as gamemaster,". + SU_EDIT_PETITIONS. ",Handle Petitions,". + SU_EDIT_COMMENTS. ",Moderate Comments,". + SU_MODERATE_CLANS. ",Moderate Clan Commentary,". + SU_AUDIT_MODERATION.",Audit Moderated Comments,". + SU_OVERRIDE_YOM_WARNING.",Do NOT display YOM warning for this person,". + SU_POST_MOTD. ",Post MoTD's". + "

Donations,". + SU_EDIT_DONATIONS. ",Manage Donations*,". + SU_EDIT_PAYLOG. ",Manage Payment Log". + "

Game Development,". + SU_INFINITE_DAYS. ",Infinite Days*,". + SU_DEVELOPER. ",Game Developer* (super powers),". + SU_IS_TRANSLATOR. ",Enable Translation Tool,". + SU_DEBUG_OUTPUT. ",Debug Output,". + SU_SHOW_PHPNOTICE. ",See PHP Notices in debug output,". + SU_RAW_SQL. ",Execute Raw SQL*,". + SU_VIEW_SOURCE. ",View source code,". + SU_GIVE_GROTTO. ",Grotto access (only if not granted implicitly in another permission),". + SU_NEVER_EXPIRE. ",Account never expires". + "

* Granting any of these options will hide the user from the HoF", + + "Misc Info,title", + "regdate"=>"Registered on,viewonly", + "beta"=>"Willing to participate in beta,bool", + "laston"=>"Last On (local time),viewonly", + "lasthit"=>"Last New Day (time is in GMT not local),viewonly", + "lastmotd"=>"Last MOTD date (local time),viewonly", + "lastip"=>"Last IP,viewonly", + "uniqueid"=>"Unique ID,viewonly", + "gentime"=>"Sum of page gen times,viewonly", + "gentimecount"=>"Page hits,viewonly", + "allowednavs"=>"Allowed Navs,viewonly", + "dragonpoints"=>"Dragon points spent,viewonly", + "bufflist"=>"Buff List,viewonly", + "prefs"=>"Preferences,viewonly", + "donationconfig"=>"Donation buys,viewonly", + "Battle Info,title", + "companions"=>"List of companions,viewonly", + "badguy"=>"Last Badguy,viewonly" +); + +$sql = "SELECT clanid,clanname,clanshort FROM " . db_prefix("clans") ." ORDER BY clanshort"; +$result = db_query($sql); +while ($row=db_fetch_assoc($result)){ + $userinfo['clanid'].=",{$row['clanid']},<{$row['clanshort']}> {$row['clanname']}"; +} + +switch ($op) { + case "lasthit": + require("lib/user/user_lasthit.php"); + break; + case "savemodule": + require("lib/user/user_savemodule.php"); + break; + case "special": + require("lib/user/user_special.php"); + break; + case "save": + require("lib/user/user_save.php"); + break; +} + +switch($op) { + case "edit": + require("lib/user/user_edit.php"); + break; + case "setupban": + require("lib/user/user_setupban.php"); + break; + case "del": + require("lib/user/user_del.php"); + break; + case "saveban": + require("lib/user/user_saveban.php"); + break; + case "delban": + require("lib/user/user_delban.php"); + break; + case "removeban": + require("lib/user/user_removeban.php"); + break; + case "debuglog": + require("lib/user/user_debuglog.php"); + break; + case "": + require("lib/user/user_.php"); + break; +} +page_footer(); + +function show_bitfield($val){ + $out = ""; + $v = 1; + for ($i=0; $i < 32; $i++){ + $out.= (int)$val & (int)$v?"1":"0"; + $v *= 2; + } + return($out); +} +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/viewpetition.php b/lotgd-web/lotgd/viewpetition.php new file mode 100755 index 0000000..0871587 --- /dev/null +++ b/lotgd-web/lotgd/viewpetition.php @@ -0,0 +1,332 @@ +"`\$Top Level`0", + 4=>"`^Escalated`0", + 0=>"`bUnhandled`b", + 1=>"In-Progress", + 6=>"`%Bug`0", + 7=>"`#Awaiting Points`0", + 3=>"`!Informational`0", + 2=>"`iClosed`i", + ); + +//$statuses = modulehook("petition-status", $status); +$statuses=translate_inline($statuses); + +$op = httpget("op"); +$id = httpget("id"); + +if (trim(httppost('insertcommentary'))!="") { + /* Update the bug if someone adds comments as well */ + $sql = "UPDATE " . db_prefix("petitions") . " SET closeuserid='{$session['user']['acctid']}',closedate='".date("Y-m-d H:i:s")."' WHERE petitionid='$id'"; + db_query($sql); +} + +// Eric decide he didn't want petitions to be manually deleted +// +//if ($op=="del"){ +// $sql = "DELETE FROM " . db_prefix("petitions") . " WHERE petitionid='$id'"; +// db_query($sql); +// $sql = "DELETE FROM " . db_prefix("commentary") . " WHERE section='pet-$id'"; +// db_query($sql); +// invalidatedatacache("petition_counts"); +// $op=""; +//} +page_header("Petition Viewer"); +require_once("lib/superusernav.php"); +superusernav(); +if ($op==""){ + $sql = "DELETE FROM " . db_prefix("petitions") . " WHERE status=2 AND closedate<'".date("Y-m-d H:i:s",strtotime("-7 days"))."'"; + db_query($sql); + if(db_affected_rows()) { + invalidatedatacache("petition_counts"); + } + $setstat = httpget("setstat"); + if ($setstat!=""){ + $sql = "SELECT status FROM " . db_prefix("petitions") . " WHERE petitionid='$id'"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + if ($row['status']!=$setstat){ + $sql = "UPDATE " . db_prefix("petitions") . " SET status='$setstat',closeuserid='{$session['user']['acctid']}',closedate='".date("Y-m-d H:i:s")."' WHERE petitionid='$id'"; + db_query($sql); + invalidatedatacache("petition_counts"); + } + } + reset($statuses); + $sort = ""; + $pos = 0; + while (list($key,$val)=each($statuses)){ + $sort.=" WHEN $key THEN $pos"; + $pos++; + } + + $petitionsperpage = 50; + $sql = "SELECT count(petitionid) AS c from ".db_prefix("petitions"); + $result = db_query($sql); + $row = db_fetch_assoc($result); + $totalpages = ceil($row['c']/$petitionsperpage); + + $page = httpget("page"); + if ($page == "") { + if (isset($session['petitionPage'])){ + $page = (int)$session['petitionPage']; + }else{ + $page = 1; + } + } + if ($page < 1) $page = 1; + if ($page > $totalpages) $page = $totalpages; + $session['petitionPage'] = $page; + + // No need to show the pages if there is only one. + if ($totalpages != 1) { + addnav("Page"); + for ($x=1; $x <= $totalpages; $x++){ + if ($page == $x){ + addnav(array("`b`#Page %s`0`b", $x),"viewpetition.php?page=$x"); + }else{ + addnav(array("Page %s", $x),"viewpetition.php?page=$x"); + } + } + } + if ($page > 1){ + $limit = (($page-1) * $petitionsperpage) . "," . $petitionsperpage; + }else{ + $limit = "$petitionsperpage"; + } + + $sql = + "SELECT + petitionid, + ".db_prefix("accounts").".name, + ".db_prefix("petitions").".date, + ".db_prefix("petitions").".status, + ".db_prefix("petitions").".body, + ".db_prefix("petitions").".closedate, + accts.name AS closer, + CASE status $sort END AS sortorder + FROM + ".db_prefix("petitions")." + LEFT JOIN + ".db_prefix("accounts")." + ON ".db_prefix("accounts").".acctid=".db_prefix("petitions").".author + LEFT JOIN + ".db_prefix("accounts")." AS accts + ON accts.acctid=".db_prefix("petitions").".closeuserid + ORDER BY + sortorder ASC, + date ASC + LIMIT $limit"; + $result = db_query($sql); + addnav("Petitions"); + addnav("Refresh","viewpetition.php"); + $num = translate_inline("Num"); + $ops = translate_inline("Ops"); + $from = translate_inline("From"); + $sent = translate_inline("Sent"); + $com = translate_inline("Com"); + $last = translate_inline("Last Updater"); + $when = translate_inline("Updated"); + $view = translate_inline("View"); + $close = translate_inline("Close"); + $mark = translate_inline("Mark"); + + rawoutput(""); + $i=0; + $laststatus=-1; + while($row = db_fetch_assoc($result)){ + $i++; + $sql = "SELECT count(commentid) AS c FROM ". db_prefix("commentary") . " WHERE section='pet-{$row['petitionid']}'"; + $res = db_query($sql); + $counter = db_fetch_assoc($res); + if (array_key_exists('status', $row) && $row['status']!=$laststatus){ + rawoutput(""); + rawoutput(""); + $i++; + $laststatus=$row['status']; + } + rawoutput(""); + rawoutput(""); + rawoutput(""); + addnav("","viewpetition.php?op=view&id={$row['petitionid']}"); + addnav("","viewpetition.php?setstat=2&id={$row['petitionid']}"); + addnav("","viewpetition.php?setstat=0&id={$row['petitionid']}"); + addnav("","viewpetition.php?setstat=1&id={$row['petitionid']}"); + //addnav("","viewpetition.php?setstat=3&id={$row['petitionid']}"); + addnav("","viewpetition.php?setstat=4&id={$row['petitionid']}"); + //addnav("","viewpetition.php?setstat=5&id={$row['petitionid']}"); + //addnav("","viewpetition.php?setstat=6&id={$row['petitionid']}"); + //addnav("","viewpetition.php?setstat=7&id={$row['petitionid']}"); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + rawoutput(""); + } + rawoutput("
$num$ops$from$sent$com$last$when
"); + output_notl("%s", $statuses[$row['status']]); + rawoutput("
"); + output_notl("%s", $row['petitionid']); + rawoutput("[ "); + rawoutput("$view",true); + rawoutput(" | $close"); + output_notl(" | %s: ", $mark); + output_notl("`b`&U`0`b/",true); + output_notl("`7P`0/",true); + //output_notl("`!I`0/",true); + output_notl("`^E`0",true); + //output_notl("`\$T`0/",true); + //output_notl("`%B`0/",true); + //output_notl("`#A`0",true); + rawoutput(" ]"); + if ($row['name']==""){ + $v = substr($row['body'],0,strpos($row['body'],"[email")); + $v = preg_replace("'\\[PHPSESSID\\] = .*'", "", $v); + $v = preg_replace("'[^a-zA-Z0-91234567890\\[\\]= @.!,?-]'","", $v); + // Make sure we don't get something too large.. 50 chars max + $v = substr($v, 0, 50); + output_notl("`\$%s`0", $v); + }else{ + output_notl("`&%s`0", $row['name']); + } + rawoutput(""); + output_notl("`7%s`0", reltime(strtotime($row['date']))); + rawoutput(""); + output_notl("`#%s`0", $counter['c']); + rawoutput(""); + output_notl("`^%s`0", $row['closer']); + rawoutput(""); + if ($row['closedate'] != 0) output_notl("`7%s`0", reltime(strtotime($row['closedate']))); + rawoutput("
"); + output("`i(Closed petitions will automatically delete themselves when they have been closed for 7 days)`i"); + output("`n`bKey:`b`n"); + rawoutput("
  • "); + output("`\$T = Top Level`0 petitions are for petitions that only server operators can take care of."); + rawoutput("
  • "); + output("`^E = Escalated`0 petitions deal with an issue you can't handle for yourself."); + output("Mark it escalated so someone with more permissions than you can deal with it."); + rawoutput("
  • "); + output("`b`&U = Unhandled`0`b: No one is currently working on this problem, and it has not been dealt with yet."); + rawoutput("
  • "); + output("P = In-Progress petitions are probably being worked on by someone else, so please leave them be unless they have been around for some time."); + rawoutput("
  • "); + output("`%B = Bug/Suggestion`0 petitions are petitions that detail mistakes, bugs, misspellings, or suggestions for the game."); + rawoutput("
  • "); + output("`#A = Awaiting Points`0 stuff wot is dun and needz teh points added (this is mostly for lotgd.net)."); + rawoutput("
  • "); + output("`!I = Informational`0 petitions are just around for others to view, either nothing needed to be done with them, or their issue has been dealt with, but you feel other admins could benefit from reading it."); + rawoutput("
  • "); + output("`iClosed`i petitions are for you have dealt with an issue, these will auto delete when they have been closed for 7 days."); + modulehook("petitions-descriptions", array()); + rawoutput("
"); +}elseif($op=="view"){ + $viewpageinfo = (int)httpget("viewpageinfo"); + if ($viewpageinfo==1){ + addnav("Hide Details","viewpetition.php?op=view&id=$id}"); + }else{ + addnav("D?Show Details","viewpetition.php?op=view&id=$id&viewpageinfo=1"); + } + addnav("V?Petition Viewer","viewpetition.php"); + + addnav("User Ops"); + + addnav("Petition Ops"); + reset($statuses); + while (list($key,$val)=each($statuses)){ + $plain = full_sanitize($val); + addnav(array("%s?Mark %s", substr($plain,0,1), $val), + "viewpetition.php?setstat=$key&id=$id"); + } + + $sql = "SELECT " . db_prefix("accounts") . ".name," . db_prefix("accounts") . ".login," . db_prefix("accounts") . ".acctid," . "date,closedate,status,petitionid,ip,body,pageinfo," . "accts.name AS closer FROM " . db_prefix("petitions") . " LEFT JOIN " . db_prefix("accounts ") . "ON " . db_prefix("accounts") . ".acctid=author LEFT JOIN " . db_prefix("accounts") . " AS accts ON accts.acctid=". "closeuserid WHERE petitionid='$id' ORDER BY date ASC"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + addnav("User Ops"); + if (isset($row['login'])) { + addnav("View User Biography","bio.php?char=" . $row['acctid'] + . "&ret=%2Fviewpetition.php%3Fop%3Dview%26id=" . $id); + } + if ($row['acctid']>0 && $session['user']['superuser'] & SU_EDIT_USERS){ + addnav("User Ops"); + addnav("R?Edit User Record","user.php?op=edit&userid={$row['acctid']}&returnpetition=$id"); + } + if ($row['acctid']>0 && $session['user']['superuser'] & SU_EDIT_DONATIONS){ + addnav("User Ops"); + addnav("Edit User Donations","donators.php?op=add1&name=".rawurlencode($row['login'])."&ret=".urlencode($_SERVER['REQUEST_URI'])); + } + $write = translate_inline("Write Mail"); + // We assume that petitions are handled in default language + $yourpeti = translate_mail("Your Petition",0); + $peti = translate_mail("Petition",0); + $row['body'] = str_replace("[charname]",translate_mail("[charname]",0),$row['body']); + $row['body'] = str_replace("[email]",translate_mail("[email]",0),$row['body']); + $row['body'] = str_replace("[description]",translate_mail("[description]",0),$row['body']); + // For email replies, make sure we don't overflow the URI buffer. + $reppet = substr(stripslashes($row['body']), 0, 2000); + output("`@From: "); + if ($row['login']>"") { + rawoutput("$write"); + } + output_notl("`^`b%s`b`n", $row['name']); + output("`@Date: `^`b%s`b (%s)`n", $row['date'], reltime(strtotime($row['date']))); + output("`@Status: %s`n", $statuses[$row['status']]); + if($row['closedate']) output("`@Last Update: `^%s`@ on `^%s (%s)`n", $row['closer'], $row['closedate'], reltime(strtotime($row['closedate']))); + output("`@Body:`^`n"); + output("`\$[ipaddress] `^= `#%s`^`n", $row['ip']); + $body = htmlentities(stripslashes($row['body']), ENT_COMPAT, getsetting("charset", "ISO-8859-1")); + $body = preg_replace("'([[:alnum:]_.-]+[@][[:alnum:]_.-]{2,}([.][[:alnum:]_.-]{2,})+)'i","\\1",$body); + $body = preg_replace("'([\\[][[:alnum:]_.-]+[\\]])'i","\\1",$body); + rawoutput("".nl2br($body).""); + commentdisplay("`n`@Commentary:`0`n", "pet-$id","Add information",200); + if ($viewpageinfo){ + output("`n`n`@Page Info:`&`n"); + $row['pageinfo']=stripslashes($row['pageinfo']); + $body = HTMLEntities($row['pageinfo'], ENT_COMPAT, getsetting("charset", "ISO-8859-1")); + $body = preg_replace("'([[:alnum:]_.-]+[@][[:alnum:]_.-]{2,}([.][[:alnum:]_.-]{2,})+)'i","\\1",$body); + $body = preg_replace("'([\\[][[:alnum:]_.-]+[\\]])'i","\\1",$body); + rawoutput("".nl2br($body).""); + } +} + +if ($id && $op != ""){ + $prevsql="SELECT p1.petitionid, p1.status FROM ".db_prefix("petitions")." AS p1, ".db_prefix("petitions")." AS p2 + WHERE p1.petitionid<'$id' AND p2.petitionid='$id' AND p1.status=p2.status ORDER BY p1.petitionid DESC LIMIT 1"; + $prevresult=db_query($prevsql); + $prevrow=db_fetch_assoc($prevresult); + if ($prevrow){ + $previd=$prevrow['petitionid']; + $s=$prevrow['status']; + $status=$statuses[$s]; + addnav("Navigation"); + addnav(array("Previous %s",$status),"viewpetition.php?op=view&id=$previd"); + } + $nextsql="SELECT p1.petitionid, p1.status FROM ".db_prefix("petitions")." AS p1, ".db_prefix("petitions")." AS p2 + WHERE p1.petitionid>'$id' AND p2.petitionid='$id' AND p1.status=p2.status ORDER BY p1.petitionid ASC LIMIT 1"; + $nextresult=db_query($nextsql); + $nextrow=db_fetch_assoc($nextresult); + if ($nextrow){ + $nextid=$nextrow['petitionid']; + $s=$nextrow['status']; + $status=$statuses[$s]; + addnav("Navigation"); + addnav(array("Next %s",$status),"viewpetition.php?op=view&id=$nextid"); + } +} +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/village.php b/lotgd-web/lotgd/village.php new file mode 100755 index 0000000..afc3040 --- /dev/null +++ b/lotgd-web/lotgd/village.php @@ -0,0 +1,303 @@ + "") { + $newestname = $newestplayer; + } else { + $newestname = ""; + } + } +} + +$basetext = array( + "`@`c`b%s Square`b`cThe village of %s hustles and bustles. No one really notices that you're standing there. ". + "You see various shops and businesses along main street. There is a curious looking rock to one side. ". + "On every side the village is surrounded by deep dark forest.`n`n",$vname,$vname + ); +$origtexts = array( + "text"=>$basetext, + "clock"=>"The clock on the inn reads `^%s`@.`n", + "title"=>array("%s Square", $vname), + "talk"=>"`n`%`@Nearby some villagers talk:`n", + "sayline"=>"says", + "newest"=>$newtext, + "newestplayer"=>$newestname, + "newestid"=>$newestplayer, + "gatenav"=>"City Gates", + "fightnav"=>"Blades Boulevard", + "marketnav"=>"Market Street", + "tavernnav"=>"Tavern Street", + "infonav"=>"Info", + "othernav"=>"Other", + "section"=>"village", + "innname"=>$iname, + "stablename"=>"Merick's Stables", + "mercenarycamp"=>"Mercenary Camp", + "armorshop"=>"Pegasus Armor", + "weaponshop"=>"MightyE's Weaponry" + ); +$schemas = array( + "text"=>"village", + "clock"=>"village", + "title"=>"village", + "talk"=>"village", + "sayline"=>"village", + "newest"=>"village", + "newestplayer"=>"village", + "newestid"=>"village", + "gatenav"=>"village", + "fightnav"=>"village", + "marketnav"=>"village", + "tavernnav"=>"village", + "infonav"=>"village", + "othernav"=>"village", + "section"=>"village", + "innname"=>"village", + "stablename"=>"village", + "mercenarycamp"=>"village", + "armorshop"=>"village", + "weaponshop"=>"village" + ); +// Now store the schemas +$origtexts['schemas'] = $schemas; + +// don't hook on to this text for your standard modules please, use "village" +// instead. +// This hook is specifically to allow modules that do other villages to create +// ambience. +$texts = modulehook("villagetext",$origtexts); +//and now a special hook for the village +$texts = modulehook("villagetext-{$session['user']['location']}",$texts); +$schemas = $texts['schemas']; + +tlschema($schemas['title']); +page_header($texts['title']); +tlschema(); + +addcommentary(); +$skipvillagedesc = handle_event("village"); +checkday(); + +if ($session['user']['slaydragon'] == 1) { + $session['user']['slaydragon'] = 0; +} + + +if ($session['user']['alive']){ }else{ + redirect("shades.php"); +} + +if (getsetting("automaster",1) && $session['user']['seenmaster']!=1){ + //masters hunt down truant students + $level = $session['user']['level']+1; + $dks = $session['user']['dragonkills']; + $expreqd = exp_for_next_level($level, $dks); + if ($session['user']['experience']>$expreqd && + $session['user']['level']<15){ + redirect("train.php?op=autochallenge"); + } +} + +$op = httpget('op'); +$com = httpget('comscroll'); +$refresh = httpget("refresh"); +$commenting = httpget("commenting"); +$comment = httppost('insertcommentary'); +// Don't give people a chance at a special event if they are just browsing +// the commentary (or talking) or dealing with any of the hooks in the village. +if (!$op && $com=="" && !$comment && !$refresh && !$commenting) { + // The '1' should really be sysadmin customizable. + if (module_events("village", getsetting("villagechance", 0)) != 0) { + if (checknavs()) { + page_footer(); + } else { + // Reset the special for good. + $session['user']['specialinc'] = ""; + $session['user']['specialmisc'] = ""; + $skipvillagedesc=true; + $op = ""; + httpset("op", ""); + } + } +} + +tlschema($schemas['gatenav']); +addnav($texts['gatenav']); +tlschema(); + +addnav("F?Forest","forest.php"); +if (getsetting("pvp",1)){ + addnav("S?Slay Other Players","pvp.php"); +} +addnav("Q?`%Quit`0 to the fields","login.php?op=logout",true); +if (getsetting("enablecompanions",true)) { + tlschema($schemas['mercenarycamp']); + addnav($texts['mercenarycamp'], "mercenarycamp.php"); + tlschema(); +} + +tlschema($schemas['fightnav']); +addnav($texts['fightnav']); +tlschema(); +addnav("u?Bluspring's Warrior Training","train.php"); +if (@file_exists("lodge.php")) { + addnav("J?JCP's Hunter Lodge","lodge.php"); +} + +tlschema($schemas['marketnav']); +addnav($texts['marketnav']); +tlschema(); +tlschema($schemas['weaponshop']); +addnav("W?".$texts['weaponshop'],"weapons.php"); +tlschema(); +tlschema($schemas['armorshop']); +addnav("A?".$texts['armorshop'],"armor.php"); +tlschema(); +addnav("B?Ye Olde Bank","bank.php"); +addnav("Z?Ze Gypsy Tent","gypsy.php"); +if (getsetting("betaperplayer", 1) == 1 && @file_exists("pavilion.php")) { + addnav("E?Eye-catching Pavilion","pavilion.php"); +} + +tlschema($schemas['tavernnav']); +addnav($texts['tavernnav']); +tlschema(); +tlschema($schemas['innname']); +addnav("I?".$texts['innname']."`0","inn.php",true); +tlschema(); +tlschema($schemas['stablename']); +addnav("M?".$texts['stablename']."`0","stables.php"); +tlschema(); + +addnav("G?The Gardens", "gardens.php"); +addnav("R?Curious Looking Rock", "rock.php"); +if (getsetting("allowclans",1)) addnav("C?Clan Halls","clan.php"); + +tlschema($schemas['infonav']); +addnav($texts['infonav']); +tlschema(); +addnav("??F.A.Q. (newbies start here)", "petition.php?op=faq",false,true); +addnav("N?Daily News","news.php"); +addnav("L?List Warriors","list.php"); +addnav("o?Hall o' Fame","hof.php"); + +tlschema($schemas['othernav']); +addnav($texts['othernav']); +tlschema(); +addnav("P?Preferences","prefs.php"); +if (!file_exists("lodge.php")) { + addnav("Refer a Friend", "referral.php"); +} + +tlschema('nav'); +addnav("Superuser"); +if ($session['user']['superuser'] & SU_EDIT_COMMENTS){ + addnav(",?Comment Moderation","moderate.php"); +} +if ($session['user']['superuser']&~SU_DOESNT_GIVE_GROTTO){ + addnav("X?`bSuperuser Grotto`b","superuser.php"); +} +if ($session['user']['superuser'] & SU_INFINITE_DAYS){ + addnav("/?New Day","newday.php"); +} +tlschema(); +//let users try to cheat, we protect against this and will know if they try. +addnav("","superuser.php"); +addnav("","user.php"); +addnav("","taunt.php"); +addnav("","creatures.php"); +addnav("","configuration.php"); +addnav("","badword.php"); +addnav("","armoreditor.php"); +addnav("","bios.php"); +addnav("","badword.php"); +addnav("","donators.php"); +addnav("","referers.php"); +addnav("","retitle.php"); +addnav("","stats.php"); +addnav("","viewpetition.php"); +addnav("","weaponeditor.php"); + +if (!$skipvillagedesc) { + modulehook("collapse{", array("name"=>"villagedesc-".$session['user']['location'])); + tlschema($schemas['text']); + output($texts['text']); + tlschema(); + modulehook("}collapse"); + modulehook("collapse{", array("name"=>"villageclock-".$session['user']['location'])); + tlschema($schemas['clock']); + output($texts['clock'],getgametime()); + tlschema(); + modulehook("}collapse"); + modulehook("village-desc",$texts); + //support for a special village-only hook + modulehook("village-desc-{$session['user']['location']}",$texts); + if ($texts['newestplayer'] > "" && $texts['newest']) { + modulehook("collapse{", array("name"=>"villagenewest-".$session['user']['location'])); + tlschema($schemas['newest']); + output($texts['newest'], $texts['newestplayer']); + tlschema(); + $id = $texts['newestid']; + if ($session['user']['superuser'] & SU_EDIT_USERS && $id) { + $edit = translate_inline("Edit"); + rawoutput(" [$edit]"); + addnav("","user.php?op=edit&userid=$id"); + } + output_notl("`n"); + modulehook("}collapse"); + } +} +modulehook("village",$texts); +//special hook for all villages... saves queries... +modulehook("village-{$session['user']['location']}",$texts); + +if ($skipvillagedesc) output("`n"); + +$args = modulehook("blockcommentarea", array("section"=>$texts['section'])); +if (!isset($args['block']) || $args['block'] != 'yes') { + tlschema($schemas['talk']); + output($texts['talk']); + tlschema(); + commentdisplay("",$texts['section'],"Speak",25,$texts['sayline'], $schemas['sayline']); +} + +module_display_events("village", "village.php"); +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/weaponeditor.php b/lotgd-web/lotgd/weaponeditor.php new file mode 100755 index 0000000..233833d --- /dev/null +++ b/lotgd-web/lotgd/weaponeditor.php @@ -0,0 +1,116 @@ +48,225,585,990,1575,2250,2790,3420,4230,5040,5850,6840,8010,9000,10350); +rawoutput("

"); +if ($weaponlevel == 1) { + output("`&Weapons for 1 Dragon Kill`0"); +} else { + output("`&Weapons for %s Dragon Kills`0",$weaponlevel); +} +rawoutput("

"); + +$weaponarray=array( + "Weapon,title", + "weaponid"=>"Weapon ID,hidden", + "weaponname"=>"Weapon Name", + "damage"=>"Damage,range,1,15,1"); +$op = httpget('op'); +$id = httpget('id'); +if($op=="edit" || $op=="add"){ + if ($op=="edit"){ + $sql = "SELECT * FROM " . db_prefix("weapons") . " WHERE weaponid='$id'"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + }else{ + $sql = "SELECT max(damage+1) AS damage FROM " . db_prefix("weapons") . " WHERE level=$weaponlevel"; + $result = db_query($sql); + $row = db_fetch_assoc($result); + } + rawoutput("
"); + addnav("","weaponeditor.php?op=save&level=$weaponlevel"); + showform($weaponarray,$row); + rawoutput("
"); +}else if($op=="del"){ + $sql = "DELETE FROM " . db_prefix("weapons") . " WHERE weaponid='$id'"; + db_query($sql); + $op = ""; + httpset("op", $op); +}else if($op=="save"){ + $weaponid = (int)httppost("weaponid"); + $damage = httppost("damage"); + $weaponname = httppost("weaponname"); + if ($weaponid>0){ + $sql = "UPDATE " . db_prefix("weapons") . " SET weaponname=\"$weaponname\",damage=\"$damage\",value=" . $values[$damage]." WHERE weaponid='$weaponid'"; + }else{ + $sql = "INSERT INTO " . db_prefix("weapons") . " (level,damage,weaponname,value) VALUES ($weaponlevel,\"$damage\",\"$weaponname\",".$values[$damage].")"; + } + db_query($sql); + //output($sql); + $op = ""; + httpset("op", $op); +} +if ($op==""){ + $sql = "SELECT max(level+1) as level FROM " . db_prefix("weapons"); + $res = db_query($sql); + $row = db_fetch_assoc($res); + $max = $row['level']; + for ($i=0;$i<=$max;$i++){ + if ($i == 1) + addnav("Weapons for 1 DK","weaponeditor.php?level=$i"); + else + addnav(array("Weapons for %s DKs",$i),"weaponeditor.php?level=$i"); + } + $sql = "SELECT * FROM " . db_prefix("weapons") . " WHERE level=$weaponlevel ORDER BY damage"; + $result= db_query($sql); + $ops = translate_inline("Ops"); + $name = translate_inline("Name"); + $cost = translate_inline("Cost"); + $damage = translate_inline("Damage"); + $level = translate_inline("Level"); + $edit = translate_inline("Edit"); + $del = translate_inline("Del"); + $delconfirm = translate_inline("Are you sure you wish to delete this weapon?"); + + rawoutput(""); + rawoutput(""); + $number=db_num_rows($result); + for ($i=0;$i<$number;$i++){ + $row = db_fetch_assoc($result); + rawoutput(""); + rawoutput(""); + addnav("","weaponeditor.php?op=edit&id={$row['weaponid']}&level=$weaponlevel"); + addnav("","weaponeditor.php?op=del&id={$row['weaponid']}&level=$weaponlevel"); + rawoutput(""); + rawoutput(""); + } + rawoutput("
$ops$name$cost$damage$level
[$edit|$del]"); + output_notl($row['weaponname']); + rawoutput(""); + output_notl($row['value']); + rawoutput(""); + output_notl($row['damage']); + rawoutput(""); + output_notl($row['level']); + rawoutput("
"); +} +page_footer(); +?> \ No newline at end of file diff --git a/lotgd-web/lotgd/weapons.php b/lotgd-web/lotgd/weapons.php new file mode 100755 index 0000000..3a2672a --- /dev/null +++ b/lotgd-web/lotgd/weapons.php @@ -0,0 +1,174 @@ + "MightyE's Weapons", + "desc" => array( + "`!MightyE `7stands behind a counter and appears to pay little attention to you as you enter, but you know from experience that he has his eye on every move you make.", + array("He may be a humble weapons merchant, but he still carries himself with the grace of a man who has used his weapons to kill mightier %s than you.`n`n",translate_inline($session['user']['sex']?"women":"men")), + "The massive hilt of a claymore protrudes above his shoulder; its gleam in the torch light not much brighter than the gleam off of `!MightyE's`7 bald forehead, kept shaved mostly as a strategic advantage, but in no small part because nature insisted that some level of baldness was necessary.`n`n", + "`!MightyE`7 finally nods to you, stroking his goatee and looking like he wished he could have an opportunity to use one of these weapons.", + ), + "tradein" => array( + "`7You stroll up the counter and try your best to look like you know what most of these contraptions do.", + array("`!MightyE`7 looks at you and says, \"`#I'll give you `^%s`# trade-in value for your `5%s`#.",$tradeinvalue,$session['user']['weapon']), + "Just click on the weapon you wish to buy, what ever 'click' means`7,\" and looks utterly confused.", + "He stands there a few seconds, snapping his fingers and wondering if that is what is meant by \"click,\" before returning to his work: standing there and looking good.`n`n", + ), + "nosuchweapon" => "`!MightyE`7 looks at you, confused for a second, then realizes that you've apparently taken one too many bonks on the head, and nods and smiles.", + "tryagain" => "Try again?", + "notenoughgold" => "Waiting until `!MightyE`7 looks away, you reach carefully for the `5%s`7, which you silently remove from the rack upon which it sits. Secure in your theft, you turn around and head for the door, swiftly, quietly, like a ninja, only to discover that upon reaching the door, the ominous `!MightyE`7 stands, blocking your exit. You execute a flying kick. Mid flight, you hear the \"SHING\" of a sword leaving its sheath.... your foot is gone. You land on your stump, and `!MightyE`7 stands in the doorway, claymore once again in its back holster, with no sign that it had been used, his arms folded menacingly across his burly chest. \"`#Perhaps you'd like to pay for that?`7\" is all he has to say as you collapse at his feet, lifeblood staining the planks under your remaining foot.`n`nYou wake up some time later, having been tossed unconscious into the street.", + "payweapon" => "`!MightyE`7 takes your `5%s`7 and promptly puts a price on it, setting it out for display with the rest of his weapons.`n`nIn return, he hands you a shiny new `5%s`7 which you swoosh around the room, nearly taking off `!MightyE`7's head, which he deftly ducks; you're not the first person to exuberantly try out a new weapon.", +); + +$schemas = array( + "title"=>"weapon", + "desc"=>"weapon", + "tradein"=>"weapon", + "nosuchweapon"=>"weapon", + "tryagain"=>"weapon", + "notenoughgold"=>"weapon", + "payweapon"=>"weapon", +); + +$basetext['schemas'] = $schemas; +$texts = modulehook("weaponstext",$basetext); +$schemas = $texts['schemas']; + +tlschema($schemas['title']); +page_header($texts['title']); +output("`c`b`&".$texts['title']."`0`b`c"); +tlschema(); + +$op = httpget("op"); + +if ($op==""){ + tlschema($schemas['desc']); + if (is_array($texts['desc'])) { + foreach ($texts['desc'] as $description) { + output_notl(sprintf_translate($description)); + } + } else { + output($texts['desc']); + } + tlschema(); + + + $sql = "SELECT max(level) AS level FROM " . db_prefix("weapons") . " WHERE level<=".(int)$session['user']['dragonkills']; + $result = db_query($sql); + $row = db_fetch_assoc($result); + + $sql = "SELECT * FROM " . db_prefix("weapons") . " WHERE level = ".(int)$row['level']." ORDER BY damage ASC"; + $result = db_query($sql); + + tlschema($schemas['tradein']); + if (is_array($texts['tradein'])) { + foreach ($texts['tradein'] as $description) { + output_notl(sprintf_translate($description)); + } + } else { + output($texts['tradein']); + } + tlschema(); + + $wname=translate_inline("`bName`b"); + $wdam=translate_inline("`bDamage`b"); + $wcost=translate_inline("`bCost`b"); + rawoutput(""); + rawoutput(""); + $i=0; + while($row = db_fetch_assoc($result)) { + $link = true; + $row = modulehook("modify-weapon", $row); + if (isset($row['skip']) && $row['skip'] === true) { + continue; + } + if (isset($row['unavailable']) && $row['unavailable'] == true) { + $link = false; + } + rawoutput(""); + ++$i; + } + rawoutput("
"); + output_notl($wname); + rawoutput(""); + output_notl($wdam); + rawoutput(""); + output_notl($wcost); + rawoutput("
"); + $color = "`)"; + if ($row['value']<=($session['user']['gold']+$tradeinvalue)){ + + if ($link) { + $color = "`&"; + rawoutput(""); + } else { + $color = "`7"; + } + output_notl("%s%s`0",$color,$row['weaponname']); + if ($link) { + rawoutput(""); + } + addnav("","weapons.php?op=buy&id={$row['weaponid']}"); + }else{ + output_notl("%s%s`0",$color,$row['weaponname']); + addnav("","weapons.php?op=buy&id={$row['weaponid']}"); + } + rawoutput(""); + output_notl("%s%s`0",$color,$row['damage']); + rawoutput(""); + if (isset($row['alternatetext']) && $row['alternatetext'] > "") { + output("%s%s`0", $color, $row['alternatetext']); + } else { + output_notl("%s%s`0",$color,$row['value']); + } + rawoutput("
"); + villagenav(); +}else if ($op=="buy"){ + $id = httpget("id"); + $sql = "SELECT * FROM " . db_prefix("weapons") . " WHERE weaponid='$id'"; + $result = db_query($sql); + if (db_num_rows($result)==0){ + tlschema($schemas['nosuchweapon']); + output($texts['nosuchweapon']); + tlschema(); + tlschema($schemas['tryagain']); + addnav($texts['tryagain'],"weapons.php"); + tlschema(); + villagenav(); + }else{ + $row = db_fetch_assoc($result); + $row = modulehook("modify-weapon", $row); + if ($row['value']>($session['user']['gold']+$tradeinvalue)){ + tlschema($schemas['notenoughgold']); + output($texts['notenoughgold'],$row['weaponname']); + tlschema(); + villagenav(); + }else{ + tlschema($schemas['payweapon']); + output($texts['payweapon'],$session['user']['weapon'],$row['weaponname']); + tlschema(); + debuglog("spent " . ($row['value']-$tradeinvalue) . " gold on the " . $row['weaponname'] . " weapon"); + $session['user']['gold']-=$row['value']; + $session['user']['weapon'] = $row['weaponname']; + $session['user']['gold']+=$tradeinvalue; + $session['user']['attack']-=$session['user']['weapondmg']; + $session['user']['weapondmg'] = $row['damage']; + $session['user']['attack']+=$session['user']['weapondmg']; + $session['user']['weaponvalue'] = $row['value']; + villagenav(); + } + } +} + +page_footer(); +?> \ No newline at end of file