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

PHP set_module_pref函数代码示例

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

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



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

示例1: friendlist_unignore

function friendlist_unignore()
{
    global $session;
    $ac = httpget('ac');
    $ignored = rexplode(get_module_pref('ignored', 'friendlist', $ac));
    $iveignored = rexplode(get_module_pref('iveignored'));
    if (in_array($ac, $iveignored)) {
        $sql = "SELECT name FROM " . db_prefix("accounts") . " WHERE acctid={$ac} AND locked=0";
        $result = db_query($sql);
        if (db_num_rows($result) > 0) {
            $row = db_fetch_assoc($result);
            $info = sprintf_translate("%s`Q has been removed from your list.", $row['name']);
            require_once "lib/systemmail.php";
            $t = array("`\$Ignore List Removal");
            $mailmessage = array("%s`0`@ has removed you from %s ignore list.", $session['user']['name'], $session['user']['sex'] ? translate_inline("her") : translate_inline("his"));
            systemmail($ac, $t, $mailmessage);
        } else {
            $info = translate_inline("That user no longer exists...");
        }
    }
    $ignored = array_diff($ignored, array($session['user']['acctid']));
    $ignored = rimplode($ignored);
    set_module_pref('ignored', $ignored, 'friendlist', $ac);
    if (in_array($ac, $iveignored)) {
        $iveignored = array_diff($iveignored, array($ac));
        $iveignored = rimplode($iveignored);
        set_module_pref('iveignored', $iveignored);
    }
    output_notl($info);
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:30,代码来源:friendlist_unignore.php


示例2: iitems_moduleprefs_dohook

function iitems_moduleprefs_dohook($hookname, $args)
{
    global $session;
    switch ($hookname) {
        case "iitems-use-item":
            if ($args['master']['modulepref'] && $args['master']['modulepref_module'] && $args['modulepref_type']) {
                $module = $args['master']['modulepref_module'];
                $pref = $args['master']['modulepref'];
                $val = $args['master']['modulepref_val'];
                if ($args['master']['modulepref_type'] == "increment") {
                    increment_module_pref($pref, $val, $module);
                } else {
                    if ($args['master']['modulepref_type'] == "set") {
                        set_module_pref($pref, $val, $module);
                    }
                }
            }
            break;
        case "iitems-superuser":
            output("`bIItems: Module Prefs`b`n");
            output("Alter module prefs upon use of the item.  Good for modules where items could be used, but which don't support IItems yet.`n");
            output("`bmodulepref`b - the name of the modulepref to alter.`n");
            output("`bmodulepref_module`b - the name of the module to which this pref belongs.`n");
            output("`bmodulepref_type`b - either \"increment\" or \"set\", for incrementing or setting moduleprefs.`n");
            output("`bmodulepref_val`b - the value to set or increment.`n");
            output("Example usage:`nmodulepref = availablestays | modulepref_module = inncoupons | modulepref_type = increment | modulepref_val = 5.  Gives the player five free stays at the Inn when this item is used.`n`n");
            break;
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:30,代码来源:items_creature_drop.php


示例3: hepzibah_runevent

function hepzibah_runevent($type)
{
    global $session;
    $from = "village.php?";
    // Since there is no interaction here, don't even set this
    //$session['user']['specialinc'] = "module:Hepzibah";
    $voucher = get_module_pref("voucher", "marquee");
    $city = $session['user']['location'];
    $op = httpget('op');
    // Since the text in both cases is mostly the same, make it common
    output("`7As you're walking around, admiring the sights, a wizened old woman approaches.`n`n");
    output("Her greying hair stands out in shock, and her nose is hooked and gnarled.");
    output("It takes all your willpower not to run away from this ghastly sight.`n`n");
    output("She smiles the most evil looking smile you have ever encountered.`n`n");
    output("`&\"Hello, warrior!");
    if (!is_module_installed("marquee") || $voucher) {
        output("Enjoying your visit?\"`n`n");
        output("`7Before you can answer, she has wandered off towards another tourist.`n`n");
        output("`7You shudder and head away quickly.`n`n");
    } elseif ($op == "" && !$voucher) {
        output("For you, a gift!\"`n`n");
        output("`7Before you can protest, she has grabbed your wrist, and placed a small voucher into your hand.");
        output("It reads, `Q\"One Free Pizza at the Marquee\".`n`n");
        output("`&\"Enjoy your stay in {$city}, warrior!\" `7she says, before wandering off towards another tourist.`n`n");
        set_module_pref("voucher", 1, "marquee");
    }
    // Since we never set the special inc, we don't need to unset it.
    //if ($op != "") {
    //    $session['user']['specialinc'] = "";
    //}
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:31,代码来源:hepzibah.php


示例4: wcgpoints_supporterpoints_dohook

function wcgpoints_supporterpoints_dohook($hookname, $args)
{
    global $session;
    switch ($hookname) {
        case "wcgpoints_increased":
            if (get_module_pref("gotfirst")) {
                $session['user']['donation'] += 5;
                output("`5`bYou have five extra Supporter Points!`b  Thank you for contributing to humanitarian research.`0`n`n");
            } else {
                if (get_module_pref("runtime", "wcgpoints") > get_module_setting("initialrequirement")) {
                    $session['user']['donation'] += get_module_setting("initialreward");
                    require_once "lib/systemmail.php";
                    $subj = "You've got Supporter Points!";
                    $body = "As a thank-you for helping us to support humanitarian research via grid computing, we've given you 500 Supporter Points completely free of charge.  Thank you so much!  Remember that you'll get five extra Supporter Points every time your World Community Grid points increase (which is usually every 24 hours, if you let the client run regularly).  Have fun!";
                    systemmail($session['user']['acctid'], $subj, $body);
                    set_module_pref("gotfirst", true);
                }
            }
            break;
        case "wcg-features-desc":
            output("`bFree Supporter Points`b: After you've run the World Community Grid client for at least 24 hours (it doesn't have to be all at once - an hour here and an hour there will soon add up), you'll get 500 Supporter Points completely free of charge.  After that, you'll get 5 Supporter Points every time World Community Grid reports that your Cobblestones have increased.`n`n");
            break;
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:25,代码来源:wcgpoints_supporterpoints.php


示例5: faqmute_dohook

function faqmute_dohook($hookname, $args)
{
    global $session;
    $seen = get_module_pref("seenfaq");
    switch ($hookname) {
        case "insertcomment":
            if (!$seen && !$session['user']['dragonkills']) {
                $args['mute'] = 1;
                $mutemsg = "`n`\$You have to read the FAQ before you can post comments. You can find it in any town.`0`n`n";
                $mutemsg = translate_inline($mutemsg);
                $args['mutemsg'] = $mutemsg;
            }
            break;
        case "faq-posttoc":
            if (!$seen) {
                set_module_pref("seenfaq", true);
            }
            break;
        case "bioinfo":
            $id = $args['acctid'];
            $seen = get_module_pref("seenfaq", false, $id);
            if (httpget("op") == "faqmute") {
                set_module_pref("seenfaq", false, false, $id);
                output("`nPlayer's FAQ seen status reset.`n");
            } elseif ($session['user']['superuser'] & SU_EDIT_COMMENTS && $seen && !$args['dragonkills']) {
                addnav("Mute Player Options");
                addnav("FAQmute player", "bio.php?char=" . $id . "&ret=" . rawurlencode(httpget("ret")) . "&op=faqmute");
            }
            break;
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:32,代码来源:faqmute.php


示例6: bioextension_dohook

function bioextension_dohook($hookname, $args)
{
    global $session;
    if ($hookname == "bioinfo") {
        $sql = "SELECT donation FROM " . db_prefix("accounts") . " WHERE acctid = '" . $args['acctid'] . "'";
        $result = db_query($sql);
        $row = db_fetch_assoc($result);
        if ($row['donation'] >= get_module_setting("threshhold")) {
            $bio = get_module_pref("user_extendedbio", "bioextension", $args['acctid']);
            $link = get_module_pref("user_extlink", "bioextension", $args['acctid']);
            $bio = str_replace(chr(13), "`n", $bio);
            $bio = stripslashes($bio);
            output("`0%s`n`n", $bio);
            if (substr($link, 0, 5) == "http:") {
                rawoutput("<a href=\"" . $link . "\">Player's webpage</a><br /><br />");
            }
        }
    } else {
        if ($hookname == "footer-prefs") {
            $bio = get_module_pref("user_extendedbio");
            $limit = get_module_setting("charlimit");
            if (strlen($bio) > $limit) {
                output("`c`4`bWARNING`b`0`c`nYour Extended Bio is oversized by %s characters.  If you navigate away from this page, your Extended Bio will have %s characters indiscriminately cut from the end.  Please edit and re-save your Extended Bio to avoid cuts.", strlen($bio) - $limit, strlen($bio) - $limit);
                $bio = substr($bio, 0, $limit);
                set_module_pref("user_extendedbio", $bio);
            }
        }
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:30,代码来源:bioextension.php


示例7: drunkard_runevent

function drunkard_runevent($type)
{
    global $session;
    require_once "lib/partner.php";
    $partner = get_partner();
    $chance = get_module_setting("spillchance");
    $roll = e_rand(1, 100);
    $seen = get_module_pref("seen");
    set_module_pref("seen", $seen + 1);
    output("`5A very drunk patron stumbles into you as you make your way across the crowded room.`n`n");
    if ($roll < $chance) {
        // He spills on you
        output("`5He is carrying a nearly full glass of ale.");
        output("As he collides with you, it spills all over your nearly clean clothes!");
        output("As you look up, you notice %s`5 watching you and become acutely embarrassed.", $partner);
        output("You notice %s`5 is trying to keep from laughing out loud at your mishap.", $partner);
        output("`n`n`&You `\$lose 1`& charm point.");
        if ($session['user']['charm'] > 0) {
            $session['user']['charm']--;
        }
    } else {
        // You're safe
        output("`5Fortunately his glass was already empty.");
        output("You escort him over to a chair where he can sit without running into everyone else.");
        output("As you stand up, you catch %s's`5 eye and receive a big smile for your kindness.", $partner);
        output("`n`n`&You gain `^1`& charm.");
        $session['user']['charm']++;
    }
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:29,代码来源:drunkard.php


示例8: offering_runevent

function offering_runevent($type)
{
    global $session;
    $session['user']['specialinc'] = "module:offering";
    $seen = get_module_pref("seen");
    $amt = round(max(1, $session['user']['dragonkills'] * 10) * $session['user']['level'] * max(1, 5000 - $session['user']['maxhitpoints']) / 20000);
    $op = httpget('op');
    if ($op == "") {
        output("`7While you are listening to others chatting, a bizarrely-dressed woman approaches with an outstretched hand. `n`n");
        output("\"`&For the offering!!! `^%s `&gold!`7\"", $amt);
        $seen++;
        set_module_pref("seen", $seen);
        addnav(array("Give her %s gold", $amt), "village.php?op=shop");
        addnav("Walk away", "village.php?op=nope");
    } elseif ($op == "nope") {
        output("`7You decide not to give any gold to this strange woman.`n");
        $session['user']['specialinc'] = "";
    } elseif ($session['user']['gold'] < $amt) {
        output("`7The woman stares at your hand.`n`n");
        output("\"`&No no no no no!!! He would not be pleased!!!`7\"`n`n");
        output("`7Without another word, she walks away.`n");
        $session['user']['specialinc'] = "";
    } else {
        output("`7You hand her `^%s`7 gold, and she lifts her head up, looks intently at something above her that only she can see, and whispers, `&\"%s!`&\" `7with apparent urgency.`n`n", $amt, getsetting("deathoverlord", '`$Ramius'));
        output("`7Without another word she scurries off, a determined look on her face, and a purpose in her stride.`n`n");
        if ($session['user']['dragonkills'] > 30) {
            $session['user']['deathpower'] += 10;
        } else {
            $session['user']['deathpower'] += 15;
        }
        $session['user']['gold'] -= $amt;
    }
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:33,代码来源:offering.php


示例9: nicotinegum_use

function nicotinegum_use($args)
{
    $addiction = get_module_pref("addiction", "smoking");
    $betweensmokes = 250 - $addiction;
    set_module_pref("betweensmokes", $betweensmokes, "smoking");
    apply_buff("smoking", array("allowinpvp" => 1, "allowintrain" => 1, "rounds" => -1, "schema" => "module-smoking"));
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:8,代码来源:nicotinegum.php


示例10: donationreminder_run

function donationreminder_run()
{
    global $session;
    page_header("Why hello there!");
    output("`0Hello!  My name's CavemanJoe, I'm the admin here at Improbable Island, and I think it's time you and I had a little chat.`n`nOr, you can just click Continue and carry on your merry way!`n`n...still here?`n`nHello?`n`nHello!`n`nSo.  You've downloaded over three thousand pages on Improbable Island!  That's an awful lot of clicking and keypresses!  I really hope you're having a good time.  You might be wondering why I'm interrupting your game like this, so I'll tell you.  There are a couple of reasons.`n`nFirstly - I'd like to hear from you!  We've got an active forum at http://enquirer.improbableisland.com, in which it'd be nice to hear any ideas or suggestions you might have.  Surely in your thousands of page loads you've found something that could be improved upon?`n`nSecondly, you haven't got any Supporter Points!`n`nYes, this is me saying \"stick a couple of bucks in the hat, will you?\" - yeah, you knew it was coming eventually - but I'm hoping to do it in a way that's at least interesting, and shows you a little bit about how running an online game actually works these days.`n`nImprobable Island is still pretty much a one-man show.  I have some awesome moderators who help me out with the day-to-day running of the game so that I can spend my days coding, but the design and programming of the game beyond its original (Legend of the Green Dragon 1.1.1) codebase is single-handed.  In 2009 I took the plunge, crossed my fingers, and quit my day job to work full-time on Improbable Island.`n`nIt's been pretty good so far.  It's meant taking a pay cut, but I'm happier and I get to do something that affects more people, so that's more than balanced out.`n`nStill, it's a demanding job.  I don't know if you've ever tried to make a game before, but if you have then you'll know how much of a pain in the bum it is trying to balance everything out so it's fair and challenging, never mind the actual programming, writing, artwork creation, layout, graphic design and so forth.  When you're talking about a game with several thousand participants, it gets even harder.`n`nIt's especially hard when you consider that if you want to make any sort of real money in online games, you've got to be a complete asshole.`n`nYou've got to splatter flashing banner ads and popups all over your pages.  You've got to set up cynical gameplay mechanics that are designed for nothing more than to keep people coming back (like growing virtual crops that you absolutely have to harvest between 8 and 10 pm tonight or they're wasted).  You've got to encourage your players to sign up for dodgy offers for free iPods.  You've got to charge money for absolutely everything you can, and you've got to make sure that the people with the most money are the people with the highest rankings in the game.  You've got to hit the psychological buttons discovered over decades of research into gaming and the marketing thereof; you've got to create rare items that people want not because they're useful, but because scarcity goes hand-in-hand with perceived value (`#there are only two `4Stinking Buckets of Dead Eels`# on the whole Island!  I've gotta get one!`0).  You've got to have a subscription option rather than one-time payments, because people forget to cancel their subscriptions.  You've got to spam your players' FaceBook pages with all sorts of meaningless drivel so that social obligation keeps them playing long after the game is no longer fun.  Your marketing has to be a cynical grab at the teenage boy market, enabled by the inclusion of preposterously large breasts in every banner ad.  You have to base your game around a pre-established theme, because coming up with new ideas costs time and money.  You have to create mindless, repetitive gameplay and then charge money for items that allow your players to skip over the boring parts.  You have to make your players compete with each other on parameters that they can influence with money, because some of them will go nuts trying to keep up with the Joneses.  You have to make awful, shallow games with the widest possible appeal to the lowest common denominator and attach enormous marketing and artwork budgets because everybody knows that pretty anime-themed games targeted at 17-25 year old males make shedloads of money, especially when you throw in some of the aforementioned preposterously large breasts.  With very few exceptions, you don't get rich in online games by making good games, or even by trying to be a decent bloke.`n`nYou certainly don't get rich by only advertising on webcomic sites that you personally enjoy.  You don't get rich by putting up enormous walls of text right at the start of your game to scare away people who don't enjoy reading.  You sure as hell don't get rich by only trying to attract and retain curious, intelligent, likeable players!  Of which you are clearly one, or you wouldn't have gotten this far!`n`n(see how I transparently flatter you into giving me money?  Hell, it's worth a shot)`n`nSetting up a distributed computing team and generating over a hundred years' worth of humanitarian research is cool, but it doesn't make you any money.  Giving the better part of six grand to Doctors Without Borders doesn't make you any money either (in fact it costs you money!  Who'd have thought it?).  Fair and balanced gameplay doesn't make you money - all the time you spend balancing your game is time you could be spending mining your players' data and habits for interesting tidbits you can sell to spammers and market researchers.  Games based on a post-EMP valve-and-relay future don't make any money - you should go with steampunk instead, it's very lucrative right now.`n`nIf you've got any sort of conscience, you'll end up whittling your options for making money down to two choices.  The first one is to make an excellent game and then not let anybody play it unless they pay you first.  The second one is to make the game free to play, and then after the player's passed a certain threshold, just go right ahead and ask them outright for some money.`n`nBut you should make it clear to them that nothing bad will happen if they don't donate.  It's important that the player reading the request knows that they're not being coerced into anything, and that the game isn't going to come to a grinding halt if they don't give you any money.  You can point out, if you're feeling manipulative, that their enjoyment has cost you money - which is technically true, but you've got to tell the whole truth.  Three thousand pages' worth of data transfer, database storage space and (most crucially) CPU cycles only works out to pennies since you spent all those nights optimizing the codebase, so it's kinda hard to guilt the player into giving you money that way.`n`nIf you want to ask a player for money, you should point out that just under three per cent of players who sign up make a donation at some point.  They're the ones who counter, in their five-and-ten-dollar donations, all the loose change that the non-donating players end up costing.  The player you're asking money from shouldn't feel that if they don't donate, nobody else will, or that if they don't donate, you'll be upset with them, because you won't - it's only pennies after all.`n`nYou should tell them that you're not rich, but that you're not starving either.  Be honest with them.  It's true that your donating players are your only source of income - but if the player you're talking to doesn't donate, then someone else will.`n`nSo, that's what I'm doing with you right now.  Asking you nicely for money using only the truth, rather than trying to lever it out of you via cheap trickery.  And the truth is that Improbable Island could be making a whole hell of a lot more money than it is right now - but it wouldn't be the same place.`n`nImprobable Island became the game that you enjoy today because its players give me just enough money to justify it as a day job.  If they had given me less money, then I'd need to attract more players, meaning I'd have to be less picky about the sort of people I advertise to.`n`nAnd if you're wondering what's in it for you, you should give me money because:`n1) Every time you or somebody else makes a donation, more Supply Crates are dropped on the World Map.`n2) You'll get 100 Supporter Points for every dollar you donate, with which you can get awesome things in the Hunter's Lodge.`n3) Every donation fills up the Extended Play bar a little bit more, and when it's full, everybody gets more Stamina (click on the coin slot to the bottom right to see where it's up to now).`n4) Every dollar you give to me is a one-fingered salute to the makers of FaceBook Friends Alienator, Annual Generic Football Game 2010 Endorsed by Some Guy, and The Free iPod Game.`n5) If you ever meet me in a pub, you'll have already bought me a pint.`n`nSo!  That's why you should donate some money towards Improbable Island's server costs, advertising budget, and my own costs of living.  And if you don't donate, then I hope this message was at least interesting to read.`n`nI'll return you to the game now.  Don't worry, this is a one-time message and nothing bad will happen if you don't donate.`n`nThanks,`n`n-Admin CavemanJoe`n`n");
    set_module_pref("seenmsg", 1, "donationreminder");
    addnav("Back to the game");
    addnav("Continue", "village.php");
    page_footer();
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:10,代码来源:donationreminder.php


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


示例12: achievements_award_medal

function achievements_award_medal($sname, $vname, $desc, $icon, $acctid = false)
{
    global $session;
    if (!$acctid) {
        $acctid = $session['user']['acctid'];
    }
    $ach = array("name" => $name, "desc" => $desc, "icon" => $icon);
    $info = unserialize(get_module_pref("achievements", "achievements"));
    $info[$sname] = array($ach);
    set_module_pref("achievements", serialize($info), "achievements", $acctid);
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:11,代码来源:achievements.php


示例13: reqmultiplier_change

function reqmultiplier_change($new)
{
    global $session;
    $old = get_module_pref("multiplier", "reqmultiplier");
    if ($new >= $old) {
        set_module_pref("multiplier", $new, "reqmultiplier");
        return true;
    } else {
        return false;
    }
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:11,代码来源:reqmultiplier.php


示例14: monsterrepellentspray_use

function monsterrepellentspray_use($args)
{
    global $session;
    if ($args['context'] == "fight") {
        apply_buff('rspray_fight', array("startmsg" => "`3You pull out a can of Monster Repellent Spray, and spray it liberally on the enemy!`n", "name" => "`^Repellent Spray Attack", "rounds" => 10, "badguyatkmod" => 0.4, "badguydefmod" => 0.4, "roundmsg" => "{badguy} is coughing, choking and all runny-nosed, and cannot attack or defend as effectively!", "wearoff" => "The effects of your Monster Repellent Spray seem to have worn off...`n", "expireafterfight" => 1, "schema" => "iitems-catcher"));
    } else {
        apply_buff('rspray_normal', array("name" => "`^Repellent Spray", "rounds" => -1, "badguyatkmod" => 0.8, "badguydefmod" => 0.8, "roundmsg" => "{badguy} can't stand the smell of your Monster Repellent Spray, and doesn't want to get too close!", "schema" => "iitems-catcher"));
        set_module_pref("encounterchance", 50, "worldmapen");
        output("You liberally douse yourself with an entire can of Monster Repellent Spray.  For the rest of this game day, your chances of encountering a monster on the Island Map have been halved, and monsters you do encounter will be reluctant to attack you as hard.`n`n");
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:12,代码来源:monsterrepellentspray.php


示例15: biochat_dohook

function biochat_dohook($hookname, $args)
{
    global $session;
    switch ($hookname) {
        case "bioend":
            require_once "lib/commentary.php";
            output("`n`n`0%s`0's Natter feed:`n", $args['name']);
            addcommentary();
            $section = "bio-" . $args['acctid'];
            viewcommentary($section, "Natter!", 25);
            if (!strpos(httpget('ret'), "bio.php")) {
                set_module_pref("lastplace", httpget('ret'));
            }
            $sql = "SELECT COUNT(commentid) AS totalcomments FROM " . db_prefix("commentary") . " WHERE section='{$section}'";
            $result = db_query($sql);
            $row = db_fetch_assoc($result);
            $all = $row['totalcomments'];
            set_module_pref("total", $all, "biochat", $args['acctid']);
            if ($args['acctid'] == $session['user']['acctid']) {
                //this is the player looking at his or her own bio
                set_module_pref("seen", $all);
            }
            $return = get_module_pref("lastplace");
            if ($return) {
                $return = substr($return, strrpos($return, "/") + 1);
                addnav("Been clicking around Bios and Nattering for a while?");
                addnav("Go `iright`i back to where you came from", $return);
            }
            debug($return);
            break;
        case "commentaryoptions":
            if (!strpos($_SERVER['REQUEST_URI'], "char=" . $session['user']['acctid'] . "&")) {
                $link = "bio.php?char=" . $session['user']['acctid'] . "&ret=" . URLEncode($_SERVER['REQUEST_URI']);
                $total = get_module_pref("total");
                $seen = get_module_pref("seen");
                output("<a href=\"{$link}\">View my Bio</a> ", true);
                if ($seen != $total) {
                    $new = $total - $seen;
                    if ($new == 1) {
                        output("(1 unread Natter) ");
                    } else {
                        output("(%s unread Natters) ", $new);
                    }
                }
                addnav("", $link);
            }
            break;
    }
    return $args;
}
开发者ID:Beeps,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:50,代码来源:biochat.php


示例16: klutz_runevent

function klutz_runevent($type)
{
    global $session;
    output("`7While you're minding your own business, a lady plows headlong into you.`n`n");
    output("`&\"Oh! Oh, I'm terribly sorry! I mustn't have been watching where I was going...\"`n`n");
    output("`7She scrambles on the ground, trying to collect all the things she has dropped.");
    output("You help her gather her belongings.`n`n");
    output("`^She is most grateful for your help!`n`n");
    if (get_module_pref("gotgem") == 0 && e_rand(1, 4) == 1) {
        output("`7As a thank you, she hands you a `5gem`7!");
        $session['user']['gems']++;
        set_module_pref("gotgem", 1);
    }
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:14,代码来源:klutz.php


示例17: hunterslodge_customrace_run

function hunterslodge_customrace_run()
{
    require_once "lib/sanitize.php";
    require_once "lib/names.php";
    global $session;
    $op = httpget("op");
    $free = httpget("free");
    page_header("Choose your Custom Race");
    switch ($op) {
        case "change":
            output("Want to change your Custom Race?  No problem.  Enter your desired race in the box below.  You've got 25 characters to play around with.`n(leave this blank to disable custom race naming and return to default, game-supplied race names)`n`n");
            rawoutput("<form action='runmodule.php?module=hunterslodge_customrace&op=confirm&free=" . $free . "' method='POST'>");
            $race = get_module_pref("customrace");
            rawoutput("<input id='input' name='newrace' width='25' maxlength='25' value='" . htmlentities($race, ENT_COMPAT, getsetting("charset", "ISO-8859-1")) . "'>");
            rawoutput("<input type='submit' class='button' value='Preview'>");
            rawoutput("</form>");
            addnav("", "runmodule.php?module=hunterslodge_customrace&op=confirm&free=" . $free);
            addnav("Cancel");
            addnav("Don't set a custom race, just go back to the Lodge", "runmodule.php?module=iitems_hunterslodge&op=start");
            break;
        case "confirm":
            $newrace = httppost("newrace");
            $sub = httpget("sub");
            $newrace = str_replace("`", "", $newrace);
            $newrace = comment_sanitize($newrace);
            $newrace = substr($newrace, 0, 25);
            if ($newrace) {
                output("Your new custom race is:`n%s`nWould you like to set your new Race now?`n`n", $newrace);
            } else {
                output("You've chosen to go back to the default, game-supplied races.  Are you sure that's what you want?`n`n");
            }
            addnav("Confirm");
            addnav("Set custom race", "runmodule.php?module=hunterslodge_customrace&op=set&free={$free}&newrace=" . rawurlencode($newrace));
            addnav("Cancel");
            addnav("Don't set a custom race, just go back to the Lodge", "runmodule.php?module=iitems_hunterslodge&op=start");
            break;
        case "set":
            $newrace = rawurldecode(httpget("newrace"));
            output("Your custom race has been set to %s!`n`n", $newrace);
            set_module_pref("customrace", $newrace);
            if (!$free) {
                $id = has_item("hunterslodge_customrace");
                delete_item($id);
            }
            addnav("Return");
            addnav("Return to the Lodge", "runmodule.php?module=iitems_hunterslodge&op=start");
            break;
    }
    page_footer();
}
开发者ID:Beeps,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:50,代码来源:hunterslodge_customrace.php


示例18: defaultpreferences_dohook

function defaultpreferences_dohook($hookname, $args)
{
    global $session;
    switch ($hookname) {
        case "newday":
            if (get_module_pref("hasbeenset") == 0) {
                $session['user']['prefs']['timestamp'] = 2;
                $session['user']['prefs']['emailonmail'] = 1;
                $session['user']['prefs']['systemmail'] = 1;
                set_module_pref("hasbeenset", 1);
            }
            break;
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:15,代码来源:defaultpreferences.php


示例19: iitems_dohook

function iitems_dohook($hookname, $args)
{
    global $session;
    switch ($hookname) {
        case "superuser":
            if (get_module_pref("superuser") == 1) {
                addnav("Item Editor", "runmodule.php?module=iitems&op=superuser&superop=start");
            }
            break;
        case "village":
        case "forest":
        case "worldnav":
            addnav("Inventory");
            addnav("Show Inventory", "runmodule.php?module=iitems&op=inventory&from=" . $hookname);
            break;
        case "fightnav-specialties":
            $script = $args['script'];
            iitems_show_fight_items($script);
            break;
        case "apply-specialties":
            if (httpget('skill') == "iitems") {
                $item = httpget('item');
                iitems_use_item($item, false, "fight");
            }
            break;
        case "dragonkill":
            $oldinventory = iitems_get_player_inventory();
            $newinventory = array();
            foreach ($oldinventory as $key => $vals) {
                $details = iitems_get_item_details($vals['itemid']);
                if ($details['dkpersist']) {
                    $newinventory[$key] = $vals;
                }
            }
            set_module_pref("items", serialize($newinventory), "iitems");
            break;
        case "newday":
            $use = iitems_has_property("useatnewday", 1, true, false, false, "all");
            debug($use);
            if (count($use) && is_array($use)) {
                foreach ($use as $item => $details) {
                    iitems_use_item($details['itemid'], false, $details['inventorylocation']);
                }
            }
            break;
    }
    return $args;
}
开发者ID:CavemanJoe,项目名称:Improbable-Island---DragonScales---DragonBones---LotGD-2.0---Season-Three,代码行数:48,代码来源:iitems.php


示例20: medals_award_medal

该文章已有0人参与评论

请发表评论

全部评论

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