• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP modulehook函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中modulehook函数的典型用法代码示例。如果您正苦于以下问题:PHP modulehook函数的具体用法?PHP modulehook怎么用?PHP modulehook使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了modulehook函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: module_do_event

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;
}
开发者ID:stephenKise,项目名称:Legend-of-the-Green-Dragon,代码行数:31,代码来源:modules.php


示例2: scry_dohook

function scry_dohook($hookname, $args)
{
    global $session;
    switch ($hookname) {
        case "commentary":
            if (get_module_pref("speaking")) {
                set_module_pref("talks", get_module_pref("talks") + 1);
            }
            break;
        case "gypsy":
            set_module_pref("talks", 0);
            $cost = get_module_setting("cost") * $session['user']['level'];
            output("`n`nOff in the corner, you see a dark bowl of water sitting atop a silver tray.");
            output("Noticing your gaze, the old gypsy woman rasps, \"`!Ahh, perhaps you seek to talk to people in one of the other towns?  I could do that -- for the very small price of `^%s`! gold.`5\"", $cost);
            addnav(array("Scrying (%s gold)", $cost));
            $vloc = array();
            $vname = getsetting("villagename", LOCATION_FIELDS);
            $vloc[$vname] = "village";
            $vloc = modulehook("validlocation", $vloc);
            // this is a different modulehook call because
            // there is more than one "validlocation" modulehook
            $vloc = modulehook("scrylocation", $vloc);
            ksort($vloc);
            reset($vloc);
            foreach ($vloc as $loc => $val) {
                if ($loc == $session['user']['location']) {
                    continue;
                }
                addnav(array("Scry %s", $loc), "runmodule.php?module=scry&op=pay&area=" . htmlentities($val, ENT_COMPAT, getsetting("charset", "ISO-8859-1")) . "&village=" . htmlentities($loc, ENT_COMPAT, getsetting("charset", "ISO-8859-1")));
            }
            break;
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:34,代码来源:scry.php


示例3: oneshotteleporter_run

function oneshotteleporter_run()
{
    global $session;
    $to = httpget("to");
    if ($to == "") {
        page_header("The Void");
        output("You press the button on your One-Shot Teleporter.  One obligatory blinding flash of light and pain later, you find yourself floating around in empty black nothingness!`n`nA flashing red light and an annoying BEEPing noise from your device insists that you select a destination, and quickly, before you find yourself stuck here or imploded.");
        $vloc = array();
        $vname = getsetting("villagename", LOCATION_FIELDS);
        $vloc[$vname] = "village";
        $vloc = modulehook("validlocation", $vloc);
        ksort($vloc);
        reset($vloc);
        addnav("Choose a Destination");
        foreach ($vloc as $loc => $val) {
            addnav(array("Go to %s", $loc), "runmodule.php?module=oneshotteleporter&to=" . htmlentities($loc));
        }
    } else {
        page_header("Back to Reality");
        output("You quickly select an outpost from the list.  With a sudden jolt, you find yourself standing in the middle of your chosen outpost!  You look around for your teleporting device, but realise that it must have only teleported you, not itself.  What a piece of junk.");
        $session['user']['location'] = $to;
        $session['user']['specialinc'] = "";
        addnav("Continue");
        addnav("Back to the Outpost", "village.php");
    }
    page_footer();
    return true;
}
开发者ID:Beeps,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:28,代码来源:oneshotteleporter.php


示例4: mysticalshop_destroyitem

function mysticalshop_destroyitem($item_type, $rare_id = FALSE, $userid = FALSE)
{
    global $session;
    $id = "";
    if ($userid === FALSE) {
        $userid = $session['user']['acctid'];
        $id = get_module_pref($item_type . "id", "mysticalshop", $userid);
    }
    modulehook("mysticalshop-destroyitem", array("itemid" => $id));
    if ($rare_id) {
        $sql = "UPDATE " . db_prefix("magicitems") . " SET rarenum=rarenum+1 WHERE id='{$rare_id}'";
        db_query($sql);
        if (getsetting('usedatacache', false)) {
            invalidatedatacache('modules-mysticalshop-enter');
            require_once './modules/mysticalshop/libcoredup.php';
            mysticalshop_massinvalidate('modules-mysticalshop-viewgoods-');
        }
    }
    $sing_item_type = $item_type;
    if ($item_type == 'boot') {
        $item_type = 'boots';
    }
    // $id = FALSE; <-- What was that here for? --WK
    set_module_pref($item_type, 0, "mysticalshop", $userid);
    //set_module_pref($sing_item_type."id",0,"mysticalshop",$userid);
    set_module_pref($sing_item_type . "name", "None", "mysticalshop", $userid);
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:27,代码来源:lib.php


示例5: avatar_showimages

function avatar_showimages($set)
{
    $races = modulehook("racenames");
    rawoutput("<table cellpadding='0' cellspacing='0' border='0' bgcolor='#999999'>");
    $r = translate_inline("Race");
    $m = translate_inline("Male Image");
    $f = translate_inline("Female Image");
    rawoutput("<tr class='trhead'><th>{$r}</th><th>{$m}</th><th>{$f}</th></tr>");
    $i = 0;
    foreach ($races as $key => $race) {
        $r = strtolower($race);
        $imm = avatar_getimage($r, "male", $set);
        $imf = avatar_getimage($r, "female", $set);
        rawoutput("<tr class='" . ($i % 2 ? "trlight" : "trdark") . "'>");
        rawoutput("<th>");
        output_notl('`^');
        output($race);
        output_notl("`0");
        rawoutput("</th><td>");
        rawoutput($imm);
        rawoutput("</td><td>");
        rawoutput($imf);
        rawoutput("</td>");
        rawoutput("</tr>");
        $i++;
    }
    rawoutput("</table>");
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:28,代码来源:func.php


示例6: fightnav

function fightnav($allowspecial = true, $allowflee = true, $script = false)
{
    global $PHP_SELF, $session, $newenemies, $companions;
    tlschema("fightnav");
    if ($script === false) {
        $script = substr($PHP_SELF, strrpos($PHP_SELF, "/") + 1) . "?";
    } else {
        if (!strpos($script, "?")) {
            $script .= "?";
            //		}elseif (substr($script,strlen($script)-1)!="&" && !substr($script,strlen($script)-1)=="?"){
        } elseif (substr($script, strlen($script) - 1) != "&") {
            $script .= "&";
        }
    }
    $fight = "Fight";
    $run = "Run";
    if (!$session['user']['alive']) {
        $fight = "F?Torment";
        $run = "R?Flee";
    }
    addnav($fight, $script . "op=fight");
    if ($allowflee) {
        addnav($run, $script . "op=run");
    }
    if ($session['user']['superuser'] & SU_DEVELOPER) {
        addnav("Abort", $script);
    }
    if (getsetting("autofight", 0)) {
        addnav("Automatic Fighting");
        addnav("5?For 5 Rounds", $script . "op=fight&auto=five");
        addnav("1?For 10 Rounds", $script . "op=fight&auto=ten");
        $auto = getsetting("autofightfull", 0);
        if (($auto == 1 || $auto == 2 && !$allowflee) && count($newenemies) == 1) {
            addnav("U?Until End", $script . "op=fight&auto=full");
        } elseif ($auto == 1 || $auto == 2 && !$allowflee) {
            addnav("U?Until current enemy dies", $script . "op=fight&auto=full");
        }
    }
    if ($allowspecial) {
        addnav("Special Abilities");
        modulehook("fightnav-specialties", array("script" => $script));
        if ($session['user']['superuser'] & SU_DEVELOPER) {
            addnav("`&Super user`0", "");
            addnav("!?`&&#149; __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();
}
开发者ID:stephenKise,项目名称:Legend-of-the-Green-Dragon,代码行数:58,代码来源:fightnav.php


示例7: dwellingseditor_run

function dwellingseditor_run()
{
    global $session;
    tlschema("dwellingseditor");
    $op = httpget('op');
    if ($op != "lookup") {
        page_header("Dwellings Editor");
    }
    addnav("Navigation");
    addnav("Back to the Grotto", "superuser.php");
    if ($op != "") {
        addnav("Dwelling List", "runmodule.php?module=dwellingseditor");
    }
    addnav("Find Dwellings by User", "runmodule.php?module=dwellingseditor&op=usersearch");
    addnav("Operations");
    if ($op != "typsu") {
        addnav("Type Pref Editor", "runmodule.php?module=dwellingseditor&op=typesu");
    }
    modulehook("dwellingseditor-main");
    $typeid = httpget("typeid");
    $dwid = httpget('dwid');
    $type = httpget("type");
    if ($type == "" && $dwid > 0) {
        $sql = "SELECT type FROM " . db_prefix("dwellings") . " WHERE dwid={$dwid}";
        $result = db_query($sql);
        $row = db_fetch_assoc($result);
        $type = $row['type'];
    }
    if ($dwid > 0) {
        addnav("Operations");
        if ($op != "edit") {
            addnav("Edit Dwelling Details", "runmodule.php?module=dwellingseditor&op=edit&dwid={$dwid}");
        }
        if ($op != "keys") {
            addnav("Manage Keys", "runmodule.php?module=dwellingseditor&op=keys&dwid={$dwid}");
        }
        if ($session['user']['superuser'] & SU_EDIT_COMMENTS) {
            addnav("Moderate Commentary", "moderate.php?area=dwellings-{$dwid}&dwid={$dwid}");
        }
        if ($op != "delete") {
            addnav("Delete this Dwelling", "runmodule.php?module=dwellingseditor&op=delete&dwid={$dwid}");
        }
        modulehook("dwellingseditor", array("dwid" => $dwid));
        addnav("Navigation");
        if ($op != "coffers") {
            addnav("Coffer Log", "runmodule.php?module=dwellingseditor&op=coffers&dwid={$dwid}");
        }
        if ($op != "dwsu") {
            addnav("Dwelling  Viewer", "runmodule.php?module=dwellingseditor&op=dwsu&dwid={$dwid}");
        }
    }
    require_once "modules/dwellingseditor/case_{$op}.php";
    page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:54,代码来源:dwellingseditor.php


示例8: forest

function forest($noshowmessage = false)
{
    global $session, $playermount;
    tlschema("forest");
    //	mass_module_prepare(array("forest", "validforestloc"));
    addnav("Heal");
    addnav("H?Hospital Tent", "healer.php");
    addnav("Fight");
    addnav("L?Look for Something to Kill", "forest.php?op=search");
    if ($session['user']['level'] > 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");
    addnav("Inventory");
    addnav("View your Inventory", "inventory.php?items_context=forest");
    tlschema();
}
开发者ID:Beeps,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:52,代码来源:forest.php


示例9: prepare_fight

/**
 * 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;
}
开发者ID:Beeps,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:19,代码来源:extended-battle.php


示例10: holidayize

function holidayize($text, $type = 'unknown')
{
    global $session;
    if (!isset($session['user']['prefs']['ihavenocheer'])) {
        $session['user']['prefs']['ihavenocheer'] = 0;
    }
    if ($session['user']['prefs']['ihavenocheer']) {
        return $text;
    }
    $args = array('text' => $text, 'type' => $type);
    $args = modulehook("holiday", $args);
    $text = $args['text'];
    return $text;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:14,代码来源:holiday_texts.php


示例11: pvpwarning

function pvpwarning($dokill = false)
{
    global $session;
    $days = getsetting("pvpimmunity", 5);
    $exp = getsetting("pvpminexp", 1500);
    if ($session['user']['age'] <= $days && $session['user']['dragonkills'] == 0 && $session['user']['pk'] == 0 && $session['user']['experience'] <= $exp) {
        if ($dokill) {
            output("`\$Warning!`^ Since you were still under PvP immunity, but have chosen to attack another player, you have lost this immunity!!`n`n");
            $session['user']['pk'] = 1;
        } else {
            output("`\$Warning!`^ Players are immune from Player vs Player (PvP) combat for their first %s days in the game or until they have earned %s experience, or until they attack another player.  If you choose to attack another player, you will lose this immunity!`n`n", $days, $exp);
        }
    }
    modulehook("pvpwarning", array("dokill" => $dokill));
}
开发者ID:stephenKise,项目名称:Legend-of-the-Green-Dragon,代码行数:15,代码来源:pvpwarning.php


示例12: char_cleanup

function char_cleanup($id, $type)
{
    // this function handles the grunt work of character cleanup.
    // Run any modules hooks who want to deal with character deletion, or stop it
    $return = modulehook("delete_character", array("acctid" => $id, "deltype" => $type, "dodel" => true));
    if (!$return['dodel']) {
        return false;
    }
    //erase the player's items
    require_once "lib/items.php";
    items_delete_character($id);
    // 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);
    return true;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:47,代码来源:charcleanup.php


示例13: extrarandom_dohook

function extrarandom_dohook($hookname, $args)
{
    global $session;
    switch ($hookname) {
        case "choosebadguy":
            //If we've seen this creature before, choose a new one
            $pcreatures = @unserialize(get_module_pref("lastcreatures"));
            if (!is_array($pcreatures)) {
                $pcreatures = array();
            }
            if ($args['creatureid'] > 1) {
                global $attempts;
                if (in_array($args['creatureid'], $pcreatures)) {
                    if ($attempts < 3) {
                        //re-roll, getting a creature from the same level
                        debug("We've seen " . $args['creaturename'] . " too recently - switching monster");
                        $lvl = $args['creaturelevel'];
                        $id = $args['creatureid'];
                        if ($args['forest']) {
                            $sql = "SELECT * FROM " . db_prefix("creatures") . " WHERE creaturelevel = {$lvl} AND forest=1 AND creatureid != {$id} ORDER BY rand(" . e_rand() . ") LIMIT 1";
                        } else {
                            if ($args['graveyard']) {
                                $sql = "SELECT * FROM " . db_prefix("creatures") . " WHERE creaturelevel = {$lvl} AND forest=1 AND creatureid != {$id} ORDER BY rand(" . e_rand() . ") LIMIT 1";
                            }
                        }
                        $result = db_query($sql);
                        $args = db_fetch_assoc($result);
                        $attempts++;
                        $args = modulehook("choosebadguy", $args);
                    } else {
                        debug("Screw it!  Too many attempts!");
                    }
                }
                $pcreatures[] = $args['creatureid'];
                $count = count($pcreatures);
                $des = 8;
                if ($count > $des) {
                    for ($i = 0; $i < $count - $des; $i++) {
                        array_shift($pcreatures);
                    }
                }
                set_module_pref("lastcreatures", serialize($pcreatures));
            }
            break;
    }
    return $args;
}
开发者ID:Beeps,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:47,代码来源:extrarandom.php


示例14: increment_specialty

function increment_specialty($colorcode, $spec = false)
{
    global $session;
    if ($spec !== false) {
        $revertspec = $session['user']['specialty'];
        $session['user']['specialty'] = $spec;
    }
    tlschema("skills");
    if ($session['user']['specialty'] != "") {
        $specialties = modulehook("incrementspecialty", array("color" => $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;
    }
}
开发者ID:stephenKise,项目名称:Legend-of-the-Green-Dragon,代码行数:18,代码来源:increment_specialty.php


示例15: peerpressure_runevent

function peerpressure_runevent($type)
{
    global $session;
    $session['user']['specialinc'] = "module:peerpressure";
    // For translation reasons, you cannot really substitute in his/her
    // since the gender can change other things
    if ($session['user']['sex']) {
        addnews("`&%s`7 heroically decided to seek out `@The Green Dragon`7 with cheers of encouragement from her peers ringing in her ears.", $session['user']['name']);
    } else {
        addnews("`&%s`7 heroically decided to seek out `@The Green Dragon`7 with cheers of encouragement from his peers ringing in his ears.", $session['user']['name']);
    }
    output("`2Wandering the village, going about your business, you are suddenly surrounded by a group of villagers.");
    output("They wonder why such an experienced adventurer as yourself hasn't slain a dragon yet.");
    output("You mutter some embarrassed excuses but they aren't listening.");
    output("They crowd around you closer, and lift you up on their shoulders.");
    $isforest = 0;
    $vloc = modulehook('validforestloc', array());
    foreach ($vloc as $i => $l) {
        if ($session['user']['location'] == $l) {
            $isforest = 1;
            break;
        }
    }
    if ($isforest || count($vloc) == 0) {
        output("`n`nCheering your name the whole way, they carry you into the forest, and right to the mouth of a cave outside the town!`n`n");
    } else {
        $key = array_rand($vloc);
        output("`n`nCheering your name the whole way, they carry you far into the forest, and right to the mouth of a cave outside the town of %s!`n`n", $key);
        $session['user']['location'] = $key;
    }
    output("Still cheering your name, they put you down and eagerly wait for you to enter and slay that dragon.`n`n");
    output("You know that you'd never live it down if you tried to back out now.");
    output("Swallowing your fear as best you can, you enter the cave.");
    if (is_module_active("dragonplace")) {
        addnav("Enter the cave", "runmodule.php?module=dragonplace&op=cave");
    } else {
        addnav("Enter the cave", "dragon.php?nointro=1");
    }
    $session['user']['specialinc'] = "";
    checkday();
    //increment buffs, newday buffs, and heal... and probably throw people off in general
    $session['user']['specialinc'] = "module:peerpressure";
    apply_buff('peerpressure', array("name" => "`2Heroic Valor", "rounds" => 20, "atkmod" => 1 + get_module_pref("dayspast") / 100, "defmod" => 1 + get_module_pref("dayspast") / 100, "startmsg" => "`2You fight bravely, considering the pressure you're under.", "wearoff" => "`@The Green Dragon`2 has beaten and burnt the bravery out of you.", "schema" => "module-peerpressure"));
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:44,代码来源:peerpressure.php


示例16: aitest_loadenemy

function aitest_loadenemy($badguy)
{
    global $session;
    if (is_array($badguy)) {
        $badguy['creaturehealth'] = round($badguy['creaturehealth'] * get_module_setting("buffhp", "aitest") / 100);
        $badguy['creatureattack'] = round($badguy['creatureattack'] * get_module_setting("buffattack", "aitest") / 100);
        $badguy['creaturedefense'] = round($badguy['creaturedefense'] * get_module_setting("buffdefense", "aitest") / 100);
        if (!get_module_setting("allowgold")) {
            $badguy['creaturegold'] = 0;
        }
        if (!get_module_setting("allowexp")) {
            $badguy['creatureexp'] = 0;
        }
    } else {
        $badguy = array("creaturename" => "An Evil Doppelganger of " . $session['user']['name'], "creatureattack" => $session['user']['attack'], "creaturedefense" => $session['user']['defense'], "creaturehealth" => $session['user']['maxhitpoints'], "creaturegold" => 0, "creatureexp" => 0);
    }
    $badguy = modulehook("aitest", $badguy);
    return $badguy;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:19,代码来源:func.php


示例17: villagenav

function villagenav($extra = false)
{
    global $session;
    $loc = $session['user']['location'];
    if ($extra === false) {
        $extra = "";
    }
    $args = modulehook("villagenav");
    if (array_key_exists('handled', $args) && $args['handled']) {
        return;
    }
    tlschema("nav");
    if ($session['user']['alive']) {
        addnav(array("V?Return to %s", $loc), "village.php{$extra}");
    } else {
        // user is dead
        addnav("S?Return to the Shades", "shades.php");
    }
    tlschema();
}
开发者ID:stephenKise,项目名称:Legend-of-the-Green-Dragon,代码行数:20,代码来源:villagenav.php


示例18: superusernav

function superusernav()
{
    global $SCRIPT_NAME, $session;
    tlschema("nav");
    addnav("Navigation");
    if ($session['user']['superuser'] & ~SU_DOESNT_GIVE_GROTTO) {
        $script = substr($SCRIPT_NAME, 0, strpos($SCRIPT_NAME, "."));
        if ($script != "superuser") {
            $args = modulehook("grottonav");
            if (!array_key_exists('handled', $args) || !$args['handled']) {
                addnav("G?Return to the Grotto", "superuser.php");
            }
        }
    }
    $args = modulehook("mundanenav");
    if (!array_key_exists('handled', $args) || !$args['handled']) {
        addnav("M?Return to the Mundane", "village.php");
    }
    tlschema();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:20,代码来源:superusernav.php


示例19: addnews

/**
 * Adds a news item for the current user
 *
 * @param string $text Line of text for the news.
 * @param array $options List of options, including replacements, to modify the acctid, date, or hide from biographies.
 * @todo Change the date format from Y-m-d to Y-m-d H:i:s.
 */
function addnews(string $text = '', array $options = [])
{
    global $translation_namespace, $session;
    $options = modulehook('addnews', $options);
    $news = db_prefix('news');
    $replacements = [];
    foreach ($options as $key => $val) {
        if (is_numeric($key)) {
            array_push($replacements, $val);
        }
    }
    $text = sprintf_translate($text, $replacements);
    $date = $options['date'] ?? date('Y-m-d');
    $acctid = $options['acctid'] ?? $session['user']['acctid'];
    if (!$options['hide']) {
        $sql = db_query("INSERT INTO {$news} (newstext, newsdate, accountid, tlschema)\n            VALUES ('{$text}', '{$date}', '{$acctid}', '{$translation_namespace}')");
    } else {
        $sql = db_query("INSERT INTO {$news} (newstext, newsdate, tlschema)\n            VALUES ('{$text}', '{$date}', '{$translation_namespace}')");
    }
}
开发者ID:stephenKise,项目名称:Legend-of-the-Green-Dragon,代码行数:27,代码来源:addnews.php


示例20: worldmapen_editor_manual

function worldmapen_editor_manual($op, $subop, $act)
{
    $vloc = array();
    $vname = getsetting("villagename", LOCATION_FIELDS);
    $vloc[$vname] = "village";
    $vloc = modulehook("validlocation", $vloc);
    ksort($vloc);
    if ($act == "save") {
        foreach ($vloc as $loc => $val) {
            $space_valx = preg_replace('/\\s/', '_', $loc . 'X');
            $space_valy = preg_replace('/\\s/', '_', $loc . 'Y');
            set_module_setting($loc . 'X', httppost($space_valx));
            set_module_setting($loc . 'Y', httppost($space_valy));
            set_module_setting($loc . 'Z', 1);
            // Eventually we'll do the Z coord too
            // set_module_setting($loc.'Z',
            //        httppost($loc."Z"));
        }
        output("`^`bSettings saved successfully.`b`n");
        reset($vloc);
    }
    output("`^Maximum X value is `b%s`b`n", get_module_setting("worldmapsizeX"));
    output("`^Maximum Y value is `b%s`b`n", get_module_setting("worldmapsizeY"));
    $worldarray = array("World Locations,title");
    foreach ($vloc as $loc => $val) {
        $mapx = get_module_setting("worldmapsizeX");
        $mapy = get_module_setting("worldmapsizeY");
        //Added to allow setting cities outside of the map. - Making cities inaccessible via normal travel.
        $myx = $mapx + 1;
        $worldarray[] = array("Locations for %s,title", $loc);
        $worldarray[$loc . 'X'] = array("X Coordinate,range,1,{$myx},1");
        $worldarray[$loc . 'Y'] = array("Y coordinate,range,1,{$mapy},1");
    }
    rawoutput("<form method='post' action='runmodule.php?module=worldmapen&op=edit&subop=manual&act=save&admin=true'>");
    require_once "lib/showform.php";
    global $module_settings;
    showform($worldarray, $module_settings['worldmapen']);
    rawoutput("</form>");
    addnav("", "runmodule.php?module=worldmapen&op=edit&subop=manual&act=save&admin=true");
    addnav("E?Return to World Map Editor", "runmodule.php?module=worldmapen&op=edit&admin=true");
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:41,代码来源:editor.php



注:本文中的modulehook函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP modules_call_method函数代码示例发布时间:2022-05-15
下一篇:
PHP module_url函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap