Overview

Namespaces

  • Budabot
    • Core
      • Modules
    • User
      • Modules
  • None
  • Tyrence
    • Modules

Classes

  • AccessLevel
  • Budabot\Core\AccessManager
  • Budabot\Core\AdminManager
  • Budabot\Core\AOChat
  • Budabot\Core\AOChatPacket
  • Budabot\Core\AOChatQueue
  • Budabot\Core\AOExtMsg
  • Budabot\Core\AsyncHttp
  • Budabot\Core\AutoInject
  • Budabot\Core\BotRunner
  • Budabot\Core\Budabot
  • Budabot\Core\BuddylistManager
  • Budabot\Core\CacheManager
  • Budabot\Core\CacheResult
  • Budabot\Core\ClassLoader
  • Budabot\Core\ColorSettingHandler
  • Budabot\Core\CommandAlias
  • Budabot\Core\CommandManager
  • Budabot\Core\ConfigFile
  • Budabot\Core\DB
  • Budabot\Core\DBRow
  • Budabot\Core\EventLoop
  • Budabot\Core\EventManager
  • Budabot\Core\GuildChannelCommandReply
  • Budabot\Core\GuildManager
  • Budabot\Core\HelpManager
  • Budabot\Core\Http
  • Budabot\Core\HttpRequest
  • Budabot\Core\LegacyLogger
  • Budabot\Core\LimitsController
  • Budabot\Core\LoggerWrapper
  • Budabot\Core\MMDBParser
  • Budabot\Core\Modules\AdminController
  • Budabot\Core\Modules\AliasController
  • Budabot\Core\Modules\AltInfo
  • Budabot\Core\Modules\AltsController
  • Budabot\Core\Modules\BanController
  • Budabot\Core\Modules\BuddylistController
  • Budabot\Core\Modules\ColorsController
  • Budabot\Core\Modules\CommandlistController
  • Budabot\Core\Modules\CommandSearchController
  • Budabot\Core\Modules\ConfigController
  • Budabot\Core\Modules\EventlistController
  • Budabot\Core\Modules\HelpController
  • Budabot\Core\Modules\LogsController
  • Budabot\Core\Modules\PlayerLookupController
  • Budabot\Core\Modules\ProfileCommandReply
  • Budabot\Core\Modules\ProfileController
  • Budabot\Core\Modules\SettingsController
  • Budabot\Core\Modules\SQLController
  • Budabot\Core\Modules\SystemController
  • Budabot\Core\Modules\UsageController
  • Budabot\Core\Modules\WhitelistController
  • Budabot\Core\NumberSettingHandler
  • Budabot\Core\OptionsSettingHandler
  • Budabot\Core\PlayerHistory
  • Budabot\Core\PlayerHistoryManager
  • Budabot\Core\PlayerManager
  • Budabot\Core\Preferences
  • Budabot\Core\PrivateChannelCommandReply
  • Budabot\Core\PrivateMessageCommandReply
  • Budabot\Core\Registry
  • Budabot\Core\SettingHandler
  • Budabot\Core\SettingManager
  • Budabot\Core\SettingObject
  • Budabot\Core\SocketManager
  • Budabot\Core\SocketNotifier
  • Budabot\Core\SubcommandManager
  • Budabot\Core\Text
  • Budabot\Core\TextSettingHandler
  • Budabot\Core\Timer
  • Budabot\Core\TimerEvent
  • Budabot\Core\TimeSettingHandler
  • Budabot\Core\Util
  • Budabot\Core\xml
  • Budabot\User\Modules\AlienArmorController
  • Budabot\User\Modules\AlienBioController
  • Budabot\User\Modules\AlienMiscController
  • Budabot\User\Modules\AOSpeakController
  • Budabot\User\Modules\AOUController
  • Budabot\User\Modules\AXPController
  • Budabot\User\Modules\BankController
  • Budabot\User\Modules\BosslootController
  • Budabot\User\Modules\BroadcastController
  • Budabot\User\Modules\BuffPerksController
  • Budabot\User\Modules\CacheController
  • Budabot\User\Modules\ChatAssistController
  • Budabot\User\Modules\ChatCheckController
  • Budabot\User\Modules\ChatLeaderController
  • Budabot\User\Modules\ChatRallyController
  • Budabot\User\Modules\ChatSayController
  • Budabot\User\Modules\ChatTopicController
  • Budabot\User\Modules\CityWaveController
  • Budabot\User\Modules\CloakController
  • Budabot\User\Modules\ClusterController
  • Budabot\User\Modules\CountdownController
  • Budabot\User\Modules\DevController
  • Budabot\User\Modules\DingController
  • Budabot\User\Modules\EventsController
  • Budabot\User\Modules\FightController
  • Budabot\User\Modules\FindOrgController
  • Budabot\User\Modules\FindPlayerController
  • Budabot\User\Modules\FunController
  • Budabot\User\Modules\GitController
  • Budabot\User\Modules\GuideController
  • Budabot\User\Modules\GuildController
  • Budabot\User\Modules\HelpbotController
  • Budabot\User\Modules\HtmlDecodeController
  • Budabot\User\Modules\ImplantController
  • Budabot\User\Modules\ImplantDesignerController
  • Budabot\User\Modules\InactiveMemberController
  • Budabot\User\Modules\ItemsController
  • Budabot\User\Modules\KillOnSightController
  • Budabot\User\Modules\LevelController
  • Budabot\User\Modules\LinksController
  • Budabot\User\Modules\LootListsController
  • Budabot\User\Modules\MdbController
  • Budabot\User\Modules\MessageInfoCommandReply
  • Budabot\User\Modules\MockCommandReply
  • Budabot\User\Modules\NanoController
  • Budabot\User\Modules\NewsController
  • Budabot\User\Modules\NotesController
  • Budabot\User\Modules\OnlineController
  • Budabot\User\Modules\OrgHistoryController
  • Budabot\User\Modules\OrglistController
  • Budabot\User\Modules\OrgMembersController
  • Budabot\User\Modules\OSController
  • Budabot\User\Modules\PlayerHistoryController
  • Budabot\User\Modules\PlayfieldController
  • Budabot\User\Modules\PocketbossController
  • Budabot\User\Modules\PremadeImplantController
  • Budabot\User\Modules\PrivateChannelController
  • Budabot\User\Modules\QuoteController
  • Budabot\User\Modules\RaffleController
  • Budabot\User\Modules\RaidController
  • Budabot\User\Modules\RandomController
  • Budabot\User\Modules\RecipeController
  • Budabot\User\Modules\RelayController
  • Budabot\User\Modules\ReputationController
  • Budabot\User\Modules\ResearchController
  • Budabot\User\Modules\RunAsController
  • Budabot\User\Modules\SendTellController
  • Budabot\User\Modules\ShoppingController
  • Budabot\User\Modules\SilenceController
  • Budabot\User\Modules\SkillsController
  • Budabot\User\Modules\SpiritsController
  • Budabot\User\Modules\StopwatchController
  • Budabot\User\Modules\Teamspeak3
  • Budabot\User\Modules\TeamspeakController
  • Budabot\User\Modules\TestController
  • Budabot\User\Modules\TimeController
  • Budabot\User\Modules\TimerController
  • Budabot\User\Modules\TimezoneController
  • Budabot\User\Modules\TowerController
  • Budabot\User\Modules\TrackerController
  • Budabot\User\Modules\TrickleController
  • Budabot\User\Modules\UnixtimeController
  • Budabot\User\Modules\VoteController
  • Budabot\User\Modules\WeatherController
  • Budabot\User\Modules\WhatBuffsController
  • Budabot\User\Modules\WhereisController
  • Budabot\User\Modules\WhoisController
  • Budabot\User\Modules\WhoisOrgController
  • Budabot\User\Modules\WhompahController
  • Command
  • DefaultStatus
  • DefineCommand
  • Description
  • Event
  • HandlesCommand
  • Help
  • Inject
  • Instance
  • Intoptions
  • Matches
  • Options
  • Setting
  • Setup
  • Type
  • Tyrence\Modules\DemoResponseCommandReply
  • Tyrence\Modules\SameChannelResponseController
  • Visibility

Interfaces

  • Budabot\Core\CommandReply

Exceptions

  • Budabot\Core\InvalidHttpRequest
  • Budabot\Core\SQLException
  • Budabot\Core\StopExecutionException

Functions

  • Budabot\Core\isWindows
  • Budabot\Core\Modules\read_input
  • Overview
  • Namespace
  • Class
  1: <?php
  2: 
  3: namespace Budabot\User\Modules;
  4: 
  5: /**
  6:  * Authors: 
  7:  *  - Blackruby (RK2),
  8:  *  - Mdkdoc420 (RK2), 
  9:  *  - Wolfbiter (RK1), 
 10:  *  - Gatester (RK2), 
 11:  *  - Marebone (RK2)
 12:  *
 13:  * @Instance
 14:  *
 15:  * Commands this controller contains:
 16:  *  @DefineCommand(
 17:  *      command     = 'leprocs', 
 18:  *      accessLevel = 'all', 
 19:  *      description = "Shows each profession's LE procs", 
 20:  *      help        = 'leprocs.txt',
 21:  *      alias       = 'leproc'
 22:  *  )
 23:  *  @DefineCommand(
 24:  *      command     = 'ofabarmor',
 25:  *      accessLevel = 'all', 
 26:  *      description = 'Shows ofab armors available to a given profession and their VP cost', 
 27:  *      help        = 'ofabarmor.txt'
 28:  *  )
 29:  *  @DefineCommand(
 30:  *      command     = 'ofabweapons',
 31:  *      accessLevel = 'all', 
 32:  *      description = 'Shows Ofab weapons, their marks, and VP cost', 
 33:  *      help        = 'ofabweapons.txt'
 34:  *  )
 35:  *  @DefineCommand(
 36:  *      command     = 'aigen',
 37:  *      accessLevel = 'all', 
 38:  *      description = 'Shows info about Alien City Generals', 
 39:  *      help        = 'aigen.txt'
 40:  *  )
 41:  */
 42: class AlienMiscController {
 43: 
 44:     /**
 45:      * Name of the module.
 46:      * Set automatically by module loader.
 47:      */
 48:     public $moduleName;
 49: 
 50:     /** @Inject */
 51:     public $db;
 52: 
 53:     /** @Inject */
 54:     public $text;
 55:     
 56:     /** @Inject */
 57:     public $util;
 58:     
 59:     /** @Inject */
 60:     public $itemsController;
 61: 
 62:     /** @Logger */
 63:     public $logger;
 64: 
 65:     /**
 66:      * @Setup
 67:      */
 68:     public function setup() {
 69:         // load database tables from .sql-files
 70:         $this->db->loadSQLFile($this->moduleName, 'leprocs');
 71:         $this->db->loadSQLFile($this->moduleName, 'ofabarmor');
 72:         $this->db->loadSQLFile($this->moduleName, 'ofabweapons');
 73:     }
 74: 
 75:     /**
 76:      * This command handler shows menu of each profession's LE procs.
 77:      *
 78:      * @HandlesCommand("leprocs")
 79:      * @Matches("/^leprocs$/i")
 80:      */
 81:     public function leprocsCommand($message, $channel, $sender, $sendto, $args) {
 82:         $data = $this->db->query("SELECT DISTINCT profession FROM leprocs ORDER BY profession ASC");
 83: 
 84:         $blob = '';
 85:         forEach ($data as $row) {
 86:             $professionLink = $this->text->makeChatcmd($row->profession, "/tell <myname> leprocs $row->profession");
 87:             $blob .= $professionLink . "\n";
 88:         }
 89:         $blob .= "\n\nProc info provided by Wolfbiter (RK1), Gatester (RK2), DrUrban";
 90: 
 91:         $msg = $this->text->makeBlob("LE Procs", $blob);
 92:         $sendto->reply($msg);
 93:     }
 94:     
 95:     /**
 96:      * This command handler shows the LE procs for a particular profession.
 97:      *
 98:      * @HandlesCommand("leprocs")
 99:      * @Matches("/^leprocs (.+)$/i")
100:      */
101:     public function leprocsInfoCommand($message, $channel, $sender, $sendto, $args) {
102:         $profession = $this->util->getProfessionName($args[1]);
103:         if (empty($profession)) {
104:             return false;
105:         }
106: 
107:         $data = $this->db->query("SELECT * FROM leprocs WHERE profession LIKE ? ORDER BY proc_type ASC, research_lvl DESC", $profession);
108:         if (count($data) == 0) {
109:             $msg = "No procs found for profession '$profession'.";
110:         } else {
111:             $blob = '';
112:             $type = '';
113:             forEach ($data as $row) {
114:                 if ($type != $row->proc_type) {
115:                     $type = $row->proc_type;
116:                     $blob .= "\n<tab><yellow>$type<end>\n";
117:                 }
118: 
119:                 $proc_trigger = "<green>$row->proc_trigger<end>";
120:                 $blob .= "[$row->research_lvl] $row->name <orange>$row->modifiers<end> $row->duration $proc_trigger\n";
121:             }
122:             $blob .= "\n\nNote: Offensive procs have a 5% chance of firing every time you attack; Defensive procs have a 10% chance of firing every time something attacks you.";
123:             $blob .= "\n\nProc info provided by Wolfbiter (RK1), Gatester (RK2)";
124: 
125:             $msg = $this->text->makeBlob("$profession LE Procs", $blob);
126:         }
127:         $sendto->reply($msg);
128:     }
129: 
130:     /**
131:      * This command handler shows Ofab armors and VP cost.
132:      *
133:      * @HandlesCommand("ofabarmor")
134:      * @Matches("/^ofabarmor$/i")
135:      */
136:     public function ofabarmorCommand($message, $channel, $sender, $sendto, $args) {
137:         $qls = $this->db->query("SELECT DISTINCT ql FROM ofabarmorcost ORDER BY ql ASC");
138:         $data = $this->db->query("SELECT `type`, `profession` FROM ofabarmortype ORDER BY profession ASC");
139: 
140:         $blob = '';
141:         forEach ($data as $row) {
142:             $blob .= "<pagebreak>{$row->profession} - Type {$row->type}\n";
143:             forEach ($qls as $row2) {
144:                 $ql_link = $this->text->makeChatcmd($row2->ql, "/tell <myname> ofabarmor {$row->profession} {$row2->ql}");
145:                 $blob .= "[{$ql_link}] ";
146:             }
147:             $blob .= "\n\n";
148:         }
149: 
150:         $msg = $this->text->makeBlob("Ofab Armor Bio-Material Types", $blob);
151:         $sendto->reply($msg);
152:     }
153: 
154:     /**
155:      * This command handler shows list of ofab armors available to a given profession.
156:      *
157:      * @HandlesCommand("ofabarmor")
158:      * @Matches("/^ofabarmor (.+) (\d+)$/i")
159:      * @Matches("/^ofabarmor (.+)$/i")
160:      */
161:     public function ofabarmorInfoCommand($message, $channel, $sender, $sendto, $args) {
162:         $ql = isset($args[2])? intval($args[2]): 300;
163: 
164:         $profession = $this->util->getProfessionName($args[1]);
165: 
166:         if ($profession == '') {
167:             $msg = "Please choose one of these professions: adv, agent, crat, doc, enf, eng, fix, keep, ma, mp, nt, sol, shade, or trader";
168:             $sendto->reply($msg);
169:             return;
170:         }
171: 
172:         $typelist = $this->db->query("SELECT type FROM ofabarmortype WHERE profession = ?", $profession);
173:         $type = $typelist[0]->type;
174: 
175:         $data = $this->db->query("SELECT * FROM ofabarmor o1 LEFT JOIN ofabarmorcost o2 ON o1.slot = o2.slot WHERE o1.profession = ? AND o2.ql = ? ORDER BY upgrade ASC, name ASC", $profession, $ql);
176:         if (count($data) == 0) {
177:             return false;
178:         }
179: 
180:         $blob = '';
181:         $typeLink = $this->text->makeChatcmd("Kyr'Ozch Bio-Material - Type {$type}", "/tell <myname> bioinfo {$type}");
182:         $typeQl = round(.8 * $ql);
183:         $blob .= "Upgrade with $typeLink (minimum QL {$typeQl})\n\n";
184: 
185:         $qls = $this->db->query("SELECT DISTINCT ql FROM ofabarmorcost ORDER BY ql ASC");
186:         forEach ($qls as $row2) {
187:             if ($row2->ql == $ql) {
188:                 $blob .= "[{$row2->ql}] ";
189:             } else {
190:                 $ql_link = $this->text->makeChatcmd($row2->ql, "/tell <myname> ofabarmor {$profession} {$row2->ql}");
191:                 $blob .= "[{$ql_link}] ";
192:             }
193:         }
194:         $blob .= "\n";
195: 
196:         $current_upgrade = $row->upgrade;
197:         forEach ($data as $row) {
198:             if ($current_upgrade != $row->upgrade) {
199:                 $current_upgrade = $row->upgrade;
200:                 $blob .= "\n";
201:             }
202:             $blob .=  $this->text->makeItem($row->lowid, $row->highid, $ql, $row->name);
203: 
204:             if ($row->upgrade == 0 || $row->upgrade == 3) {
205:                 $blob .= "  (<highlight>$row->vp<end> VP)";
206:                 $total_vp = $total_vp + $row->vp;
207:             }
208:             $blob .= "\n";
209:         }
210:         $blob .= "\nVP Cost for full set: <highlight>$total_vp<end>";
211: 
212:         $msg = $this->text->makeBlob("$profession Ofab Armor (QL $ql)", $blob);
213:         $sendto->reply($msg);
214:     }
215: 
216:     /**
217:      * This command handler shows Ofab weapons and VP cost.
218:      *
219:      * @HandlesCommand("ofabweapons")
220:      * @Matches("/^ofabweapons$/i")
221:      */
222:     public function ofabweaponsCommand($message, $channel, $sender, $sendto, $args) {
223:         $qls = $this->db->query("SELECT DISTINCT ql FROM ofabweaponscost ORDER BY ql ASC");
224:         $data = $this->db->query("SELECT `type`, `name` FROM ofabweapons ORDER BY name ASC");
225: 
226:         $blob = '';
227:         forEach ($data as $row) {
228:             $blob .= "<pagebreak>{$row->name} - Type {$row->type}\n";
229:             forEach ($qls as $row2) {
230:                 $ql_link = $this->text->makeChatcmd($row2->ql, "/tell <myname> ofabweapons {$row->name} {$row2->ql}");
231:                 $blob .= "[{$ql_link}] ";
232:             }
233:             $blob .= "\n\n";
234:         }
235: 
236:         $msg = $this->text->makeBlob("Ofab Weapons", $blob);
237:         $sendto->reply($msg);
238:     }
239: 
240:     /**
241:      * This command handler shows all six marks of the Ofab weapon.
242:      *
243:      * @HandlesCommand("ofabweapons")
244:      * @Matches("/^ofabweapons (\S+)$/i")
245:      * @Matches("/^ofabweapons (\S+) (\d+)$/i")
246:      */
247:     public function ofabweaponsInfoCommand($message, $channel, $sender, $sendto, $args) {
248:         $weapon = ucfirst($args[1]);
249:         $ql = isset($args[2])? intval($args[2]): 300;
250: 
251:         $row = $this->db->queryRow("SELECT `type`, `vp` FROM ofabweapons w, ofabweaponscost c WHERE w.name = ? AND c.ql = ?", $weapon, $ql);
252:         if ($row === null) {
253:             return false;
254:         }
255: 
256:         $blob = '';
257:         $typeQl = round(.8 * $ql);
258:         $typeLink = $this->text->makeChatcmd("Kyr'Ozch Bio-Material - Type {$row->type}", "/tell <myname> bioinfo {$row->type} {$typeQl}");
259:         $blob .= "Upgrade with $typeLink (minimum QL {$typeQl})\n\n";
260: 
261:         $qls = $this->db->query("SELECT DISTINCT ql FROM ofabweaponscost ORDER BY ql ASC");
262:         forEach ($qls as $row2) {
263:             if ($row2->ql == $ql) {
264:                 $blob .= "[{$row2->ql}] ";
265:             } else {
266:                 $ql_link = $this->text->makeChatcmd($row2->ql, "/tell <myname> ofabweapons {$weapon} {$row2->ql}");
267:                 $blob .= "[{$ql_link}] ";
268:             }
269:         }
270:         $blob .= "\n\n";
271: 
272:         for ($i = 1; $i <= 6; $i++) {
273:             $blob .=  $this->itemsController->getItem("Ofab {$weapon} Mk {$i}", $ql);
274:             if ($i == 1) {
275:                 $blob .= "  (<highlight>{$row->vp}<end> VP)";
276:             }
277:             $blob .= "\n";
278:         }
279: 
280:         $msg = $this->text->makeBlob("Ofab $weapon (QL $ql)", $blob);
281:         $sendto->reply($msg);
282:     }
283: 
284:     /**
285:      * This command handler shows info about Alien City Generals.
286:      *
287:      * @HandlesCommand("aigen")
288:      * @Matches("/^aigen (ankari|ilari|rimah|jaax|xoch|cha)$/i")
289:      */
290:     public function aigenCommand($message, $channel, $sender, $sendto, $args) {
291:         $gen = ucfirst(strtolower($args[1]));
292: 
293:         $blob = '';
294:         switch ($gen) {
295:             case "Ankari":
296:                 $blob .= "Low Evade/Dodge, Low AR, Casts Viral/Virral nukes\n\n";
297:                 $blob .= $this->itemsController->getItemAndIcon("Arithmetic Lead Viralbots") . "\n";
298:                 $blob .= "(Nanoskill / Tradeskill)\n\n";
299:                 $blob .= $this->itemsController->getItemAndIcon("Kyr'Ozch Bio-Material - Type 1") . "\n\n";
300:                 $blob .= $this->itemsController->getItemAndIcon("Kyr'Ozch Bio-Material - Type 2") . "\n\n";
301:                 $blob .= $this->itemsController->getItemAndIcon("Kyr'Ozch Bio-Material - Type 48");
302:                 break;
303:             case "Ilari":
304:                 $blob .= "Low Evade/Dodge\n\n";
305:                 $blob .= $this->itemsController->getItemAndIcon("Spiritual Lead Viralbots") . "\n";
306:                 $blob .= "(Nanocost / Nanopool / Max Nano)\n\n";
307:                 $blob .= $this->itemsController->getItemAndIcon("Kyr'Ozch Bio-Material - Type 992") . "\n\n";
308:                 $blob .= $this->itemsController->getItemAndIcon("Kyr'Ozch Bio-Material - Type 880");
309:                 break;
310:             case "Rimah":
311:                 $blob .= "Low Evade/Dodge\n\n";
312:                 $blob .= $this->itemsController->getItemAndIcon("Observant Lead Viralbots") . "\n";
313:                 $blob .= "(Init / Evades)\n\n";
314:                 $blob .= $this->itemsController->getItemAndIcon("Kyr'Ozch Bio-Material - Type 112") . "\n\n";
315:                 $blob .= $this->itemsController->getItemAndIcon("Kyr'Ozch Bio-Material - Type 240");
316:                 break;
317:             case "Jaax":
318:                 $blob .= "High Evade, Low Dodge\n\n";
319:                 $blob .= $this->itemsController->getItemAndIcon("Strong Lead Viralbots") . "\n";
320:                 $blob .= "(Melee / Spec Melee / Add All Def / Add Damage)\n\n";
321:                 $blob .= $this->itemsController->getItemAndIcon("Kyr'Ozch Bio-Material - Type 3") . "\n\n";
322:                 $blob .= $this->itemsController->getItemAndIcon("Kyr'Ozch Bio-Material - Type 4");
323:                 break;
324:             case "Xoch":
325:                 $blob .= "High Evade/Dodge, Casts Ilari Biorejuvenation heals\n\n";
326:                 $blob .= $this->itemsController->getItemAndIcon("Enduring Lead Viralbots") . "\n";
327:                 $blob .= "(Max Health / Body Dev)\n\n";
328:                 $blob .= $this->itemsController->getItemAndIcon("Kyr'Ozch Bio-Material - Type 5") . "\n\n";
329:                 $blob .= $this->itemsController->getItemAndIcon("Kyr'Ozch Bio-Material - Type 12");
330:                 break;
331:             case "Cha":
332:                 $blob .= "High Evade/NR, Low Dodge\n\n";
333:                 $blob .= $this->itemsController->getItemAndIcon("Supple Lead Viralbots") . "\n";
334:                 $blob .= "(Ranged / Spec Ranged / Add All Off)\n\n";
335:                 $blob .= $this->itemsController->getItemAndIcon("Kyr'Ozch Bio-Material - Type 13") . "\n\n";
336:                 $blob .= $this->itemsController->getItemAndIcon("Kyr'Ozch Bio-Material - Type 76");
337:                 break;
338:         }
339: 
340:         $msg = $this->text->makeBlob("General $gen", $blob);
341:         $sendto->reply($msg);
342:     }
343: }
344: 
Budabot 4 Docs API documentation generated by ApiGen