- Code: Select all
- <?php
 // create the customized command
 require_once "src/pfccommand.class.php";
 class pfcCommand_insult extends pfcCommand
 {
 function run(&$xml_reponse, $clientid, $msg)
 {
 $c =& $this->c;
 $nick = $c->nick;
 $para = trim($msg);
 $para = explode(" ",$para);
 $container =& $c->getContainerInstance();
 
 $phrase1 = array("artless","bawdy","beslubbering","bootless","churlish","clouted",
 "cockered","craven","currish","dankish","dissembling","droning","errant","fawning",
 "fobbing","frothy","froward","gleeking","goatish","gorbellied","impertinent",
 "infectious","jarring","loggerheaded","lumpish","mammering","mangled","mewling",
 "paunchy","pribbling","puking","puny","qualling","rank","reeky","roguish","ruttish",
 "saucy","spleeny","spongy","surly","tottering","unmuzzled","vain","venomed",
 "villainous","warped","wayward","weedy","yeasty");
 $phrase2 = array("base-court","bat-fowling","beef-witted","beetle-headed",
 "boil-brained","clapper-clawed","clay-brained","common-kissing","crook-pated",
 "dismal-dreaming","dizzy-eyed","doghearted","dread-bolted","earth-vexing",
 "elf-skinned","fat-kidneyed","fen-sucked","flap-mouthed","fly-bitten",
 "folly-fallen","fool-born","full-gorged","guts-griping","half-faced","hasty-witted",
 "hedge-born","hell-hated","idle-headed","ill-breeding","ill-nurtured","knotty-pated",
 "milk-livered","motley-minded","onion-eyed","plume-plucked","pottle-deep",
 "pox-marked","reeling-ripe","rough-hewn","rude-growing","rump-fed","shard-borne",
 "sheep-biting","spur-galled","swag-bellied","tardy-gaited","tickle-brained",
 "toad-spotted","urchin-snouted","weather-bitten");
 $phrase3 = array("apple-john","baggage","barnacle","bladder","boar-pig","bugbear",
 "bum-bailey","canker-blossom","clack-dish","clotpole","codpiece","coxcomb","death-token",
 "dewberry","flap-dragon","flax-wench","flirt-gill","foot-licker","fustilarian",
 "giglet","gudgeon","haggard","harpy","hedge-pig","horn-beast","hugger-mugger",
 "joithead","lewdster","lout","maggot-pie","malt-worm","mammet","measle","minnow",
 "miscreant","moldwarp","mumble-news","nut-hook","pigeon-egg","pignut","pumpion",
 "puttock","ratsbane","scut","skainsmate","strumpet","varlet","vassal","wagtail",
 "whey-face");
 
 //rand() returns in range 1-n, subtract 1 for array index
 $rand1 = rand(0,sizeof($phrase1)-1);
 $rand2 = rand(0,sizeof($phrase2)-1);
 $rand3 = rand(0,sizeof($phrase3)-1);
 if ($para[0] == '') {
 $insult = "Thou $phrase1[$rand1] $phrase2[$rand2] $phrase3[$rand3]!";
 }else {
 $insult = "$para[0], thou $phrase1[$rand1] $phrase2[$rand2] $phrase3[$rand3]!";
 }
 $result = $insult;
 if (!$insult) { $result = 'Not found!'; }
 if (!$insult)
 {
 $cmd =& pfcCommand::Factory("error", $c);
 $cmd->run($xml_reponse, $clientid, "Quote failed: " . $result);
 }
 else
 {
 $container->writeMsg($nick, $result);
 }
 if ($c->debug) pxlog("Cmd_quote[".$c->sessionid."]: msg=".$result, "chat", $c->getId());
 }
 }
 ?>


