Example #1
0
    }
} else {
    if ($command == "Bribe") {
        switch (true) {
            case $bribe <= getGold($username) && $bribe > 0:
                subtractGold($username, $bribe);
                subtractBounty($username, $bribe / 2);
                $location = "Behind the Doshin Office";
                $description = "\"We'll see what we can do,\" one of the Doshin tells you as you hand off your gold. He then directs you out through a back alley.\n" . "<br><br>\n" . "You find yourself in a dark alley. A rat scurries by. To your left lies the main street of the village.\n";
                $quickstat = "player";
                break;
            case $bribe < 0:
                // A negative bribe was put in, which on the 21st of March, 2007, was a road to instant wealth, as a bribe of -456345 would increase both your bounty and your gold by 456345, so this will flag players as bugabusers until it becomes a standard-use thing.
                if (getGold($username) > 1000) {
                    $bountyGoesToNearlyZero = getBounty($username) * 0.7;
                    subtractBounty($username, $bountyGoesToNearlyZero);
                }
                subtractGold($username, floor(getGold($username) * 0.8));
                //Takes away 80% of the players gold.
                $location = "The Rat-infested Alley behind the Doshin Office";
                $description = "\"Trying to steal from the Doshin, eh!\" one of the men growls.<br>Where before there were only relaxing men idly ignoring their duties there are now unsheathed katanas and glaring eyes.<br>A group of the Doshin advance on you before you can escape and proceed to rough you up with fists and the hilts of their katana.  Finally, they take most of your gold and toss you into the alley behind the building.\n" . "<br><br>\n" . "Bruised and battered, you find yourself in a dark alley. A rat scurries by. To your left lies the main street of the village.\n";
                $quickstat = "player";
                break;
            default:
                echo "The Doshin ignore your ill-funded attempt to bribe them.\n";
                break;
        }
    }
}
echo "<div class=\"brownTitle\">{$location}</div>\n";
echo "<div class=\"description\">\n";
Example #2
0
 /**
  * Command for a user to reduce their bounty by paying their own gold
  *
  * @param bribe int The amount to spend on reducing bounty
  * @return Array
  */
 public function bribe()
 {
     $bribe = intval(in('bribe'));
     $error = 0;
     $quickstat = false;
     if ($bribe <= get_gold($this->sessionData['char_id']) && $bribe > 0) {
         subtract_gold($this->sessionData['char_id'], $bribe);
         subtractBounty($this->sessionData['char_id'], $bribe / 2);
         $location = 1;
         $quickstat = 'player';
     } else {
         if ($bribe < 0) {
             // Was a bug, now the doshin beats you up!  Yay!
             if (get_gold($this->sessionData['char_id']) > 1000) {
                 //  *** If they have more than 1000 gold, their bounty will be mostly removed by this event.
                 $bountyReduction = getBounty($this->sessionData['char_id']) * 0.7;
                 subtractBounty($this->sessionData['char_id'], $bountyReduction);
             }
             subtractGold($this->sessionData['username'], floor(getGold($this->sessionData['username']) * 0.8));
             //Takes away 80% of the players gold.
             $location = 2;
             $quickstat = 'player';
         } else {
             $location = 0;
             $error = 5;
         }
     }
     return $this->render(['error' => $error, 'quickstat' => $quickstat, 'location' => $location, 'command' => 'bribe']);
 }