Ejemplo n.º 1
0
 public static function getAllHelp($player = NULL)
 {
     $sell_rate = $player === NULL ? 10 : Shadowfunc::calcSellPrice(100 / 10, $player);
     $buy_rate = $player === NULL ? 100 : Shadowfunc::calcBuyPrice(100, $player);
     # XP karma
     $xp = $player === NULL ? 0 : round($player->getBase('xp'), 2);
     $xppk = $player === NULL ? SR_Player::XP_PER_KARMA : $player->getXPPerKarma();
     # XP level
     $xpl = $player === NULL ? 0 : round($player->getBase('xp_level'), 2);
     $xppl = $player === NULL ? SR_Player::XP_PER_LEVEL : $player->getXPPerLevel();
     # XP total
     $xpt = $player === NULL ? 0 : round($player->getBase('xp_total'), 2);
     $ele = $player === NULL ? 0 : $player->get('elephants');
     $ele_gain = $player === NULL ? 0 : $player->getHPGain();
     $ele_time = GWF_Time::humanDuration(SR_Player::HP_REFRESH_TIMER);
     $orca = $player === NULL ? 0 : $player->get('orcas');
     $orca_gain = $player === NULL ? 0 : $player->getMPGain();
     $orca_time = GWF_Time::humanDuration(SR_Player::MP_REFRESH_TIMER);
     $crit = $player === NULL ? 0 : sprintf('%.01f', $player->getCritPermille() / 10);
     # permille -> percent
     $bad_karma = $player === NULL ? '' : sprintf(' Your current character has %.02f bad_karma.', $player->getBase('bad_karma') + SR_PlayerVar::getVal($player, '__SLBADKARMA', 0.0));
     $hjbk = SR_Mount::HIJACK_BAD_KARMA;
     $all_ny = GDO::table('SR_Player')->selectVar('SUM(sr4pl_nuyen+sr4pl_bank_nuyen)');
     $all_ny += GDO::table('SR_Clan')->selectVar('SUM(sr4cl_money)');
     $all_ny = Shadowfunc::displayNuyen($all_ny);
     $latency_seconds = sprintf('%.01f', SR_Player::ATTACK_TIME_SECONDS);
     $eqs = implode('|', array_keys(SR_Player::$EQUIPMENT));
     $back = array('root' => "Check out these topics", array('beginners' => 'First steps', array('get_started' => 'First you should #talk to the hotelier. Then you should #equip clothes. Then you should #party up with players and #join their parties. Then you should #explore the first city.', 'what_is_it' => "Shadowlamb is a full featured mmorpg. You can #(j)oin parties, solve #(qu)ests, runecraft your items and learn magic spells. It combines multiple irc networks into a single gameworld, and thus is unique among all irc games.", 'where_am_i' => 'You begin in the Redmond Hotel. Check your party status with #(p)arty. Check your #known_places with #(kp). Find new places with #(exp)lore. Do not forget to check your #e(q)uipment and cleanup your #(i)nventory.', 'first_talk' => 'You should #talk to the hotelier first. Use #talk <word|kw_id> to ask for something in particular. You will get your first_equipment.', 'first_equipment' => 'The hotelier will give you some items. Check your #inventory and #equip them, so you are ready to #explore.'), 'attributes' => "Player Command. Usage: #(a)ttributes. Attributes", array('body' => "The body attribute raises your max_hp by " . SR_Player::HP_PER_BODY . '.', 'magic' => "The magic attribute raises your max_mp by " . SR_Player::MP_PER_MAGIC . '. It also increases your MP refresh rate slightly.', 'strength' => "The strength attribute raises attack for melee weapons. It also raises the max weight you can carry.", 'quickness' => "Quickness raises your defense by increasing your chance to evade attacks. Also your busytime and explore times will decrease.", 'wisdom' => "Wisdom increases duration of magic spells and increases your chance for successfull spell casting.", 'intelligence' => "Intelligence increases the power of your magic spells. It also increases your magic defense.", 'charisma' => "Charisma raises the time that hirelings follow you. It also betters the sell(+" . Shadowfunc::SELL_PERCENT_CHARISMA . "%) and buy(-" . Shadowfunc::BUY_PERCENT_CHARISMA . "%) prices for your character. You currently sell to {$sell_rate}% and buy to {$buy_rate}%.", 'luck' => "Luck increases the chance of better drops.", 'reputation' => "Reputation determines how famous you are amongst the world of Shadowlamb. Some quests require a minimum reputation.", 'essence' => "Essence describes how wasted your body and mind is. Every player starts with an essence of 6. You cannot lvlup your essence. Although it is known that some rare runes can increase your essence. Essence is essential for magic, similar to intelligence."), 'skills' => 'Player Command. Usage: #(sk)ills. Show your learned Skills', array('melee' => 'The melee skill will increase your attack for melee weapons.', 'ninja' => 'The ninja skill will increase your damage and attack for ninja weapons. The ninja weapons extend melee weapons, so they get a big additional bonus.', 'swordsman' => 'The swordsman skill will increase your damage and attack for swords. The swords extend the melee weapons, so they get an additional bonus.', 'viking' => 'The viking skill will increase your damage and attack for axes. The axes extend the melee weapons, and get an additional bonus.', 'firearms' => 'The firearms skill will increase your damage and attack for fireweapons.', 'bows' => 'The bows skill will increase your damage and attack for bows.', 'pistols' => 'The pistols skill will increase your damage and attack for pistols.', 'shotguns' => 'The shotguns skill will increase your damage and attack for shotguns.', 'smgs' => 'The smgs skill will increase your damage and attack for small machine guns.', 'hmgs' => 'The hmgs skill will increase your damage and attack for heavy machine guns.', 'computers' => 'The computers skill will increase your chance to hack computers.', 'electronics' => 'The electronics skill will increase your chance to disable traps. It also increases the chance of a successful #hijack.', 'biotech' => 'The biotech skill will increase your healing when using items.', 'negotiation' => "The negotiation skill will lower prices when buying items(-" . Shadowfunc::BUY_PERCENT_NEGOTIATION . "%), and raise prices when selling items(+" . Shadowfunc::SELL_PERCENT_NEGOTIATION . "%). This is also effected by charisma. You currently sell to {$sell_rate}% and buy to {$buy_rate}%.", 'sharpshooter' => 'The sharpshooter skill will raise your chance for a critical hit. This also applies to melee and ninja weapons.', 'searching' => 'The searching skill will increase the dropchance on searches.', 'lockpicking' => 'The lockpicking skill will increase your chance on picking locks. It also increases the chance of a successful #hijack.', 'thief' => 'The thief skill will increase your chance on thieving items of shops and not getting caught. It also increases the chance of a successful #hijack.', 'alchemy' => 'The alchemy skill improves the power of your AlchemicPotions. An AlchemicPotion is a spell in a bottle. Alchemic_Potion_of_spell. The other attributes equal the stats that are used when casting the spell from the bottle.'), 'knowledge' => 'Your character can gather special knowledge during the game (unused)', array('math' => 'Math knowledge will be helpful in some quests.', 'crypto' => 'Advanced knowledge of cryptography will be helpful in some quests. All cryptograms can be solved by the players itself. A highlevel crypto character does not need to solve these by hand.', 'stegano' => 'Advanced knowledge of steganography makes you see things that are not there. Most useful when wearing a TinfoilCap.', 'indian_culture' => 'It will be useful to know about the amerindian culture in the 5th area.', 'indian_language' => 'It will be useful to know about the amerindian language in the 5th area.'), 'combat' => 'Combat topics', array('combat1' => "In combat you have a one-item-stack. When your busytime is over your last command gets executed. The default command is #attack <random>.", 'combat2' => "Spells and weapons have a combat distance. Before you can attack an enemy, it has to be in range. Therefor, the #attack command will lock the target you have chosen.", 'combat3' => "If you do nothing in combat, your default action is #attack rand(), locking a random target.", 'combat4' => "Do not forget to cleanup your inventory. An overloaded character might get a malus on their combat stats.", 'busytime' => "When a fight starts, you have an initial busytime. When this time is over your last command gets executed, and you get busy again, depending on your action.", 'range' => 'In combat you have a range and position. Party A has positive position and Party B has negative postition. You need to be in range for weapons and spells.', 'range2' => 'Spells and weapons have a minimum range. A range of 2m has no malus in combat / is considered 0.', 'distance' => "Imagine the combat as a line. +10 +8 +6 +4 +2 +0 -2 -4 -6 -8 -10. One party starts in the positive, the other in the negative. You can set your default distance with #sd.", 'death' => "When you die you might loose a random item. Also you will loose XP and nuyen you might have in your pocket. You will respawn in your nearest respawn location which is mostly a Hotel.", 'combat_lock' => 'In combat some commands lock your current target. The default command is attack random, which will also lock this target.'), 'your_status' => 'Your character status', array('gender' => 'Your gender', array('male' => 'Males have a slight strength and body bonus.', 'female' => 'Females have a slight intelligence and charisma bonus.'), 'race' => 'There two major types of races', array('player_races' => 'Available player_races', array('fairy' => 'The fairy is small, weak and very hard to play. It is meant to be a party character.' . self::helpRace('fairy'), 'elve' => 'The elve is weak and difficult to play. He enjoys the arcane powers. As every elve he has a bonus on the bows skill.' . self::helpRace('elve'), 'halfelve' => 'The halfelve are often merchants or teachers that stopped to learn magic.' . self::helpRace('halfelve'), 'vampire' => 'Vampires are undead creatures. They have a low body and HP and trust in equipment they have collected over their years.' . self::helpRace('vampire'), 'darkelve' => 'The darkelve combines melee, bows and magic into a playable character.' . self::helpRace('darkelve'), 'woodelve' => 'The woodelve combines melee, bows and magic into a playable character.' . self::helpRace('woodelve'), 'human' => 'The human is the intermediate character of the player_races.' . self::helpRace('human'), 'gnome' => 'The gnome is a bit smaller than a halfork.' . self::helpRace('gnome'), 'dwarf' => 'The dwarf is a bit smaller than a gnome.' . self::helpRace('dwarf'), 'halfork' => 'The halfork is a bit dumb, but easy to play for beginners.' . self::helpRace('halfork'), 'halftroll' => 'The halftroll is a bit dumb, but very easy to play for beginners.' . self::helpRace('halftroll'), 'ork' => 'The ork is dumb and easy to play for beginners.' . self::helpRace('ork'), 'troll' => 'The population of trolls has increased by 140% in the last year.' . self::helpRace('troll'), 'gremlin' => 'The gremlin is not meant to be played because it cannot swim.' . self::helpRace('gremlin')), 'npc_races' => 'NPC only races', array('droid' => 'An electronical device that makes your life harder.', 'dragon' => 'A mysterious creature from the very same planet.')), 'asl' => 'Player command. Usage: #asl [<age|bmi|height>]. Use #aslset to setup your asl. Show your', array('age' => 'Your character\'s age, in years.', 'body_mass' => 'Your characters body_mass in gramm.', 'height' => 'Your character\'s height in centimeters.'), 'level' => 'Player command. Show the party- and memberlevels. Your level determines what mobs you can encounter. Collect ' . $xppl . ' XP to levelup.', 'hp' => "HP are your hitpoints. Use #hp to see all party HP. You can refresh hitpoints in Hotel, or by healing items and spells.", 'max_hp' => 'The maximum amount of HP your character can have. You can increase this with the body attribute or rune modifiers.', 'mp' => "MP are your manapoints. Use #mp to see all party MP. To cast magic #spells you need MP. You can refresh manapoints in Hotel, or by using certain potions or items.", 'max_mp' => 'The maximum amount of MP your character can have. You can increase this with the magic attribute or rune modifiers.', 'atk' => 'Your amount of chances to hit. The more hits you generate the more damage you cause. Your atk should be around twice your maxdmg, or even higher.', 'att' => 'This modifier lowers the attack time of weapons.', 'defense' => 'You chance to evade attacks. Reduces hits. You can increase defense with quickness', 'damage' => 'The min and max damage you can cause.', 'arm' => "Armor reduces damage. There are two types of armor", array('marm' => 'Your melee armor. Reduces melee damage.', 'farm' => 'Your fireweapon armor. Reduces firearms damage.'), 'xp' => NULL, 'karma' => NULL, 'weight' => NULL, 'max_weight' => 'The max_weight you can carry. If you exceed your max_weight you get a malus on your attack and defense or cannot move at all.', 'nuyen' => NULL, 'bad_karma' => "Bad karma determines how evil your character is. If you have bad karma you might encounter Polizia, also known as BlackOps. These will annoy the bad guys during their journey.{$bad_karma}", 'special_stats' => 'There are some special stats too:', array('casting' => 'Similar to the magic attribute, this skill increases your MP, but does not increase your MP refreshing.', 'spellatk' => 'Increases your magic attack. This is also affected by essence and intelligence.', 'spelldef' => 'Increases your magic defense. This is also affected by essence and intelligence.', 'orcas' => "Increases your MP refreshening. This is also affected by the magic attribute. Your current orcas level is {$orca} and you gain {$orca_gain} every {$orca_time}.", 'elephants' => "Increases your HP refreshening. Your current elephants level is {$ele} and you gain {$ele_gain} every {$ele_time}.", 'critical' => "Your current chance of a critical hit is {$crit}%.", 'attack_time' => "A special rune that only affects weapons. It reduces your busytime for attacks by {$latency_seconds}.")), 'effects' => 'Known effects', array('alc' => 'The alcohol effect determines how drunk a character is. If a character is too drunk, it might do random actions in combat.', 'caf' => 'The caffeine effect determines how caffinated a character is. If a character is too caffinated it cannot sleep.'), 'all_spells' => 'There are ' . SR_Spell::getTotalSpellCount() . ' spells', self::getSpellTree($player), 'all_cmds' => 'There are a lot of commands', array('leader_cmds' => 'Some special leader commands', array('leader' => 'Leader command. Usage: #(le)ader <member_name|member_enum>. Set a new party leader for your party.', 'party_loot' => "Leader command. Usage: #pl <killer|cycle|rand>. Define who loots the items from kills. The default is killer.", 'party_order' => 'Leader command. Usage #party_order <member1> <member2>. Swap the order of two party members.', 'fight' => 'Leader Command. Usage: #(fi)ght [<player>]. When you meet talking parties on the street you can #fight them. This command also works inside PVP locations.', 'bye' => 'Leader Command. Usage: #bye. Say goodbye to a talking party. If you meet humans, both have to say bye so the "evil" players get a chance to kill you.', 'kick' => 'Leader command. Usage: #kick <player>. Kick a player from you party. See #ban.', 'ban' => 'Leader command. Usage: #ban [<player>]. Ban all or one player from your party. If no argument is given you ban all players.', 'unban' => 'Leader command. Usage: #unban [<player>]. Unban all or one player from your party. If no argument is given your party will be open to all players again.'), 'guest_cmds' => 'These commands always work', array('start' => 'Player command. The first command you have to type in Shadowlamb. Usage: #start <race> <gender>. Each race has a different bonus. The human is medium. Left from it has more magic. Right from it has more melee.', 'help' => 'Browse the Shadowhelp file. Usage: #help [<keyword>].', 'stats' => 'Print current gameworld stats.', 'motd' => 'Print the current "message of the day".', 'world' => 'Print info about the world of Shadowlamb.', 'players' => 'Usage: #players <page>. Print info about the current players. Paginated.', 'parties' => 'Usage: #parties <page>. Print info about the current active parties, paginated.'), 'gm_cmds' => '"Game Master" commands for debugging and cheating', array('gm' => 'GM command. Usage: #gm <username> <field> [<value>].', 'gmc' => 'GM command. Usage: #gmc. Cleanup the database. Handle with care!', 'gmd' => 'GM command. Usage: #gmd <player> <remote command to execute>.', 'gmi' => 'GM command. Usage: #gmi <username> <item_name>. Example: gmi gizmore LeatherVest_of_strength:1,quickness:4,marm:4,foo:4', 'gml' => "GM command. Usage: #gml <username> <city_location> [inside|outside]. Teleport a party to a location. By default parties end up outside of the location.", 'gmm' => "GM command. Usage: #gmm <the message>. Send a hyperglobal message to all Shadowlamb channels.", 'gmn' => "GM command. Usage: #gmn <the message>. Send a hyperglobal message to all Shadowlamb players.", 'gmq' => "GM command. Usage: #gmq <username> <quest> [amount|data] [<value>]. Get or set quest information.", 'gms' => "GM command. Usage: #gms <player>. Print a lot of status of a player.", 'gmsp' => "GM command. Usage: #gmsp <player> <spell> <level>. Adjust the spell for a player.", 'gmt' => "GM command. Usage: #gmt <username> <enemy,enemy,...>. Attack a party with enemies for debugging purposes."), 'status_cmds' => 'Commands for player information', array('commands' => "Player command. Usage: #(c)ommands. List your currently available commands. These are ordered by always,leader,special,location and change depending on your current location and party action. The currently special location commands are listed to the most right in bold.", 'ccommands' => "Player command. Usage: #(cc)ommands. List many hidden default commands. These always work and you maybe don't even use them.", 'status' => 'Player command. Usage: #(s)tatus. View your status.', 'attributes' => NULL, 'skills' => NULL, 'asl' => NULL, 'aslset' => "Player command. Usage: #aslset RANDOM || #aslset <age>y <bmi>kg <hgt>cm. Example: #aslset 20y 140cm 80kg.", 'equipment' => 'Player command. Usage: #e(q)uipment. View your equipment.', 'sets' => 'Player command: Usage: #sets [<setpage|item_name|setname>]. Show all sets or list items and boni for an itemset.', array('amulet' => 'You can #equip amulets and wear them as #equipment.', 'armor' => 'You can #equip armory and wear them as #equipment.', 'boots' => 'You can #equip boots and wear them as #equipment.', 'earring' => 'You can #equip earrings and wear them as #equipment.', 'helmet' => 'You can #equip helmets and wear them as #equipment.', 'legs' => 'You can #equip legs and wear them as #equipment.', 'ring' => 'You can #equip rings and wear them as #equipment.', 'shield' => 'You can #equip shields and wear them as #equipment.', 'weapon' => 'You can #equip weapons and wear them as #equipment.', 'mount' => 'You can #equip mounts to lower your travel times. Also you can store items in them. There are also mount runes:', array('lock' => 'LOCK determines the safety of your mount and prevents a #hijack. LOCK runes can only get applied on a mount.', 'tuneup' => 'Tuneup runes can only be applied to a mount and reduce travel times.', 'transport' => 'Transport runes can only be applied to a mount and increase the max weight it can store.')), 'party' => 'Player command. Usage. #(p)arty. View your party status.', 'inventory' => 'Player command. Usage: #(i)nventory [<page|search>] <[page]>. View or search your inventory. See', array('compare' => 'Player command. Usage: #(c)o(mp)are <item_name|inv_id|S_<view_id>|item_name> [<item2:inv_id|S_<view_id>|item_name>]. Will compare item1 with currently equiped item, or item2 if specified', 'swap' => 'Player command. Usage: #(sw)ap <item1> <item2>. Will swap inventory item position', 'sort' => 'Use the swap command to sort your inventory.'), 'cyberware' => 'Player command. Usage: #(cy)berware [<cy_id>]. View your cyberware.', 'effects' => 'Player command. Usage: #(ef)fects. View your current effects. For example after beeing the target of a spell or drinking a potion.', 'examine' => 'Player command. Usage: #(ex)amine <inv_id|' . $eqs . '|item_name>. Examine your items.', 'show' => 'Player command. Usage: #show [<player>] <inv_id|' . $eqs . '|item_name>. Show another player the examine string of your items, or behave like #examine.', 'known_knowledge' => "Player command. Usage: #known_knowledge|#kk. List your known knowledge. Knowledge can help you on some quests but it is not required.", 'known_places' => "Player command. Usage: #known_places|#kp <[city]>. List your known places in your current or specified city. You can go to them with #(g)oto. Use #(exp)lore to find new places.", 'swapkp' => 'Player command. Usage: #swapkp <kp1> <kp2>. Swap the position of two known places in the current city.', 'known_words' => "Player command. Usage: #known_words|#kw. List some useful words you have learned, which you can enumerate with #talk and #say.", 'known_spells' => 'Player command. Usage: #known_spells|#ks <[ks_id|spell_name]>. List your known magic spells or examine a spell.', 'quests' => 'Player command. Usage: #(qu)ests [<open|done|deny|fail|abort|missing|stats|cstats|searchterm|qu_id>] [<page|city>]. Shows info about your quests. To get quests you need to talk to the npc. Most often, the trigger is #talk shadowrun and #talk yes to get them.', 'nuyen' => "Player command. Usage: #(n)u(y)en/#ny. Show the parties nuyen. Nuyen is the currency(money) in Shadowlamb. It means \"New Yen\". The nuyen is considered strong as there are only {$all_ny} in the whole world.", 'karma' => 'Player command. Usage: #(ka)rma. Show the parties karma. With karma you can #lvlup your skills, attributes and spells.', 'hp' => NULL, 'mp' => NULL, 'xp' => "Player command: Usage: #xp. Show party XP stats. In total you have collected {$xpt} XP", 'weight' => "Player command. Usage: #(we)ight. Show how much stuff the party is carrying. You can increase your max_weight with strength. If you carry more than your max weight, you get a malus on attack and defense.", 'lvlup' => "Player command. Usage: #lvlup [<skill|attribute|spell|knowledge>]. Increase your level for an attribute,skill,spell or knowledge by using karma. With no arguments show the list of things you can level up, the level they will go to, and how much karma is needed. Bolded karma values are ones you can 'afford'. ", 'level' => NULL, 'party_level' => 'A higher party level increases the drop chance for items.'), 'chat_cmds' => 'Commands for chat and talk', array('clan_message' => 'Player command. Usage: #(c)lan_(m)essage <your message ...>. Send a message to all your clan members. See: #help chat_cmds.', 'party_message' => 'Player command. Usage: #(p)arty_(m)essage <your message ...>. Send a message to all party members. Useful for cross-server/cross-channel messages. See: #help chat_cmds.', 'say' => "Player command. Usage: #say <#kw_id|the message>. If you meet other parties on street you can use #say to talk to them. Inside and outside locations this sends messages across the servers. In fight this sends messages to enemy party. See: #help chat_cmds.", 'talk' => "Player command. Usage: #talk <#kw_id|word>. In many locations you can use #talk to talk to the NPCs. If there is more than one NPC it is often #ttX. Always check your #c inside locations. Bold words during a talk indicate a further topic to talk about. See: #help chat_cmds.", 'shout' => "Player command. Usage: #shout <the message>. Shout a message to all shadowlamb channels on all servers. See: #help chat_cmds.", 'whisper' => "Player command. Usage: #(w)hisper <player> <the message>. Send a message to another player. This works across networks. See: #help chat_cmds.", 'whisper_back' => "Player command. Usage: #(w)hisper_(b)ack <the message>. Send a message back to the player who whispered you. See: #help chat_cmds."), 'combat_cmds' => 'Commands work in combat', array('idle' => "Combat command. Usage: #idle. Do nothing.", 'forward' => "Combat command. Usage: #forward|#fw. Move forward in distance.", 'backward' => "Combat command. Usage: #backward|#bw. Move backwards in distance.", 'flee' => "Combat command. Usage: #(fl)ee. Try to flee from the enemy. If successful you will #part the current #(p)arty. You will also loose some XP.", 'attack' => "Combat command. Usage: #attack|## [<enemy_name|enemy_enum>]. Select your target to attack with your weapon. Attack will lock your target, so you don't need to type attack all the time. See #help busytime and #help combat. See atk to see what the atk stat does.", 'set_distance' => 'Player command. Usage: #(s)et_(d)istance/#sd <meters>. Set your default combat distance. The max distance is ' . SR_Player::MAX_SD . '.'), 'action_cmds' => 'Action commands', array('npc' => 'Leader command. Usage: #npc <thenpc> <the remote command>. Execute a command in the name of your NPC. Example: #npc 2 status.', 'say' => NULL, 'use' => 'Player command. Usage: #(u)se <inv_id|item_name> [<target_name|target_enum>]. Use an item. In combat this costs time.', 'brew' => 'Player command. Usage: #(br)ew <spell> [<level>]. Try to brew a magic potion. Needs a WaterBottle and Mandrake(s).', 'cast' => 'Player command. Usage: #(ca)st [<ks_id|spell_name>][:level] [<target_name|target_enum>]. Cast a spell. If spell is friendly the enum is member_enum. If spell is offensive the enum is enemy enum. See #ks|#known_spells for your spells.', 'drop' => 'Player command. Usage: #(dr)op <inv_id|item_name> [<amount>]. Drop one or multiple items. Used to save weight.', 'equip' => 'Player command. Usage: #(eq)uip <item_name|inv_id>. Equip yourself with an item. Will cost time in combat.', 'unequip' => 'Player command. Usage: #uneqip|#uq <' . $eqs . '>. Unequip a wearing item. Will cost time in combat.', 'reload' => "Player command. Usage: #(r)eload. Reload your weapon. This is only needed for fireweapons and costs time in combat.", 'hijack' => "Leader command. Usage: #hijack [<target>]. Try to break into a player mount and steal an item. This will always add {$hjbk} bad karma to your character for trying such bad things.", 'give' => 'Player command. Usage: #give <player_name> <inv_id|item> [<amount>]. Give a player in the same location some items. In combat this costs time. See also #givekp, #givekw and #giveny.', 'givekp' => 'Player command. Usage: #givekp [<player_name>] <#(kp)_id|location>. Tell a player in your location about a known place. See #give, #givekw and #giveny. If no player is specified, it will tell all your party members about it.', 'givekw' => 'Player command. Usage: #givekw [<player_name>] <#(kw)_id|word>. Tell a player in your location about a known word. See #give, #givekp and #giveny. If no player is specified, it will tell all your party members about it.', 'giveny' => 'Player command. Usage: #giveny <player_name> <nuyen>. Give a player in your location some nuyen. See #give, #givekp and #givekw.'), 'option_cmds' => 'Commands that change your player and client options', array('redmond_reset' => 'Player command. Usage: #redmond. If idle you can teleport to Redmond_Hotel. This will cost some XP from the karmapool and part your current party.', 'reset' => 'Player command. Usage: #reset. #reset. Use reset to delete your player and start over. Handle with care!', 'enable' => 'Player command. Usage: #enable <help|notice|privmsg|lock|bot|norl|norefresh|noautolook>. Toggle player and interface options for your player.', 'disable' => 'Player command. Usage: #disable <help|notice|privmsg|lock|bot>. Toggle user interface options for your player.', 'running_mode' => "Player command. Usage: #(r)unning_(m)ode. Use it twice to convert your character into a real runner. This means raised max stats, but permanent death. The permdeath rule applies only when killed by NPC or other Runners / RM Players."), 'move_cmds' => 'Commands that change the party location or action', array('explore' => 'Leader command. Usage: #(exp)lore. Start to explore the current city. When the explore time is over, you find a new #kp. When you have found a new known_place, you are outside of it. Use #(en)ter to enter it.', 'goto' => "Leader command. Usage: #(g)oto <kp_id|location>. Goto another place in your current city.", 'hunt' => "Leader command. Usage: #hunt <player>. Hunt another human party. When your ETA is over, you will be in the same location, or meet the party on streets.", 'enter' => 'Leader command. Usage: #(en)ter. Enter a location. Check your current location with #kp. Find new locations with #(exp)lore.', 'exit' => 'Leader command. Usage: #exit. Exit a location and return outside of it in the same city. To leave a dungeon, use #leave in the dungeons exit.', 'sleep' => "Leader command. Usage: #sleep. In Hotels and some other locations, you can sleep to rest and restore your HP and MP.", 'stop' => "Leader command. Usage: #stop. The leader can interrupt a moving party with the stop command. Your #(exp)lore and #(g)oto timers will reset."), 'party_cmds' => 'Party commands', array('request_leader' => 'Player command. Usage: #(r)equest_(l)eader. Request leadership in case the current leader is away.', 'join' => 'Player command. Usage: #(j)oin <player>. Join the party of another player who is at the same location as you. You can #look to see which players are around you.', 'part' => 'Player command. Usage: #(pa)rt. Leave your current party and create a fresh one.', 'info' => "Player command. Usage: #info. Show the info text of your current location.", 'clan' => 'Player command. Usage: #clan [<player|historypage|!(m)embers>] [<memberpage>]. Show clan info for a player or browse the clan history or member pages.'), 'mount_cmds' => 'Mount commands', array('mount' => 'Player command. Usage #(mo)unt [<push|pop|clean>] [<item>]. Show your mount or push and pop items from it. Items in your mount can be stolen via #hijack from other players.', 'mounts' => 'Player command. Usage #(mo)unt(s). Show all the mounts in your party.'), 'location_cmds' => 'All location commands', array('look' => "Location command. Usage: #(lo)ok. Look around to spot other players in your current location. You can see players from other servers too.", 'shop_cmds' => 'Store commands', array('buy' => 'Location command. Usage: #(bu)y <view_id|item_name> [<amount>]. In shops you can buy items with this command. The price depends on your negotiation.', 'sell' => 'Location command. Usage: #(se)ll <inv_id|item_name> [<amount>]. In shops you can sell your items with this command. The price depends on your negotiation.', 'secondhand_sell' => 'Location command. Usage: #(se)ll <inv_id|item_name>. In second hand stores you can only sell equipment, but modified items get slightly better prices here.', 'steal' => 'Location command. Usage: #(st)eal [<view_id>]. In some shops you can steal items with this command. Beware, you can get caught and get bad_karma.', 'view' => 'Location command. Usage: #(v)iew [<pattern>] [<page>]. In shops and alike you can use view to list or search items stored there.', 'viewi' => 'Location command: Usage: #(v)iew(i) <view_id>. In shop and alike you can use viewi to examine items stored there.'), 'alchemist_cmds' => 'Alchemist commands', array('recipes' => 'Location command. Usage: #recipes [<recipe>]. Show all the recipes here that you can create with #recipe, or show the details of a single recipe.', 'recipe' => 'Location command. Usage: #recipe <recipe>. Create a recipe from it\'s incredients.'), 'bank_cmds' => 'Bank commands', array('push' => NULL, 'pushy' => "Location command. Usage: #pushy <amount>. In banks you can store items and nuyen to keep them safe for later usage.", 'pop' => NULL, 'popy' => "Location command. Usage: #popy <amount>. In banks you can store items and nuyen to keep them safe for later usage.", 'bank_search' => 'Location command. Usage: #search <term> [<page>]. Search your bank for items.'), 'bazar_cmds' => 'Bazar commands', array('bazar_view' => 'Bazar command. Usage #(v)iew [<player>] [<item>]. Browse the bazar.', 'bazar_push' => 'Bazar command. Usage #push <item> <price> [<amt>]. Push your items to the bazar and offer it for a price.', 'bazar_pop' => 'Bazar command. Usage #pop <item>. Remove an item from your bazar and put it back into your inventory. The fee is 50Y.', 'bazar_buy' => 'Bazar command. Usage #buy <player> <item> [<amt>]. Buy an item from the bazar.', 'bazar_buyslot' => 'Bazar command. Usage: #buyslot [<CONFIRM>]. Buy another slot in your bazar to sell items. ', 'bazar_price' => 'Bazar command. Usage: #price <item> <price>. Set a new price for one of your items offered in your bazar.', 'bazar_search' => 'Bazar command. Usage: #search <item_name>. Search the bazar for items in their full-name.', 'bazar_bestbuy' => 'Bazar command. Usage: #bestbuy <item_name> <price> [<amt>]. Try to purchase an item for a given price or less.'), 'smith_cmds' => 'Blacksmith commands', array('clean' => 'Location command. Usage: #(cl)ean <item>. Will remove all modifiers from an item. The runes / modifiers will be lost.', 'break' => 'Location command. Usage: #(b)rea(k) <item>. Will destroy an item and release it`s runes, which you will receive.', 'split' => 'Location command. Usage: #split <rune>. Will split a rune into multiple runes. Useful to extract modifiers from high level runes.', 'upgrade' => 'Location command. Usage: #upgrade <item> <rune>. Apply a rune on your equipment. This may fail or even destroy the item.', 'safeupgrade' => 'Location command. Usage: #safeupgrade <item> <rune>. Apply a rune on your equipment. This uses one amount of MagicOil and may still fail. However, breakchances are zero for this command.'), 'piercer_cmds' => 'Piercer commands', array('pierce' => 'Location command. Usage: #pierce <rune>. Apply a rune to your body. This rune cannot be upgraded further and is lost on #unpierce.', 'unpierce' => 'Location command. Usage: #unpierce. Remove your piercing which will be lost forever.'), 'school_cmds' => 'School and Temple commands', array('courses' => 'Location command. Usage: #courses. In schools you can show available courses to learn.', 'learn' => 'Location command. Usage: #learn <course>. In schools you can learn new skills and spells.'), 'hospital_cmds' => 'Hospital commands', array('implant' => 'Hospital command. Usage #implant <view_id|item>. In hospitals you can implant cyberware. Cyberware will cost essence, which is important for magic spells.', 'unplant' => 'Hospital command. Usage #unplant <cy_id|item>. In hospitals you can unimplant your cyberware, in case it conflicts with other cyberware or you need more essence.', 'heal_cmd' => 'Hospital command. Usage #heal. In hospitals you can quickly get healed for a small fee.', 'surgery' => 'Hospital command. Usage #surgery [<section>]. Revert some lvlup into karma or change your class or gender. This is a quite costly process and could even cost you some cost essence.'), 'subway_cmds' => 'Subway commands', array('travel' => 'Location command. Usage: #travel [<target>]. In subways you can travel to other cities. When no argument is given, the available targets are shown.'), 'hotel_cmds' => 'Hotel commands', array('sleep' => NULL), 'dungeon_cmds' => 'Dungeon commands', array('leave' => 'Location command. Usage: #leave. In most dungeons you can goto an exit and issue leave there to leave the dungeon.', 'search' => 'Location command. Usage: #search. In some dungeon rooms you can use #search to search for hidden items.'), 'clan_cmds' => 'ClanHQ commands', array('clan_create' => 'Player command: Usage: #create <name>. Create your clan.', 'clan_manage' => 'ClanLeader command. Usage: #manage <buywealth|buystorage|buymembers|slogan>. Manage your clan size and motto.', 'clan_request' => 'Player command. Usage: #request <player>. Join another player\'s clan.', 'clan_accept' => 'ClanLeader command. Usage #accept <player>. Accept another player\'s clan join request.', 'clan_abondon' => 'Player command. Usage: #abondon. Abondon or even destroy your current clan. The clan has to be emptied for beeing destroyed.', 'clan_toggle' => 'ClanLeader command. Usage #toggle <moderation>. Switch various clan setting bits.', 'clan_pushy' => 'Player command. Usage: #pushy <amt>. Deposit money into your clan\'s bank.', 'clan_popy' => 'Player command. Usage: #popy <amt>. Withdraw money out of your clan\'s bank.', 'clan_push' => 'Player command. Usage: #push <item> <amt>. Deposit items into your clan\'s storage.', 'clan_pop' => 'Player command. Usage: #pop <item> <amt>. Withdraw items out of your clan\'s storage.', 'clan_view' => 'Player command. Usage: #view <page|item_name|searchterm>. Browse and view items in the clan bank.'))), 'various' => 'I know about', array('tips' => 'Tips', array('0' => 'Bold words in the #help pages are topics that have an own help page, but the word might not be related to the context it appears in.', '1' => 'The commands in #c and #cc change according to your current action/location.'), 'notations' => 'Notations', array('level_notation' => 'Attributes, skills, spells and similiar have the N(M) notation. N is the base level and (M) is the adjusted level. 2(3) means +1 on that field with an effective value of 3.', 'player_notation' => 'Notations for players', array('human_notation' => 'The notation for human players is Nickname{<server>}. @see npc_notation.', 'npc_notation' => 'The notation for NPC/Mobs are Nickname[<player_id>]. @see human_notation.')), 'action' => 'Each #(p)arty has an action', array('action_delete' => 'This means the party is going to be deleted from database.', 'action_talk' => 'This means the party is talking to another party.', 'action_fight' => 'This means the party is fighting another party.', 'action_inside' => 'This means the party is inside a location.', 'action_outside' => 'This means the party is outside a location. Use #(en)ter to enter it.', 'action_sleep' => 'This means the party is sleeping.', 'action_travel' => 'This means the party is travelling to another city.', 'action_explore' => 'This means the party is exploring the current city.', 'action_goto' => 'This means the party is going to a location in the current city.', 'action_hunt' => 'This means the party is hunting another human player.'), 'location' => "Each (p)arty has a location. There are multiple cities and dungeons with lots of locations. You can #(g)oto your #known_places and #(exp)lore your current city to find more. Check your #kp to see all your known places in the current city. Cities", self::getLocationTree(), 'annoying' => 'Annoying stuff', array('annoy_kvirc' => "Add a new event handler for 'OnQueryMessage'. Code: if(\$0 == \"BotNick\"){ echo \$3-; halt; }", 'bots' => 'You are allowed to write bots. Maybe you even like to contribute code or ideas to the AI. Although if you abuse your powers in-game, or your bot disturbs other players, you might get bad_karma, which will annoy you during your journey. If you use scripts, please #enable bot.', 'clones' => 'You are allowed to have multiple characters, aka. Clones. For clones, the same rules as for bots apply.', 'cheating' => 'If you get caught all your characters will be deleted. Do not whine! You have been warned!'), 'features' => 'Features', array('crafting' => 'Crafting System: ', array('runes' => "You can runecraft items at the Blacksmith, but you need to solve the blacksmith quest first.", 'statted' => "Statted means crafted, like Cap_of_strength:1. The more modifiers the more complex is your item. The higher the modifiers, the more complex is your item. Adding a new modifier is more complex than increasing the power of the same modifiers."), 'pvp' => 'PVP, or Player Vs Player, means attacking other humans. Most locations are non pvp, and you cannot #fight there. Dungeons usually have pvp enabled. Please note that outside of locations, pvp generally works.', array('kill_protection' => '')), 'selection' => 'Selection: ', array('enum' => 'To select items, words, places and spells, you can use the id from their respective status_commands; #inventory, #known_words, #known_places, #known_spells.', 'id' => 'ID´s:', array('inv_id' => 'inv_id means inventory ID, which is an enumeration of your invenotry items. The enumeration changes as less as possible, when removing or adding items.', 'view_id' => 'view_id specifies an item from a shop by enumeration. This type of enum / ID works for buy and similar commands. With #compare you can use S_1 to reference the first shop item.', 'spell_id' => 'Refer to your spell by using the id from #known_spells. Use #(k)nown_(s)pells to list your spells, use #(ca)st to cast a spell.', 'kp_id' => 'A kp_id means the enum of one of your #(k)nown_(p)laces. You can find new known_places with #explore.', 'kw_id' => 'The game stores common #talk triggers inside your #(k)nown_(w)ords. you can use their enumeration when using #talk.', 'target_id' => 'Also with #cast, #attack and #use you can specify a target by enum. For friendly actions this is the ID from the #party command, for offensive actions this is the enemy_party member_id.', 'player_id' => '', 'server_id' => '', 'npc_id' => ''), 'shortcuts' => 'Most often you can use IDs and shortcut names to reference things. If you use shortcuts in names please use at least 3 characters.', 'item_name' => 'Specify an item by name. You can use abbreviations, like lglo for TinfoilGloves, but an abbreviation has to be at least 3 characters in length.'), 'events' => 'Events: ', array('meet' => 'When you meet people or NPC on streets, you are in talk mode. Use #say to talk to the party you met. You can also use #join, #fight, #give or any other command you can imagine.', 'encounter' => 'When you encounter an enemy party, you start to combat them. In combat you can do any cmd, and the default is to attack a random target, which locks this choice.'), 'teachers' => 'The teachers', array('caesum' => 'Caesum is the founder of the \'School of Cryptography and applied Math\' in Seattle.', 'digitalseraphim' => 'digitalseraphim is the founder of the School of Alchemy in Delaware.', 'dloser' => 'There is not much notes on dloser yet.', 'freeartman' => 'FreeArtMan is the founder of the "School of Electronics" in the Amerindian Area.', 'jmoncayo' => 'jmoncayo is the founder of the \'School of Fireweapons\' in Redmond.', 'livinskull' => 'livinskull is the founder of the "School of Computers" in the Amerindian Area.', 'monnino' => 'Monsieur monnino teaches swordsmanship and other melee skills in the MeleeRange in Chicago.', 'noother' => 'Mr. Northwood is the head of NySoft, the most successful software company in the 21th century.', 'paipai' => 'Senor paiapi teaches hacking and spanish at the coelet institute.', 'bsdhell' => 'bsdhell and kwisatz run the School of Assembly in Vegas.', 'kwisatz' => 'kwisatz and bsdhell run the School of Assembly in Vegas.', 'sabretooth' => 'Owner of the school of Social Engineering in Vegas. Narrator of many voices in the Shadowlamb Multiverse.', 'quangntenemy' => 'Professor quangntenemy teaches high level enterprise programming (HLEP) in the Vegas_Gamecollege.', 'more_teachers' => 'Erik, MiB, Tsutomu, epoch_qwert, Mawekl, InfoMirmo, Caesum, Edge, Sphinx, TheBlackSheep, ChaosDreamer, quangtenemy, matrixman, wb7331, Z, and a lot more!', 'way_more_teachers' => 'TheHiveMind, Jinx, Garfield, jjk, dalfor, Jander, Kender, Inferno, digitalseraphim, spaceone!'), 'options' => 'Player and interface options', array('help_option' => 'You can dis/enable this option to receive some basic help messages or not.', 'notice_option' => 'You can toggle your lamb reply type to NOTICE with #enable notice.', 'privmsg_option' => 'You can toggle your lamb reply type to PRIVMSG with #enable privmsg.', 'lock_option' => 'Dis/enable equipment lock, which determines how your (effective) level is computed. When you lock your equipment you cannot change it in combat.', 'bot_option' => 'Dis/enable the bot flag for your player. This has no effect on the game, just that [BOT] is shown behind your playername as information.', 'norl_option' => 'You can dis/enable this option to specify if it is allowed to steal your leadership with the #rl command.', 'norefresh_option' => 'You can enable this option to supress HP/MP refreshing messages.', 'noautolook_option' => 'You can enable this option to supress auto look, and arrival / leave messages.'), 'glossary' => 'Some glossary of terms and keywords used.', array('decker' => "In the Shadowrun(tm) world, a decker is a hacker, who directly connects to computersystem using cyberdecks.", 'eta' => 'ETA means estimated time to arrival; How many time is left until your party completed an action.'))));
     return $back;
 }
Ejemplo n.º 2
0
 public static function execute(SR_Player $player, array $args)
 {
     $bot = Shadowrap::instance($player);
     if (!$player->getParty()->isIdle()) {
         $player->msg('1033');
         return false;
         // 			return $player->message('Your party needs to be idle to request a new leader.');
     }
     if ($player->isLeader()) {
         $player->msg('1095');
         return false;
         // 			return $bot->reply('You are already leader of your party.');
     }
     $party = $player->getParty();
     $leader = $party->getLeader();
     $user = $leader->getUser();
     $last = $user->getVar('lusr_timestamp');
     $wait = $last + self::RL_TIME - time();
     if ($leader->isOptionEnabled(SR_Player::NO_RL)) {
         self::rply($player, '1096');
         return false;
         // 			return $bot->reply('Your leader does not allow to takeover the leadership.');
     }
     if ($wait > 0) {
         self::rply($player, '1097', array(GWF_Time::humanDuration($wait)));
         return false;
         // 			return $bot->reply(sprintf('Please wait %s and try again.', GWF_Time::humanDuration($wait)));
     }
     if (false === $party->setLeader($player)) {
         return $bot->reply('Database Error.');
     }
     return $party->ntice('5138', array($player->getName()));
     // 		return $party->notice(sprintf('%s is the new party leader.', $player->getName()));
 }
Ejemplo n.º 3
0
 public function isFlooding()
 {
     $uid = GWF_Session::getUserID();
     $uname = GWF_Shoutbox::generateUsername();
     $euname = GDO::escape($uname);
     $table = GDO::table('GWF_Shoutbox');
     $max = $uid === 0 ? $this->module->cfgMaxPerDayGuest() : $this->module->cfgMaxPerDayUser();
     //		$cut = GWF_Time::getDate(GWF_Time::LEN_SECOND, time()-$this->module->cfgTimeout());
     //		$cnt = $table->countRows("shout_uname='$euname' AND shout_date>'$cut'");
     # Check captcha
     if ($this->module->cfgCaptcha()) {
         require_once GWF_CORE_PATH . 'inc/3p/Class_Captcha.php';
         if (!PhpCaptcha::Validate(Common::getPostString('captcha'), true)) {
             return GWF_HTML::err('ERR_WRONG_CAPTCHA');
         }
     }
     # Check date
     $timeout = $this->module->cfgTimeout();
     $last_date = $table->selectVar('MAX(shout_date)', "shout_uid={$uid} AND shout_uname='{$euname}'");
     $last_time = $last_date === NULL ? 0 : GWF_Time::getTimestamp($last_date);
     $next_time = $last_time + $timeout;
     if ($last_time + $timeout > time()) {
         return $this->module->error('err_flood_time', array(GWF_Time::humanDuration($next_time - time())));
     }
     # Check amount
     $today = GWF_Time::getDate(GWF_Date::LEN_SECOND, time() - $timeout);
     $count = $table->countRows("shout_uid={$uid} AND shout_date>='{$today}'");
     if ($count >= $max) {
         return $this->module->error('err_flood_limit', array($max));
     }
     # All fine
     return false;
 }
Ejemplo n.º 4
0
 private function onAdd()
 {
     $form = $this->formAdd();
     if (false !== ($error = $form->validate($this->module))) {
         return $error . $this->templateAdd();
     }
     $file = $form->getVar('file');
     $tmp = $file['tmp_name'];
     $postid = $this->post->getID();
     $userid = GWF_Session::getUserID();
     $options = 0;
     $options |= isset($_POST['guest_view']) ? GWF_ForumAttachment::GUEST_VISIBLE : 0;
     $options |= isset($_POST['guest_down']) ? GWF_ForumAttachment::GUEST_DOWNLOAD : 0;
     # Put in db
     $attach = new GWF_ForumAttachment(array('fatt_aid' => 0, 'fatt_uid' => $userid, 'fatt_pid' => $postid, 'fatt_mime' => GWF_Upload::getMimeType($tmp), 'fatt_size' => filesize($tmp), 'fatt_downloads' => 0, 'fatt_filename' => $file['name'], 'fatt_options' => $options, 'fatt_date' => GWF_Time::getDate(GWF_Date::LEN_SECOND)));
     if (false === $attach->insert()) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     $aid = $attach->getID();
     # Copy file
     $path = $attach->dbimgPath();
     if (false === GWF_Upload::moveTo($file, $path)) {
         @unlink($tmp);
         return GWF_HTML::err('ERR_WRITE_FILE', $path);
     }
     @unlink($tmp);
     $this->post->increase('post_attachments', 1);
     return $this->module->message('msg_attach_added', array($this->post->getShowHREF()));
 }
Ejemplo n.º 5
0
 private function onAddBan()
 {
     $form = $this->getFormBan();
     if (false !== ($errors = $form->validate($this->module))) {
         return $errors;
     }
     $perm = $form->getVar('perm');
     $ban = $form->getVar('type');
     $ends = $form->getVar('ends');
     $msg = $form->getVar('msg');
     $userid = $this->user->getID();
     if ($ban) {
         if ($perm) {
             $ends = '';
         } elseif ($ends === '') {
             return $this->module->error('err_perm_or_date');
         } elseif ($ends < date('YmdHis')) {
             return $this->module->error('err_future_is_past');
         }
         GWF_Ban::insertBan($userid, $ends, $msg);
         if ($ends === '') {
             return $this->module->message('msg_permbanned', array($this->user->displayUsername()));
         } else {
             return $this->module->message('msg_tempbanned', array($this->user->displayUsername(), GWF_Time::displayDate($ends)));
         }
     } else {
         GWF_Ban::insertWarning($userid, $msg);
         return $this->module->message('msg_warned', array($this->user->displayUsername()));
     }
 }
Ejemplo n.º 6
0
 public function onAddSite()
 {
     $form = $this->getForm();
     if (false !== ($error = $form->validate($this->module))) {
         return $error . $this->templateSiteAdd();
     }
     $site = new WC_Site(array('site_status' => 'wanted', 'site_name' => $form->getVar('site_name'), 'site_classname' => $form->getVar('site_classname'), 'site_country' => 0, 'site_language' => 0, 'site_joindate' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'site_launchdate' => '', 'site_authkey' => GWF_Random::randomKey(32), 'site_xauthkey' => GWF_Random::randomKey(32), 'site_irc' => '', 'site_url' => '', 'site_url_mail' => '', 'site_url_score' => '', 'site_url_profile' => '', 'site_score' => 0, 'site_basescore' => 0, 'site_avg' => 0, 'site_vote_dif' => 0, 'site_vote_fun' => 0, 'site_challcount' => 0, 'site_usercount' => 0, 'site_visit_in' => 0, 'site_visit_out' => 0, 'site_options' => 0, 'site_boardid' => 0, 'site_threadid' => 0, 'site_tags' => ''));
     if (false === $site->insert()) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     Module_WeChall::includeVotes();
     if (false === $site->onCreateVotes()) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     Module_WeChall::includeForums();
     if (false === $site->onCreateBoard()) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     if (false === $site->onCreateThread($this->module)) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     require_once GWF_CORE_PATH . 'module/WeChall/WC_SiteDescr.php';
     if (false === WC_SiteDescr::insertDescr($site->getID(), 1, 'Please edit me :)')) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     return $this->module->message('msg_site_added');
 }
Ejemplo n.º 7
0
 private function onCleanupUntagged()
 {
     $songs = GDO::table('Slay_Song');
     $cut = GWF_Time::getDate(14, time() - 3600);
     $songs->deleteWhere("ss_taggers=0 AND ss_last_played<'{$cut}'");
     return $this->module->message('msg_cleanup');
 }
Ejemplo n.º 8
0
 public static function markSolved(GWF_User $user, WC_Warchall $chall)
 {
     if (!self::table(__CLASS__)->insertAssoc(array('wc_wcid' => $chall->getID(), 'wc_uid' => $user->getID(), 'wc_solved_at' => GWF_Time::getDate(14)))) {
         return false;
     }
     return true;
 }
Ejemplo n.º 9
0
 private function getArchiveName()
 {
     if ($this->archiveName === false) {
         return sprintf('www/protected/zipped/%s_%s.zip', GWF_Time::getDate(GWF_Date::LEN_SECOND), implode(',', $this->style));
     } else {
         return $this->archiveName;
     }
 }
Ejemplo n.º 10
0
 public static function createPeak($cid, $count = 0, $options = 0)
 {
     $peak = new self(array('lcpeak_cid' => $cid, 'lcpeak_peak' => $count, 'lcpeak_date' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'lcpeak_options' => 0));
     if (false === $peak->replace()) {
         return false;
     }
     return $peak;
 }
Ejemplo n.º 11
0
 /**
  * Insert a new quote.
  * @param string $username
  * @param string $text
  * @return Dog_Quote
  */
 public static function insertQuote($username, $text)
 {
     $quote = new self(array('quot_id' => 0, 'quot_text' => $text, 'quot_username' => $username, 'quot_rating' => 0, 'quot_date' => GWF_Time::getDate(14)));
     if (false === $quote->insert()) {
         return false;
     }
     return $quote;
 }
Ejemplo n.º 12
0
 public function resetTimer(SR_Player $player)
 {
     $time = Seattle::TIME_TO_DELAWARE + 60;
     $player->setConst('__AURIS_TIMEOUT', Shadowrun4::getTime() + $time);
     $player->message($this->lang('fluid', array(GWF_Time::humanDuration($time))));
     // 		$player->message(sprintf("Your pot of Auris is fluid for %s.", GWF_Time::humanDuration($time)));
     return true;
 }
Ejemplo n.º 13
0
 private static function insert_bot($botname)
 {
     $user = new GWF_User(array('user_id' => 0, 'user_options' => GWF_User::BOT | GWF_User::WEBSPIDER, 'user_name' => $botname, 'user_password' => GWF_Password::hashPasswordS('webspider'), 'user_regdate' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'user_regip' => GWF_IP6::getIP(GWF_IP_EXACT, '127.0.0.1'), 'user_email' => '', 'user_gender' => 'no_gender', 'user_lastlogin' => 0, 'user_lastactivity' => 0, 'user_birthdate' => '00000000', 'user_avatar_v' => 0, 'user_countryid' => 0, 'user_langid' => 0, 'user_langid2' => 0, 'user_level' => 0, 'user_title' => '', 'user_settings' => NULL, 'user_data' => NULL, 'user_credits' => 0.0));
     if (false === $user->insert()) {
         return false;
     }
     echo "Inserted new Bot: {$botname}<br/>";
     return $user;
 }
Ejemplo n.º 14
0
 public function cast(SR_Player $player, SR_Player $target, $level, $hits, SR_Player $potion_player)
 {
     $dur = $this->getSpellDuration($potion_player, $target, $level, $hits);
     $by = $this->getSpellIncrement($potion_player, $target, $level, $hits);
     $by = $this->lowerSpellIncrement($target, $by, 'min_dmg');
     $mod = array('min_dmg' => $by, 'max_dmg' => $by * 2);
     $target->addEffects(new SR_Effect($dur, $mod));
     $this->announceADV($player, $target, $level, '10010', $by, $by * 2, GWF_Time::humanDuration($dur));
     return true;
 }
Ejemplo n.º 15
0
 public static function checkUser(Module_Download $module, GWF_Download $dl, $user)
 {
     if ($user === false) {
         return false;
     }
     $id = $dl->getID();
     $uid = $user->getID();
     $now = GWF_Time::getDate(GWF_Date::LEN_SECOND);
     return self::table(__CLASS__)->selectVar('1', "dlt_dlid={$id} AND dlt_uid={$uid} AND (dlt_expires='' OR dlt_expires>'{$now}')") === '1';
 }
Ejemplo n.º 16
0
 private static function deleteOldActivations(Module_Register $module)
 {
     $cut = time() - $module->getActivationThreshold();
     self::log('Deleting user activations older than ' . GWF_Time::displayTimestamp($cut));
     $table = new GWF_UserActivation(false);
     $result = $table->deleteWhere("timestamp<{$cut}");
     if (0 < ($nDeleted = $table->affectedRows($result))) {
         self::log(sprintf('Deleted %d old user activations.', $nDeleted));
     }
 }
Ejemplo n.º 17
0
 private function onCrossRegister($username)
 {
     $options = 0;
     $password = GWF_Random::randomKey();
     $user = new GWF_User(array('user_id' => 0, 'user_options' => $options, 'user_name' => $username, 'user_password' => GWF_Password::hashPasswordS($password), 'user_regdate' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'user_regip' => GWF_IP6::getIP(GWF_IP_EXACT), 'user_email' => '', 'user_gender' => 'no_gender', 'user_lastlogin' => time(), 'user_lastactivity' => time(), 'user_birthdate' => '00000000', 'user_avatar_v' => 0, 'user_countryid' => 0, 'user_langid' => 1, 'user_langid2' => 0, 'user_level' => 0, 'user_title' => '', 'user_settings' => '', 'user_data' => '', 'user_credits' => '0.00'));
     if (false === $user->insert()) {
         return false;
     }
     return true;
 }
Ejemplo n.º 18
0
 public static function insertCrackord(WC_Challenge $chall, $uid, $start, $time, $solved, $count)
 {
     if ($count === 0) {
         return true;
     }
     $failed = $count - $solved;
     $rate = $count > 0 ? $solved / $count * 100 : 0;
     $entry = new self(array('wccc_id' => 0, 'wccc_uid' => $uid, 'wccc_start' => GWF_Time::getDate(GWF_DATE::LEN_SECOND, intval($start)), 'wccc_time' => intval(round($time)), 'wccc_rate' => round($rate, 2), 'wccc_count' => $count, 'wccc_solved' => $solved, 'wccc_failed' => $failed));
     return $entry->insert();
 }
Ejemplo n.º 19
0
 private static function installPMBot(Module_PM $module)
 {
     $user = new GWF_User(array('user_name' => '_GWF_PM_BOT_', 'user_password' => 'x', 'user_regdate' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'user_regip' => GWF_IP6::getIP(GWF_IP_EXACT, '127.0.0.1'), 'user_email' => GWF_BOT_EMAIL, 'user_birthdate' => GWF_Time::getDate(GWF_Time::LEN_DAY), 'user_countryid' => 0, 'user_langid' => 0, 'user_options' => GWF_User::BOT, 'user_lastactivity' => time()));
     if (false === $user->insert()) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     if (false === GWF_ModuleLoader::saveModuleVar($module, 'pm_bot_uid', $user->getID())) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     return '';
 }
Ejemplo n.º 20
0
 public static function insertFirstLink(GWF_User $user, WC_Site $site, $onsitename, $onsitescore)
 {
     $table = self::table(__CLASS__);
     $siteid = $site->getVar('site_id');
     if (false !== $table->getRow($onsitename, $siteid)) {
         return true;
     }
     $entry = new self(array('fili_onsitename' => $onsitename, 'fili_sid' => $siteid, 'fili_date' => GWF_Time::getDate(GWF_Date::LEN_DAY), 'fili_uid' => $user->getVar('user_id'), 'fili_username' => $user->getVar('user_name'), 'fili_sitename' => $site->getVar('site_name'), 'fili_percent' => $site->getPercent($onsitescore)));
     //		echo GWF_HTML::message('DEBUG', 'Insert First Link...');
     return $entry->insert();
 }
Ejemplo n.º 21
0
 private static function onInstallDefaultGB(Module_Guestbook $module, $dropTable)
 {
     if (false !== ($gb = GWF_Guestbook::getByID(1))) {
         return '';
     }
     $gb = new GWF_Guestbook(array('gb_id' => 1, 'gb_uid' => 0, 'gb_title' => $module->lang('default_title'), 'gb_descr' => $module->lang('default_descr'), 'gb_date' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'gb_options' => GWF_Guestbook::DEFAULT_OPTIONS));
     if (false === $gb->insert()) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     return '';
 }
Ejemplo n.º 22
0
 public function cast(SR_Player $player, SR_Player $target, $level, $hits, SR_Player $potion_player)
 {
     $dur = $this->getSpellDuration($potion_player, $target, $level, $hits);
     $by = $this->getSpellIncrement($potion_player, $target, $level, $hits);
     $by = $this->lowerSpellIncrement($target, $by, 'strength');
     $mod = array('strength' => $by);
     $target->addEffects(new SR_Effect($dur, $mod));
     // 		$append = sprintf('+%s strength for %s.', $by, GWF_Time::humanDuration($dur));
     $this->announceADV($player, $target, $level, '10060', $by, GWF_Time::humanDuration($dur));
     return true;
 }
Ejemplo n.º 23
0
 public static function insertSuccess(WC_Warflag $flag, GWF_User $user)
 {
     if (false !== ($entry = self::getByFlagUser($flag, $user))) {
         if (!$entry->getVar('wf_solved_at')) {
             return $entry->saveVars(array('wf_attempts' => $entry->getVar('wf_attempts') + 1, 'wf_last_attempt' => NULL, 'wf_solved_at' => GWF_Time::getDate()));
         } else {
             return true;
         }
     }
     return self::table(__CLASS__)->insertAssoc(array('wf_wfid' => $flag->getID(), 'wf_uid' => $user->getID(), 'wf_solved_at' => GWF_Time::getDate(), 'wf_attempts' => '1', 'wf_last_attempt' => NULL));
 }
Ejemplo n.º 24
0
 public static function insertSolution($cid, $uid, $solution)
 {
     $table = self::table(__CLASS__);
     $cid = (int) $cid;
     $uid = (int) $uid;
     $esol = $table->escape($solution);
     if (false !== $table->selectFirst("wmc_cid={$cid} AND wmc_uid={$uid} AND wmc_solution='{$esol}'")) {
         return true;
     }
     return $table->insertAssoc(array('wmc_id' => 0, 'wmc_cid' => $cid, 'wmc_uid' => $uid, 'wmc_date' => GWF_Time::getDate(GWF_Date::LEN_SECOND), 'wmc_length' => strlen($solution), 'wmc_solution' => $solution));
 }
Ejemplo n.º 25
0
 /**
  * Insert a song into the play history.
  * @param Slay_Song $song
  * @param int $time_end
  */
 public static function insertPlayed(Slay_Song $song, $time_end)
 {
     if (self::getLastID() === $song->getID()) {
         return true;
     }
     $date = GWF_Time::getDate(GWF_Date::LEN_SECOND, $time_end - $song->getVar('ss_duration'));
     if (false === $song->saveVar('ss_last_played', $date)) {
         return false;
     }
     return self::table(__CLASS__)->insertAssoc(array('sph_id' => 0, 'sph_sid' => $song->getID(), 'sph_date' => $date), false);
 }
Ejemplo n.º 26
0
 private function onAdd()
 {
     $form = $this->formAdd();
     if (false !== ($error = $form->validate($this->module))) {
         return $error;
     }
     if (!GDO::table('GWF_ProfilePOIWhitelist')->insertAssoc(array('pw_uida' => GWF_Session::getUserID(), 'pw_uidb' => $this->user_to_add->getID(), 'pw_date' => GWF_Time::getDate()))) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     return $this->module->message('msg_white_added', $_POST['user_name']);
 }
Ejemplo n.º 27
0
 private function onAdd()
 {
     $form = $this->getForm();
     if (false !== ($err = $form->validate($this->module))) {
         return $err . $this->templateAdd();
     }
     $group = new GWF_Group(array('group_id' => 0, 'group_name' => $form->getVar('groupname'), 'group_options' => GWF_Group::FULL | GWF_Group::SCRIPT, 'group_lang' => 0, 'group_country' => 0, 'group_founder' => 0, 'group_memberc' => 0, 'group_bid' => 0, 'group_date' => GWF_Time::getDate(GWF_Date::LEN_SECOND)));
     if (false === $group->insert()) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)) . $this->templateAdd();
     }
     return $this->module->message('msg_group_added');
 }
Ejemplo n.º 28
0
 public function on_peakmaster_Lc()
 {
     $peak = Dog_ChannelPeak::getHighest();
     $date = $peak->getVar('lcpeak_date');
     $age = GWF_Time::displayAge($date);
     $date = GWF_Time::displayDate($date);
     $count = $peak->getVar('lcpeak_peak');
     $chan = $peak->getChannel();
     $serv = $chan->getServer();
     $args = array($chan->getName(), $serv->displayLongName(), $count, $date, $age);
     $this->rply('best_peak', $args);
 }
Ejemplo n.º 29
0
 private function validate()
 {
     if (false === ($this->client = GWF_Client::getByToken(Common::getGet('token')))) {
         return $this->module->error('err_token');
     }
     $datestamp = Common::getGet('datestamp', '');
     if (!GWF_Time::isValidDate($datestamp, true, GWF_Date::LEN_SECOND)) {
         return $this->module->error('err_datestamp');
     }
     $this->datestamp = $datestamp;
     return false;
 }
Ejemplo n.º 30
0
 public static function populateFile($basedir, $fullpath)
 {
     $mtime = GWF_Time::getDate(GWF_Date::LEN_SECOND, filemtime($fullpath));
     if (false === ($row = self::getByPath($fullpath))) {
         $row = new self(array('vsf_id' => 0, 'vsf_dir' => $basedir, 'vsf_path' => $fullpath, 'vsf_hash' => self::hash(file_get_contents($fullpath)), 'vsf_date' => $mtime));
         return $row->insert();
     }
     if ($row->getVar('vsf_date') < $mtime) {
         return $row->saveVars(array('vsf_hash' => self::hash(file_get_contents($fullpath)), 'vsf_date' => $mtime));
     }
     return true;
 }