1: <?php
2:
3: namespace Budabot\User\Modules;
4:
5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41:
42: class AlienMiscController {
43:
44: 45: 46: 47:
48: public $moduleName;
49:
50:
51: public $db;
52:
53:
54: public $text;
55:
56:
57: public $util;
58:
59:
60: public $itemsController;
61:
62:
63: public $logger;
64:
65: 66: 67:
68: public function setup() {
69:
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: 77: 78: 79: 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: 97: 98: 99: 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: 132: 133: 134: 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: 156: 157: 158: 159: 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: 218: 219: 220: 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: 242: 243: 244: 245: 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: 286: 287: 288: 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: