Example #1
0
<?php

set_include_path("..");
require_once "includes/database.class.php";
include_once "hero/heroController.php";
$heroController = new heroController();
$res = $heroController->performGlobalHealing(0.1);
//heroes now slowly heal when not dead, so this is deprecated - Bill 20160218
//Auto Resurrect Monster Heroes
//$db = DB::GetConn();
//$db->query("UPDATE `Hero` SET CurrentHP = 1 WHERE CurrentHP <= 0 and CurrentHP > -Con and OwnerID = 146 ORDER BY RAND() LIMIT 1");
Example #2
0
<?php

include_once "bootstrap.php";
include_once "hero/heroController.php";
$heroController = new heroController();
/*********get email config*********/
/*$configQuery = "SELECT `ConfigValue` FROM Config WHERE `ConfigKey` = 'notification_email';";

$configResult=mysql_query($configQuery);//execute query
$notificationEmail=mysql_result($configResult,$i,"ConfigValue");

echo $notificationEmail;*/
/**********end get email config********/
//show link to generate new
/*echo '<p>
    Generate Level: 
    <a href="addNew.php?level=1">1</a> 
    <a href="addNew.php?level=2">2</a> 
    <a href="addNew.php?level=3">3</a> 
    <a href="addNew.php?level=4">4</a> 
    <a href="addNew.php?level=5">5</a> 
    <a href="addNew.php?level=6">6</a> 
    <a href="addNew.php?level=7">7</a> 
    <a href="addNew.php?level=8">8</a> 
    <a href="addNew.php?level=9">9</a> 
    <a href="addNew.php?level=10">10</a> 
    <a href="addNew.php?level=20">20</a> 
    <a href="addNew.php?level=30">30</a> 
    <a href="addNew.php?level=40">40</a> 
    <a href="addNew.php?level=50">50</a> 
    <a href="addNew.php?level=60">60</a> 
Example #3
0
<?php

include_once "bootstrap.php";
/*********Generate Hero*********/
include_once "hero/heroController.php";
$heroController = new heroController();
include_once "user/userController.php";
$userController = new userController();
$user = new User();
$user = $user->load($currentUID);
$newHeroCost = $heroController->getCostForNextHero($currentUID);
if ($user->canAfford($newHeroCost)) {
    $user->gold -= $newHeroCost;
    $user->Save();
    $Hero = new Hero();
    $Hero->GenerateHero(1);
    // $_REQUEST["level"]); //generate lvl1 Hero
    $Hero->GiveToUser($currentUID);
    $Hero->generateStartingWeapon();
    //@TODO move this into hero controller so it can follow the correct process (create, give, weapon, ect)
    //save hero
    $Hero->SaveHero();
    /***********end generate Hero *********/
    //check for referer bonus
    if ($newHeroCost > 0 && $user->refererID != 0) {
        $refererUser = new User();
        $refererUser = $refererUser->load($user->refererID);
        $recruitmentBonus = ceil($newHeroCost / 10);
        $refererUser->credit($recruitmentBonus);
        $userController->sendMessage($refererUser->ID, $user->ID, "Recruitment Bonus of " . $recruitmentBonus . " gp", $user->username . " hired a new hero, earning you " . $recruitmentBonus . "gp");
    }
<?php

include_once "bootstrap.php";
include_once "hero/heroController.php";
include_once "user/userController.php";
//html header
$smarty->display("css/css.tpl");
$heroController = new heroController();
$userController = new usercontroller();
//menu
$smarty->assign("currentpage", "leaderboard");
include_once "menu.php";
/*********  Get top 10 lists  ***********/
$smarty->assign("XPHeroes", $heroController->getTop10ByXP());
$smarty->assign("KillHeroes", $heroController->getTop10ByKills());
$smarty->assign("OldHeroes", $heroController->getTop10ByAge());
$smarty->assign("DeathUsers", $userController->getBottom10ByDeath());
$smarty->assign("WealthUsers", $userController->getTop10ByGold());
$smarty->assign("KillUsers", $userController->getTop10ByKills());
$smarty->assign("KilltoDeathRatioUsers", $userController->getTop10ByKillToDeathRatio());
/*********  Get top 10 lists  ***********/
$smarty->display("leaderboard.tpl");
Example #5
0
<?php

set_include_path("..");
require_once "includes/database.class.php";
include_once "hero/heroController.php";
$heroController = new heroController();
$heroController->preformGlobalAge();
<?php

include "bootstrap.php";
include_once "hero/heroController.php";
$heroController = new heroController();
$hero = new Hero();
$hero = $hero->loadHero($_REQUEST['ID']);
if (!$hero->canFight()) {
    //hero is doing something and cant fight
    header('Location: home.php');
    exit(0);
}
$smarty->display("css/css.tpl");
//menu and Help
$smarty->assign("help", "This page displays all the Monsters and Player heroes in the world you can fight. \n\t\t\t\t\t\tA Monsters effectiveness is unknown before fighting them but if you succeed to knock them out, you will be rewarded will gold. \n\t\t\t\t\t\tYou can only fight one level below your current, your current level, and up to two levels above your level when fighting other players heroes.");
$smarty->assign("helpTitle", "Fight Selection Page");
include_once "menu.php";
$smarty->assign("hero", $hero);
$against = $heroController->findEnemys($currentUID, $hero);
$smarty->assign("against", $against);
$smarty->display("oneononechoose.tpl");
Example #7
0
<?php

include "bootstrap.php";
//load User
include_once "user/user.php";
$user = new User();
//hero controller
include_once "hero/heroController.php";
$heroController = new heroController();
//Page Header
$smarty->display("css/css.tpl");
//menu
include_once "menu.php";
if (isset($_REQUEST['ID'])) {
    $user = $user->load($_REQUEST['ID']);
    $smarty->assign("user", $user);
    $smarty->assign("heroCount", $heroController->countAllForUser($user->ID));
} else {
    $smarty->assign("error", "User not found");
}
$smarty->display("viewUser.tpl");
Example #8
0
<?php

include_once "bootstrap.php";
include_once "hero/heroController.php";
//check password is nolonger 'pass'
include_once "user/user.php";
$user = new User();
$user = $user->load($currentUID);
if ($user->password == "pass") {
    header('Location: user.php?action=expiredPassword');
    exit(0);
} else {
    //html header
    $smarty->display("css/css.tpl");
    $heroController = new heroController();
    //menu & help
    $smarty->assign("currentpage", "home");
    $smarty->assign("help", "This page displays all the heroes you have in your guild. New heroes can be purchased using the 'hire new hero' link, provided you have enough gold.\n\t\t\t\t\t\t  Clicking the Fight link on a heroes row will let you send them off to fight monsters and other players heroes.\n\t\t\t\t\t\t  Clicking a heroes name will show more detailed information about that hero.");
    $smarty->assign("helpTitle", "Heroes Page Help");
    include_once "menu.php";
    /*********  show all Hero  ***********/
    $newHeroCost = $heroController->getCostForNextHero($currentUID);
    $smarty->assign("newHeroCost", $newHeroCost);
    if ($user->canAfford($newHeroCost)) {
        $smarty->assign("canAffordHero", true);
    }
    $userHeros = $heroController->getAllForUser($currentUID);
    $smarty->assign("currentUID", $currentUID);
    $smarty->assign("userHeros", $userHeros);
    $smarty->assign("totalHeros", count($userHeros));
    if (count($userHeros) == 0) {
Example #9
0
<?php

chdir("../");
include_once "bootstrap.php";
include_once "hero/heroController.php";
//html header
$smarty->display("css/css.tpl");
$heroController = new heroController();
//menu
$smarty->display("menu.tpl");
/*********  show all Hero  ***********/
$Heros = $heroController->getAll();
$smarty->assign("Heros", $Heros);
$smarty->assign("totalHeros", count($Heros));
$smarty->display("admin/heroes.tpl");
/*********  end show all Hero  ***********/
chdir("admin/");
Example #10
0
<?php

include_once "bootstrap.php";
include_once "hero/weaponController.php";
include_once "hero/heroController.php";
include_once "user/user.php";
$user = new User();
$user = $user->load($currentUID);
$heroController = new heroController();
$userChaBonus = $heroController->getChaModForUser($currentUID);
$smarty->assign("userChaBonus", $userChaBonus);
//html header
$smarty->display("css/css.tpl");
$weaponController = new weaponController();
//menu
$smarty->assign("currentpage", "inventory");
$smarty->assign("help", "This page displays all the weapon you have. Weapons can be scrapped if not required, so long as they are not currently equipped.\n\t\t\t\t\t  Clicking the Weapon Name will allow you to upgrade and rename the weapon. \n\t\t\t\t\t  Clicking a heroes name will show more detailed information about that hero.");
$smarty->assign("helpTitle", "Weapons Page Help");
include_once "menu.php";
if (isset($_REQUEST['action'])) {
    if ($_REQUEST['action'] == "scrap") {
        $scrapWeapon = Weapon::loadWeapon($_REQUEST['ID']);
        if ($scrapWeapon->UserID == $currentUID) {
            if (!is_numeric($scrapWeapon->GetHeroIDFromWeapon())) {
                $user->gold += $scrapWeapon->getScrapValue($userChaBonus);
                $user->Save();
                $scrapWeapon->delete();
                $smarty->assign("message", $scrapWeapon->Name . " has been scrapped for " . $scrapWeapon->getScrapValue($userChaBonus) . "gp");
            } else {
                $smarty->assign("error", "Can not scrap equipped weapons");
            }