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

PHP is_module_active函数代码示例

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

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



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

示例1: mutemod_domute

function mutemod_domute($id)
{
    global $session;
    $op = httpget('op');
    if (is_module_active("biocomment") && httpget('refresh')) {
        return false;
    }
    if ($op == "mute") {
        set_module_pref("muted", 1, false, $id);
        modulehook("mute", array("userid" => $id, "staffid" => $session['user']['acctid'], "when" => date("Y-m-d H:i:s")));
        output("`n`\$This player has now been muted!");
        output("`nThis will last until it is lifted, by you or another member of staff!`0`n");
    } elseif ($op == "unmute") {
        set_module_pref("muted", 0, false, $id);
        output("`n`\$This player has now been unmuted!");
        output("`nThey can talk again!`0`n");
    } elseif ($op == "tempmute") {
        set_module_pref("tempmute", 1, false, $id);
        modulehook("tempmute", array("userid" => $id, "staffid" => $session['user']['acctid'], "length" => 1, "when" => date("Y-m-d H:i:s")));
        output("`n`\$This player has now been muted temporarily!");
        output("`nThey cannot talk until the next new day!`0`n");
    } elseif ($op == "untempmute") {
        set_module_pref("tempmute", 0, false, $id);
        output("`n`\$This player has now been unmuted (from a temporary mute)!");
        output("`nThey can talk again!`0`n");
    } elseif ($op == "exttempmute") {
        $tmuted = get_module_pref("tempmute", false, $id) + 1;
        set_module_pref("tempmute", $tmuted, false, $id);
        modulehook("tempmute", array("userid" => $id, "staffid" => $session['user']['acctid'], "length" => $tmuted, "when" => date("Y-m-d H:i:s")));
        output("`n`\$This player´s tempory mute has been extended!");
        output("`nThey cannot talk until %s days have passed!`0`n", $tmuted);
    }
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:33,代码来源:mutemod.php


示例2: cakeordeath_run

function cakeordeath_run()
{
    global $session;
    page_header("Cake Or Death");
    switch (httpget("op")) {
        case "examine":
            // Tell the player what the deal with Cake Or Death is
            $counter = number_format(get_module_setting("counter"));
            output("`0A shiny wooden table sits back from the main street.  Behind it, a man sits idly reading the Improbable Island Enquirer.  Before him, sat on the table, is a large sponge cake.  Above him is a banner, displaying the name of his game:`b'`5Cake`0 or `4Death!`0'`b`n`nHe sees you pondering the sign, and calls over to you.  `b'`5Cake`0 or `4Death!`0  `b`5Cake`0 or `4Death!`0' he cries.  'Ninety-nine per cent chance of `b`5Cake`0`b!'`n`nIt's not often that an immaculately-dressed gentleman with glowing green eyes offers you a 99% chance of cake.  What would you like to do?");
            //add navs
            addnav("CAKE!", "runmodule.php?module=cakeordeath&op=play");
            addnav("Back away slowly", "village.php");
            break;
        case "play":
            $counter = get_module_setting("counter");
            addnav("Back to the Outpost", "village.php");
            if ($counter > 0) {
                output("The green-eyed gentleman hands you a slice of cake, on a paper plate.  You thank him, and walk away merrily wolfing down your prize.`n`nYou feel `5Full Of Cake!`0");
                set_module_setting("counter", get_module_setting("counter") - 1);
                apply_buff('tastycake', array("name" => "`5Full Of Cake`0", "rounds" => 10, "atkmod" => 1.1, "defmod" => 1.1, "roundmsg" => "`5The cake you ate earlier has boosted your energy!`n", "schema" => "module-cakeordeath"));
            }
            if ($counter <= 0) {
                output("The green-eyed gentleman hands you a slice of cake, on a paper plate.  You thank him, and walk away merrily wolfing down your prize.`n`nYou feel `5Full Of Cake!`0`n`nMoments later, the slow-acting poison starts to take effect.  The world begins to melt in front of you.  Grey spots dance on the edges of your vision.  Behind you, a green-eyed monster offers you another slice of cake, laughing and pointing.`n`nYou curse your luck as the hallucinations begin to kick in.");
                set_module_setting("counter", 100);
                apply_buff('failcake', array("name" => "`5Full Of FailCake`0", "rounds" => -1, "regen" => -10, "startmsg" => "`5You are walking on pink icing.  The sky is made of jam.  Your eyes are two cherries.  That cake was awesome.`0`n", "roundmsg" => "`5The poisoned cake saps your strength, and you lose ten hitpoints!`0`n", "schema" => "module-cakeordeath"));
                if (is_module_active("medals")) {
                    require_once "modules/medals.php";
                    medals_award_medal("failcake", "Failcake Fancier", "This player was unfortunate at the Cake or Death stand...", "medal_failcake.png");
                }
            }
            break;
    }
    page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:34,代码来源:cakeordeath.php


示例3: marriage_lovedrinks

function marriage_lovedrinks()
{
    $z = 2;
    $s = get_module_setting('loveDrinksAdd');
    if (is_module_installed('drinks') && $s < $z) {
        $sql = array();
        $ladd = array();
        if ($s < 1) {
            // We use 'lessthan' so more drinks can be packaged with this
            $sql[] = "INSERT INTO " . db_prefix("drinks") . " VALUES (0, 'Love Brew', 1, 25, 5, 0, 0, 0, 20, 0, 5, 15, 0.0, 0, 0, 'Cedrik reaches under the bar, pulling out a purple cupid shaped bottle... as he pours it into a crystalline glass, the glass shines and he puts a pineapple within the liquid... \"Here, have a Love Brew..\" says Cedrik.. and as you try it, you feel uplifted!', '`%Love Brew', 12, 'You remember love..', 'Despair sets in.', '1.1', '.9', '1.5', '0', '', '', '')";
            $ladd[] = "Love Brew";
        }
        if ($s < 2) {
            // We use 'lessthan' so more drinks can be packaged with this
            $sql[] = "INSERT INTO " . db_prefix("drinks") . " VALUES (0, 'Heart Mist', 1, 25, 5, 0, 0, 0, 20, 0, 5, 15, 0.0, 0, 0, 'Cedrik grabs for a rather garish looking bottle on the shelf behind him... as he pours it into a large yellow mug, the porcelain seems to dissolve.. ooh er.. he puts a tomato within the sweet smelling gunk... \"Here, have a Heart Mist..\" says Cedrik.. and as you try it, you see symbols of love!', '`\$Heart Mist', 18, '`%Misty hearts fly around you..', '`#The sky falls...', '1.1', '.9', '1.5', '0', '', '', '')";
            $ladd[] = "Heart Misy";
        }
        foreach ($sql as $val) {
            db_query($val);
        }
        foreach ($ladd as $val) {
            $sql = "SELECT * FROM " . db_prefix("drinks") . " WHERE name='{$val}' ORDER BY costperlevel";
            $result = db_query($sql);
            $row = db_fetch_assoc($result);
            set_module_objpref('drinks', $row['drinkid'], 'loveOnly', 1, 'marriage');
        }
        set_module_setting('loveDrinksAdd', $z);
        output("`n`c`b`^Marriage Module - Drinks have been added to the Loveshack`0`b`c");
    } elseif (!is_module_active('drinks')) {
        set_module_setting('loveDrinksAdd', 0);
    }
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:32,代码来源:lovedrinks.php


示例4: marriage_install

function marriage_install()
{
    if (!is_module_active('marriage')) {
        output_notl("`n`c`b`QMarriage Module - Installed`0`b`c");
    } else {
        output_notl("`n`c`b`QMarriage Module - Updated`0`b`c");
    }
    module_addhook("drinks-text");
    module_addhook("drinks-check");
    module_addhook("moderate");
    module_addhook("newday");
    module_addhook("changesetting");
    module_addhook_priority("footer-inn", 1);
    module_addhook("village");
    module_addhook("footer-hof");
    module_addhook("superuser");
    module_addhook("footer-oldchurch");
    module_addhook("footer-gardens");
    module_addhook("delete_character");
    //module_addhook("charstats");
    module_addhook("faq-toc");
    module_addhook("biostat");
    module_addhook("allprefs");
    module_addhook("allprefnavs");
    if ($SCRIPT_NAME == "modules.php") {
        $module = httpget("module");
        if ($module == "marriage") {
            require_once "modules/marriage/lovedrinks.php";
            marriage_lovedrinks();
        }
    }
    return true;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:33,代码来源:marriage.php


示例5: ecs_load_module_dependencies

function ecs_load_module_dependencies()
{
    if (is_module_active('econsult')) {
        require_once get_stylesheet_directory() . '/modules/econsult/acf_export/econsult-acf-fields.php';
    }
    if (is_module_active('testimonials')) {
        require_once get_stylesheet_directory() . '/modules/testimonials/acf-field.php';
    }
}
开发者ID:Johnystardust,项目名称:ecs-247-bereikbaar,代码行数:9,代码来源:modules.php


示例6: letteropener_install

function letteropener_install()
{
    if (!is_module_active('letteropener')) {
        output("`2Installing Letter opener Module.`n");
        output("`b`4Be sure to set access for Admin and Moderators from User Settings!`b`n");
    }
    set_module_pref("letteraccess", 1, "letteropener");
    module_addhook("footer-popup");
    module_addhook("superuser");
    return true;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:11,代码来源:letteropener.php


示例7: serialisededitor_install

function serialisededitor_install()
{
    if (is_module_active('serialisededitor')) {
        output("`c`b`QUpdating 'serialisededitor' Module.`0`b`c`n");
    } else {
        output("`c`b`QInstalling 'serialisededitor' Module.`0`b`c`n");
        $sarray = array('weapon' => 'sword', 'armour' => 'shield', 'horse' => array('saddle' => 'yes', 'saddlebags' => array('clothes' => array('shirt' => 'yes', 'trousers' => 'yes', 'money' => array('gold' => 36363, 'gems' => 32), 'shoes' => 'yes')), 'feed' => 'straw'), 'rucksack' => array('food' => 'sandwiches and biscuits.', 'drink' => '5 cans of lager.'), 'pockets' => array('lint' => 'fluff', 'button' => 'why is there a button in my pocket?'));
        set_module_setting('array', serialize($sarray));
    }
    module_addhook('superuser');
    return TRUE;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:12,代码来源:serialisededitor.php


示例8: translationwizard_install

function translationwizard_install()
{
    module_addhook("superuser");
    module_addhook("header-modules");
    if (is_module_active("translationwizard")) {
        output_notl("`c`b`\$ Module Translationwizard updated`b`c`n`n");
    }
    $wizard = array('tid' => array('name' => 'tid', 'type' => 'int(11) unsigned', 'extra' => 'auto_increment'), 'language' => array('name' => 'language', 'type' => 'varchar(10)'), 'uri' => array('name' => 'uri', 'type' => 'varchar(255)'), 'intext' => array('name' => 'intext', 'type' => 'text'), 'outtext' => array('name' => 'outtext', 'type' => 'text'), 'author' => array('name' => 'author', 'type' => 'varchar(50)'), 'version' => array('name' => 'version', 'type' => 'varchar(50)'), 'key-PRIMARY' => array('name' => 'PRIMARY', 'type' => 'primary key', 'unique' => '1', 'columns' => 'tid'), 'key-one' => array('name' => 'language', 'type' => 'key', 'unique' => '0', 'columns' => 'language,uri'), 'key-two' => array('name' => 'uri', 'type' => 'key', 'unique' => '0', 'columns' => 'uri'));
    require_once "lib/tabledescriptor.php";
    synctable(db_prefix("temp_translations"), $wizard, true);
    return true;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:12,代码来源:translationwizard.php


示例9: friendlist_install

function friendlist_install()
{
    if (!is_module_active('friendlist')) {
        output("`n`c`b`QFriend List Module - Installed`0`b`c");
    } else {
        output("`n`c`b`QFriend List Module - Updated`0`b`c");
    }
    module_addhook("checkuserpref");
    module_addhook("faq-toc");
    module_addhook("mailfunctions");
    module_addhook("charstats");
    return true;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:13,代码来源:friendlist.php


示例10: worldmapen_dohook

function worldmapen_dohook($hookname, $args)
{
    global $session;
    // If the cities module is deactivated, we do nothing.
    if (!is_module_active("cities")) {
        return $args;
    }
    if (file_exists("modules/worldmapen/dohook/{$hookname}.php")) {
        require "modules/worldmapen/dohook/{$hookname}.php";
    } else {
        debug("Sorry, I don't have the hook '{$hookname}' programmed.");
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:14,代码来源:worldmapen.php


示例11: settings_getmoduleinfo

/**
 * Settings
 * 
 * Provides a more organized preference system. Allows admins to restructure
 * their settings layout easily.
 * 
 * @author Stephen Kise
 * @todo Fix the template preference and cookie manipulation.
 */
function settings_getmoduleinfo()
{
    $info = ['name' => 'Settings', 'author' => '`&`bStephen Kise`b', 'version' => '0.1', 'category' => 'Miscellaneous', 'description' => 'A more organized preference system.', 'download' => 'nope'];
    // is_module_active() apparently only returns true after the module has been
    // encoutered... Just click 'reinstall' to quickly see the settings.
    if (is_module_active('settings') && $info['settings']['rewrite'] == '') {
        $userprefs = db_prefix('module_userprefs');
        $modules = db_prefix('modules');
        $sql = db_query("SELECT DISTINCT mu.modulename, mu.setting, m.formalname\n            FROM {$userprefs} AS mu\n            LEFT JOIN {$modules} AS m ON m.modulename = mu.modulename\n            WHERE setting LIKE 'user_%'");
        $fill = [];
        while ($row = db_fetch_assoc($sql)) {
            $fill["{$row['modulename']}__{$row['setting']}"] = $row['formalname'];
        }
        $info['settings']['rewrite'] = 'Rewrite condition for module settings, textarea| ' . json_encode($fill);
    }
    return $info;
}
开发者ID:stephenKise,项目名称:Legend-of-the-Green-Dragon,代码行数:26,代码来源:settings.php


示例12: farmhouses_install

function farmhouses_install()
{
    module_addhook("dwellings");
    module_addhook("dwellings-list-type");
    if (!is_module_active('farmhouses')) {
        $sql = "SELECT module FROM " . db_prefix("dwellingtypes") . " WHERE module='farmhouses'";
        $res = db_query($sql);
        if (db_num_rows($res) == 0) {
            $sql = "INSERT INTO " . db_prefix("dwellingtypes") . " (module) VALUES ('farmhouses')";
            db_query($sql);
        }
    }
    $sql = "SELECT typeid FROM " . db_prefix("dwellingtypes") . " WHERE module='farmhouses'";
    $result = db_query($sql);
    $row = db_fetch_assoc($result);
    set_module_setting("typeid", $row['typeid'], "farmhouses");
    return true;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:18,代码来源:farmhouses.php


示例13: 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


示例14: strategyhut_run

function strategyhut_run()
{
    global $session;
    $cost = get_module_setting("cost");
    $op = httpget("op");
    page_header("The Strategy Hut");
    output("`5`c`bThe Strategy Hut`b`c");
    if ($op == "") {
        addnav(array("Ask for Advice (`^%s gold`0)", $cost), "runmodule.php?module=strategyhut&op=ask");
        output("`&You enter the hut, to find `6Atrus `&busy at his desk.");
        output("\"`^Well, a young warrior in search of help!");
        output("For a small fee, I will offer advice to you.`3\"`n`n");
        output("`&Hesitantly, you approach the burly warrior.`n`n");
        output("`&You blink a few times before you realize he was actually talking to you.");
        output("`6Atrus `&doesn't seem very patient, so you'd better decide quickly if you want to hear his advice!`n");
    } elseif ($session['user']['gold'] < $cost) {
        output("`&You go through your pockets, searching for money, but you don't have enough.");
        output("After a moment of intense searching, `6Atrus `&starts to scowl, and you decide to leave before he gets annoyed.`n`n");
    } else {
        $session['user']['gold'] -= $cost;
        debuglog("spent {$cost} gold at the strategy hut");
        output("`&You give `6Atrus `^%s gold`7.", $cost);
        output("`&He nods, and thinks for a moment.`n`n");
        $phrases = array("\"`^Heal often, bank often.`3\"", "\"`^Think balance: weapons and armor must be close in level, not enough defense and your first attack will be your last.`3\"", "\"`^Don't be afraid to slum, in the lower DK levels, speed is NOT a priority. Later is different.`3\"", "\"`^That stat bar is your life, when it gets into the yellow zone, heal. When it goes red, pray.`3\"", "\"`^In PvP, pick your targets with care. If not sure, DON'T... or you'll be explaining to {deathoverlord}`^ what happened.`3\"", "\"`^You don't always need to resurrect. There will be times to save favor for emergencies.`3\"", "\"`^If it's a game bug, petition it. If it's a gameplay issue, petition it.`3\"", "\"`^A good offense is not always a good defense, even the strongest players die in the forest.`3\"", "\"`^Confidence is one thing: attacking a God is suicide. Check the bio first.`3\"", "\"`^Keep an open mind and think it through. Only a fool fights blindly.`3\"", "\"`^There is a dragon, and when you are ready, it will be too. Patience.`3\"", "\"`^Travelling between towns can be dangerous. Heal first.`3\"", "\"`^Talk to everyone in all the villages, visit the shops and stalls. Explore. Learn.`3\"", "\"`^Lower DK players die often in the beginning. It happens to all of us.`3\"", "\"`^When you face the dragon, be ready and fully healed... or it will eat you for lunch.`3\"", "\"`^Your mount or familiar is an asset... learn what it can do, and know its limits. *And* yours, as well.`3\"", "\"`^There is no shame in knowing when to run. Better a bruised ego than a visit to {deathoverlord}`^.`3\"", "\"`^Log in ONCE per game day only, or you will be killed repeatedly... and lose experience as a result. There is no safe place.`3\"", "\"`^If you can't resurrect, log off and wait for New Day. You are already dead.`3\"", "\"`^A good player treats his fellows with courtesy and respect. A wise player knows that new friends can help him succeed.`3\"", "\"`^Don't forget to feed your mount or familiar.`3\"");
        $question = e_rand(0, count($phrases) - 1);
        $phrases = translate_inline($phrases);
        $myphrase = $phrases[$question];
        $myphrase = str_replace('{deathoverlord}', getsetting('deathoverlord', '`$Ramius'), $myphrase);
        output_notl("%s`n`n", $myphrase);
        output("`&You ponder his advice for a moment, before thanking him and making your exit.`n`n");
        if (is_module_active("medals")) {
            require_once "modules/medals.php";
            medals_award_medal("strategyhut", "Strategy Seeker", "This player asked for help in the Strategy Hut.", "medal_strategy.png");
        }
    }
    villagenav();
    page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:38,代码来源:strategyhut.php


示例15: timedcombat_teach_dohook

function timedcombat_teach_dohook($hookname, $args)
{
    global $session, $last_timestamp;
    switch ($hookname) {
        case "newday":
            set_module_pref("taughttoday", 0);
            break;
        case "biostat":
            if (httpget('op') == "teachtimedcombat") {
                set_module_pref("able", true, "timedcombat", $args['acctid']);
                debug(get_module_pref("able", "timedcombat", $args['acctid']));
                set_module_pref("taughttoday", 1);
                increment_module_pref("taught");
                output("`bYou have successfully taught this character how to do Timed Combat!`b`n");
                if (is_module_active("medals")) {
                    require_once "modules/medals.php";
                    medals_award_medal("timedcombat_teach", "Time Tutor", "This player taught another player how to do Timed Combat!", "medal_timeteacher.png");
                }
                require_once "lib/systemmail.php";
                $subj = $session['user']['name'] . " taught you a new skill!";
                $body = "You can now perform Timed Combat in fights!  If you time your fight commands correctly, you'll get a double-attack and double-defence bonus!  The bonus applies to everything you do in combat.  Try timing your five-round auto-fights - one correct hit wins you five rounds of extra power, and the same goes for ten-round auto-fighting too!  If you don't want to muck about with counting under your breath, you can ignore the new skill and carry on fighting as you've always done.  Get four perfect hits in a row and you can teach other players!  Have fun!";
                systemmail($args['acctid'], $subj, $body);
            }
            $ret = httpget('ret');
            if ($args['acctid'] != $session['user']['acctid'] && !get_module_pref("taughttoday") && get_module_pref("maxchain", "timedcombat") >= 4) {
                //get the players' chat locations from commentaryinfo.php - it's handy!
                $tloc = get_module_pref("loc", "commentaryinfo");
                $sloc = get_module_pref("loc", "commentaryinfo", $args['acctid']);
                if ($tloc == $sloc && !get_module_pref("able", "timedcombat", $args['acctid'])) {
                    output("This player doesn't know how to do Timed Combat.  You can teach one student per game day.`n`n");
                    addnav("Teach this player the Timed Combat skill", "bio.php?op=teachtimedcombat&char=" . $args['acctid'] . "&ret=" . urlencode($ret));
                }
            }
            break;
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:37,代码来源:timedcombat_teach.php


示例16: supplycrate_use

function supplycrate_use($args)
{
    increment_module_pref("cratesopened", 1, "supplycrates");
    $found = get_module_pref("cratesopened", "supplycrates");
    if (is_module_active("medals")) {
        if ($found > 250) {
            require_once "modules/medals.php";
            medals_award_medal("crate1000", "Supreme Crate Finder", "This player has opened more than 250 Supply Crates!", "medal_crategold.png");
        }
        if ($found > 50) {
            require_once "modules/medals.php";
            medals_award_medal("crate500", "Expert Crate Finder", "This player has opened more than 50 Supply Crates!", "medal_cratesilver.png");
        }
        if ($found > 10) {
            require_once "modules/medals.php";
            medals_award_medal("crate100", "Supreme Crate Finder", "This player has opened more than 10 Supply Crates!", "medal_cratebronze.png");
        }
    }
    $crateables = get_items_with_settings("cratefind");
    $randompool = array();
    foreach ($crateables as $item => $prefs) {
        for ($i = 0; $i < $prefs['cratefind']; $i++) {
            $randompool[] = $item;
        }
    }
    output("You spend a few minutes prying open your Supply Crate.`n");
    $giveitems = array();
    $numitems = e_rand(get_module_setting("minitems", "supplycrates"), get_module_setting("maxitems", "supplycrates"));
    $chosenitems = array_rand($randompool, $numitems);
    foreach ($chosenitems as $key => $poolkey) {
        $item = $randompool[$poolkey];
        $name = $crateables[$item]['verbosename'];
        output("You find a %s!`n", $name);
        give_item($item);
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:37,代码来源:supplycrate.php


示例17: druid_runevent

function druid_runevent($type, $link)
{
    global $session;
    $session['user']['specialinc'] = "module:druid";
    $op = httpget('op');
    if ($op == "" || $op == "search") {
        output("`n`2You enter a meadow, dominated by the largest `@Oak Tree `2you have ever seen.`n`n");
        output("`6Beneath the tree is a small cottage, an ancient figure standing before it.`n");
        output("`6Despite his elfin features, you instinctively know him to be a `%Druid Priest.`n`n");
        output("`@He offers you a bowl of `^Hearty Broth.");
        output("`@Unsure of his benevolence, what do you do?");
        addnav("Accept the Broth", "forest.php?op=take");
        addnav("Refuse the Broth", "forest.php?op=dont");
    } elseif ($op == "take") {
        $session['user']['specialinc'] = "";
        output("`n`@You take the `^Bowl of Broth`@ and raise it to your lips.");
        output("After a brief hesitation, you drink deeply.");
        output("`@ You feel the `^Broth `@burning within you.`n`n ");
        switch (e_rand(1, 10)) {
            case 1:
                output("`6The broth fills you with ENERGY.`n`n");
                output("You gain some Stamina!`n");
                $session['user']['turns'] += 2;
                break;
            case 2:
                output("`6The broth enhances your vision.`n`n");
                output("You find `^2 Gems `6on the ground!`n");
                debuglog("gained 2 Gems from Druid");
                $session['user']['gems'] += 2;
                break;
            case 3:
                output("`6The broth must have had some oysters in it!`n`n");
                output("`^You gain `^5 charm!");
                $session['user']['charm'] += 5;
                break;
            case 4:
                output("`6The broth fills you with strength!`n`n");
                $hptype = "permanently";
                if (!get_module_setting("carrydk") || is_module_active("globalhp") && !get_module_setting("carrydk", "globalhp")) {
                    $hptype = "temporarily";
                }
                $hptype = translate_inline($hptype);
                output("`6Your maximum hitpoints are `b%s`b `&increased`6 by 1!", $hptype);
                $session['user']['maxhitpoints'] += 1;
                $session['user']['hitpoints'] += 1;
                set_module_pref("extrahps", get_module_pref("extrahps") + 1);
                break;
            case 5:
            case 6:
                output("`6You gag on the foul tasting liquid!`n`n");
                $dkhp = 0;
                while (list($key, $val) = each($session['user']['dragonpoints'])) {
                    if ($val == "hp") {
                        $dkhp++;
                    }
                }
                $maxhitpoints = 10 * $session['user']['level'] + $dkhp * 5;
                suspend_temp_stats();
                if ($session['user']['maxhitpoints'] > $maxhitpoints) {
                    $hptype = "permanently";
                    if (!get_module_setting("carrydk") || is_module_active("globalhp") && !get_module_setting("carrydk", "globalhp")) {
                        $hptype = "temporarily";
                    }
                    $hptype = translate_inline($hptype);
                    $session['user']['maxhitpoints'] -= 1;
                    set_module_pref("extrahps", get_module_pref("extrahps") - 1);
                    output("`6Your maximum hitpoints are `b%s`b `\$decreased`6 by 1!`n", $hptype);
                }
                if ($session['user']['hitpoints'] > 3) {
                    $session['user']['hitpoints'] -= 2;
                    output("`6You `\$lose 2 `6hitpoints and gain some rather bad breath!");
                }
                restore_temp_stats();
                break;
            case 7:
                $expgain = round($session['user']['experience'] * 0.1, 0);
                if ($expgain < 10) {
                    $expgain = 10;
                }
                $session['user']['experience'] += $expgain;
                output("`6 Your faith was well placed, pilgrim!`n`n");
                output("`6You gain `^%s experience`6!`n", $expgain);
                break;
            case 8:
                if ($session['user']['charm'] > 3) {
                    output("`6The broth spills down your new tunic, detracting from your charm!`n`n");
                    output("`6You `\$lose 2 `6charm!");
                    $session['user']['charm'] -= 2;
                } else {
                    output("`6The Elvish broth warms your body and gives your skin a healthy glow.");
                    output("You `^gain 2 `6charm!");
                    $session['user']['charm'] += 2;
                }
                break;
            case 9:
                $loss = round($session['user']['hitpoints'] * 0.7, 0);
                if ($loss > 0 && $session['user']['hitpoints'] > $loss) {
                    output("`6The broth leaves you feeling weakened.`n`n");
                    output("You `\$lose `^%s `6hitpoints!", $loss);
                    $session['user']['hitpoints'] -= $loss;
//.........这里部分代码省略.........
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:101,代码来源:druid.php


示例18: stocks_dohook

function stocks_dohook($hookname, $args)
{
    global $REQUEST_URI;
    global $session;
    $stocks = get_module_setting("victim");
    $capital = getsetting("villagename", LOCATION_FIELDS);
    switch ($hookname) {
        case "village-desc":
            if ($session['user']['location'] != $capital) {
                break;
            }
            $op = httpget("op");
            if ($op == "stocks") {
                // Get rid of the op=stocks bit from the URI
                $REQUEST_URI = preg_replace("/[&?]?op=stocks/", "", $REQUEST_URI);
                $_SERVER['REQUEST_URI'] = preg_replace("/[&?]?op=stocks/", "", $_SERVER['REQUEST_URI']);
                if ($stocks == 0) {
                    output("`n`0You head over to examine the stocks, and wondering how they work, you place your head and hands in the notches for them when SNAP, they clap shut, trapping you inside!`0`n");
                    modulehook("stocksenter");
                } elseif ($stocks != $session['user']['acctid']) {
                    $sql = "SELECT name FROM " . db_prefix("accounts") . " WHERE acctid='{$stocks}'";
                    $result = db_query_cached($sql, "stocks");
                    $row = db_fetch_assoc($result);
                    output("`n`0You head over to examine the stocks, and out of compassion, you help %s`0 out of the stocks.  ", $row['name']);
                    output("Wondering how they got in there in the first place, you place your own head and hands in them when SNAP, they clap shut, trapping you inside! `0`n");
                    modulehook("stocksenter");
                }
                set_module_setting("victim", $session['user']['acctid']);
                invalidatedatacache("stocks");
            } else {
                $examine = translate_inline("Examine Stocks");
                if ($stocks == 0) {
                    output("`n`0Next to the stables is an empty set of stocks.");
                    rawoutput(" [<a href='village.php?op=stocks'>{$examine}</a>]");
                    output_notl("`0`n");
                    addnav("", "village.php?op=stocks");
                } elseif ($stocks == $session['user']['acctid']) {
                    output("`n`@You are now stuck in the stocks!  All around you, people gape and stare. Small children climb on your back, waving wooden swords, and declaring you to be the slain dragon, with them the victor.  This really grates you because you know you could totally take any one of these kids!  Nearby, artists are drawing caricatures of paying patrons pretending to throw various vegetables at you.`0`n");
                    if (is_module_active("medals")) {
                        require_once "modules/medals.php";
                        medals_award_medal("stocks", "Stock Hog", "This player got stuck in the stocks!", "medal_stockades.png");
                    }
                } else {
                    $sql = "SELECT name FROM " . db_prefix("accounts") . " WHERE acctid='{$stocks}'";
                    $result = db_query_cached($sql, "stocks");
                    $row = db_fetch_assoc($result);
                    output("`n`0Next to the statue is a set of stocks in which `&%s`0 seems to have become stuck!", $row['name']);
                    output_notl(" [");
                    rawoutput("<a href='village.php?op=stocks'>{$examine}</a>");
                    output_notl("]`0`n");
                    addnav("", "village.php?op=stocks");
                }
            }
            break;
        case "dragonkill":
        case "namechange":
            if ($stocks == $session['user']['acctid']) {
                invalidatedatacache("stocks");
            }
            break;
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:63,代码来源:stocks.php


示例19: racekittymorph_checkcity


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP is_module_enabled函数代码示例发布时间:2022-05-15
下一篇:
PHP is_moderator函数代码示例发布时间: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