Advertisement
Guest User

Toby

a guest
May 18th, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.82 KB | None | 0 0
  1. $StoreGems = 1; //Store gems while deus mining?
  2. $CD::Publicdustcalc = 0; //Public dust calc for everyone to use. Example, someone says in zone or global 'dust from 145 to 174'
  3. $TellHouseData = 1; // Set this to 0 to keep House and RP private (for !myinfo)
  4. $TellBounty = 1; // Set this to 0 to keep Bounty private (for !myinfo)
  5.  
  6. //Don't touch these variables unless you know what you're doing.
  7. $itemamt = "none";
  8. $CD::lastamt = "0";
  9. $CD::Gem[1, Desc] = "Keldrinite";
  10. $CD::Gem[2, Desc] = "Diamond";
  11. $CD::Gem[3, Desc] = "Emerald";
  12. $CD::Gem[4, Desc] = "Silver";
  13. $CD::Gem[5, Desc] = "Gold";
  14. $CD::Gem[6, Desc] = "Titanium";
  15. $CD::Gem[7, Desc] = "Sapphire";
  16. $CD::Gem[8, Desc] = "Ruby";
  17. $CD::Gem[9, Desc] = "Topaz";
  18. $CD::Gem[10, Desc] = "Iron";
  19. $CD::Gem[11, Desc] = "Turquoise";
  20.  
  21. $CD::Gem[1, Price] = 20032;
  22. $CD::Gem[2, Price] = 2650;
  23. $CD::Gem[3, Price] = 1552;
  24. $CD::Gem[4, Price] = 664;
  25. $CD::Gem[5, Price] = 780;
  26. $CD::Gem[6, Price] = 1332;
  27. $CD::Gem[7, Price] = 468;
  28. $CD::Gem[8, Price] = 192;
  29. $CD::Gem[9, Price] = 256;
  30. $CD::Gem[10, Price] = 232;
  31. $CD::Gem[11, Price] = 136;
  32.  
  33. $CD::GemCount = 11;
  34. $StoreGems == 1
  35. //End no touch vars
  36.  
  37. Include("presto\\match.cs");
  38. Include("presto\\event.cs");
  39.  
  40. Event::Attach(eventClientMessage, CD::OnMessage);
  41. function CD::OnMessage(%client, %msg) {
  42. if(%client)
  43. $lastClientMessage = %client;
  44. else {
  45. if(%msg == "You say, \"!myinfozone\"") {
  46. CD::GetMyInfo("zone");
  47. }
  48. if(%msg == "You say, \"!myinfo\"") {
  49. CD::GetMyInfo("global");
  50. }
  51. if(%msg == "You say, \"!mycoins\"") {
  52. schedule("say(0, \"#global I have \" @ DeusRPG::FetchData(COINS) @ \" coins on hand and \"@ DeusRPG::FetchData(BANK) @ \" coins banked.\");", 1.0);
  53. }
  54. if($BuyAll == 1) { //For retreiving hundreds of items from your storage. Used in CD::BuyAll()
  55. %outofitem = Match::String(%msg, "You only have * of this item.");
  56. %numitem = Match::Result(0);
  57. if (%outofitem) {
  58. $itemamt = %numitem;
  59. }
  60. }
  61. if($Roll == 1) { // Used in the doroll() function
  62. %roll = Match::String(%msg, "*: *");
  63. %yourroll = Match::Result(0);
  64. %result = Match::Result(1);
  65. if (%roll) {
  66. if($rollnum != 1) {
  67. $RollResult[$rollnum] = %result;
  68. $rollnum++;
  69. } else {
  70. $rollnum = 1;
  71. $RollResult[1] = %result;
  72. $rollnum++;
  73. }
  74. }
  75. }
  76. if($MiningMove == 1) { //Keeps track fo the gems you've mined.
  77. %foundgem = Match::String(%msg, "You found *.");
  78. %gem = Match::Result(0);
  79. if (%foundgem) {
  80. if(String::findSubStr(%gem, "backpacks") == -1) {
  81. $CD::gem[Amt, %gem] = $CD::gem[Amt, %gem] + 1;
  82. }
  83. }
  84. }
  85. if($CD::publicdustcalc == 1) {
  86. %pubdustcalcy = Match::String(%msg, "You say, \"dust from * to *\"");
  87. if(%pubdustcalcy) {
  88. %person = Client::GetName(GetManagerID());
  89. %firstlvl = Match::Result(0);
  90. %secondlvl = Match::Result(1);
  91. Schedule("showdustreq("@%firstlvl@","@%secondlvl@",\"tell "@%person@",\");", 1.0);
  92. Schedule("$pubcalctimer = 0;", 4.0);
  93. }
  94. %pubdustcalc = Match::String(%msg, "[*] * \"dust from * to *\"");
  95. if(%pubdustcalc) {
  96. %person = Match::Result(1);
  97. %firstlvl = Match::Result(2);
  98. %secondlvl = Match::Result(3);
  99. Schedule("showdustreq("@%firstlvl@","@%secondlvl@",\"tell "@%person@",\");", 1.0);
  100. Schedule("$pubcalctimer = 0;", 4.0);
  101. }
  102. %pubdustcalcs = Match::String(%msg, "* says, \"dust from * to *\"");
  103. if(%pubdustcalcs) {
  104. %person = Match::Result(0);
  105. %firstlvl = Match::Result(1);
  106. %secondlvl = Match::Result(2);
  107. Schedule("showdustreq("@%firstlvl@","@%secondlvl@",\"tell "@%person@",\");", 1.0);
  108. Schedule("$pubcalctimer = 0;", 4.0);
  109. }
  110. %pubdustcalct = Match::String(%msg, "* tells you, \"dust from * to *\"");
  111. if(%pubdustcalct) {
  112. %person = Match::Result(0);
  113. %firstlvl = Match::Result(1);
  114. %secondlvl = Match::Result(2);
  115. Schedule("showdustreq("@%firstlvl@","@%secondlvl@",\"tell "@%person@",\");", 1.0);
  116. Schedule("$pubcalctimer = 0;", 4.0);
  117. }
  118. }
  119.  
  120. //I wish sounds worked on PCRPG
  121. //if(String::findSubStr(%msg, "You say, \"hi") != -1) {
  122. // schedule("remoteEval(2048, lmsg, hello);", 0);
  123. // }
  124. //if(String::findSubStr(%msg, "You say, \"buy") != -1) {
  125. // schedule("remoteEval(2048, lmsg, bye);", 0);
  126. // }
  127. //if(String::findSubStr(%msg, "You say, \"yes") != -1) {
  128. // schedule("remoteEval(2048, lmsg, yes);", 0);
  129. // }
  130.  
  131. %gotbash = Match::String(%msg, "You were bashed by * for * points of damage!");
  132. %gotbashed = Match::Result(0);
  133. %gotbashdmg = Match::Result(1);
  134. if(%gotbash) {
  135.  
  136. remoteeval(2048, "PlayAnim", 0); //Wave your arms around
  137.  
  138. if($ConfigLoaded == 1) { //Only do this if you have taurik script pack.
  139. if($RPGStatsLoaded[Client::GetName(GetManagerID())] != 1) {
  140. %RPGStatsScript = "afkmodule_stats-" @ Client::GetName(GetManagerID()) @ ".cs";
  141. exec(%RPGStatsScript);
  142. // Reset loaded flag on all configs.
  143. // If a player changes names without quitting tribes (which removes the $RPGStatsLoaded tag)
  144. // the next players stats will be loaded overtop of the first one. If the
  145. // player then switches back to the original name it will not reload the config because the
  146. // $RpgStatsLoaded flag is already set for that player.
  147. deleteVariables("$RPGStatsLoaded*");
  148. // Set this player as loaded.
  149. $RPGStatsLoaded[Client::GetName(GetManagerID())] = 1;
  150. }
  151.  
  152. $RPGPlayerStats::LastgotBashed = %gotbashed;
  153. $RPGPlayerStats::gotBashedFor = %gotbashdmg;
  154. $RPGPlayerStats::GotBashes++;
  155. export("$RPGPlayerStats::*", "config\\afkmodule_stats-" @ Client::GetName(GetManagerID()) @ ".cs", False);
  156. }
  157. }
  158. }
  159. }
  160. function String::replace(%string, %search, %replace) //Not mine, found it on some tribes scripting tutorial site.
  161. {
  162. %loc = String::findSubStr(%string, %search);
  163. for(%loc; %loc != -1; %i++)
  164. {
  165. %lenstr = String::len(%string);
  166. %lenser = String::len(%search);
  167. %part1 = String::getSubStr(%string, 0, %loc - 1);
  168. %part2 = String::getSubStr(%string, %loc + %lenser, %lenstr - %loc - %lenser);
  169. %string = %part1 @ " " @ %replace @ %part2;
  170. %loc = String::findSubStr(%string, %search);
  171. }
  172. return %string;
  173. }
  174.  
  175. // For autostoring gems while mining. Needs hooks into DeusSkillTraining.cs to work.
  176. // The examples show the code surrounding the changes so you know what it should look like.
  177. // To Install:
  178. // 1. Open Tribes\Config\DeusRpgPack\DeusSkillTraining.cs
  179. // 2. Search for this line: "if(%opt == "old")"
  180. // 3. Right above that line put if($StoreGems == 1) CD::StoreGems();
  181. //
  182. // Example: $MiningMove = 1;
  183. // $Xin_::MineWatch = 0;
  184. // $Xin_::MoveCount = 0;
  185. // if($StoreGems == 1) CD::StoreGems();
  186. // if(%opt == "old")
  187. // Mining::Movement();
  188. // else
  189. // Xin_::AutoMine();
  190. //
  191. // 4. Search for this line: "Client::centerPrint("<jc><f0>Auto Mining <f1>stopped", 1)"
  192. // 5. Right above that line put: CD::StoreGemsStop();
  193. //
  194. // Example: Schedule("DeusRPG::StopMoving();", 6);
  195. // Schedule::Cancel(MineMover);
  196. // postAction(2048, IDACTION_BREAK1, 1);
  197. // CD::StoreGemsStop();
  198. // Client::centerPrint("<jc><f0>Auto Mining <f1>stopped", 1);
  199. // Schedule("Client::centerPrint(\"\", 1);", 4);
  200. //
  201. // 6. Make sure $StoreGems == 1; at the top of this script. Save the file.
  202. //
  203.  
  204. function CD::StoreGems() {
  205. if($minestatusloaded != 1) {
  206. %CDAFKMineScript = "afk_minestatus-" @ Client::GetName(GetManagerID()) @ ".cs";
  207. exec(%CDAFKMineScript);
  208. $minestatusloaded = 1;
  209. }
  210. if($MiningMove == 1) {
  211. %i = 1;
  212. if(getItemCount("Keldrinite")) { schedule::Add("CD::Store(\"Keldrinite\");", %i); %i++; }
  213. if(getItemCount("Diamond")) { schedule::Add("CD::Store(\"Diamond\");", %i); %i++; }
  214. if(getItemCount("Emerald")) { schedule::Add("CD::Store(\"Emerald\");", %i); %i++;}
  215. if(getItemCount("Silver")) { schedule::Add("CD::Store(\"Silver\");", %i); %i++; }
  216. if(getItemCount("Gold")) { schedule::Add("CD::Store(\"Gold\");", %i); %i++; }
  217. if(getItemCount("Titanium")) { schedule::Add("CD::Store(\"Titanium\");", %i); %i++; }
  218. if(getItemCount("Sapphire")) { schedule::Add("CD::Store(\"Sapphire\");", %i); %i++; }
  219. if(getItemCount("Ruby")) { schedule::Add("CD::Store(\"Ruby\");", %i); %i++; }
  220. if(getItemCount("Topaz")) { schedule::Add("CD::Store(\"Topaz\");", %i); %i++; }
  221. if(getItemCount("Iron")) { schedule::Add("CD::Store(\"Iron\");", %i); %i++; }
  222. if(getItemCount("Turquoise")) { schedule::Add("CD::Store(\"Turquoise\");", %i); %i++; }
  223. Schedule::Add("say(0, \"#savecharacter\");", 115, SaveCharacter);
  224. Schedule::Add("CD::StoreGems();", 120, StoreGems);
  225. export("$CD::gemAmt*", "config\\afk_minestatus-" @ Client::GetName(GetManagerID()) @ ".cs", False);
  226. }
  227. }
  228. //Sweet OSD that shows what you have mined and put in storage.
  229. function showtotalgems(%var) {
  230. if (%var == "reset") {
  231. for(%i = 1; %i <= $CD::GemCount; %i++) {
  232. $CD::gem[Amt, $CD::Gem[%i, Desc]] = 0;
  233. }
  234. $CD::gem[Amt, "reset"] = CD::currenttime();
  235. export("$CD::gemAmt*", "config\\afk_minestatus-" @ Client::GetName(GetManagerID()) @ ".cs", False);
  236. }
  237. if (%var == "close") {
  238. Schedule("Client::centerPrint(\"\", 0.1);", 0.1);
  239. Schedule::Cancel(showtotalgems);
  240. }
  241. if (%var == "") {
  242. if ($CD::gemresettime == false || $CD::gem[Amt, "reset"] == "") {
  243. %totaltext = "<f1>Total gems mined since last reset:<n>";
  244. } else {
  245. %totaltext = "<f1>Total gems mined since "@$CD::gem[Amt, "reset"]@":<n>";
  246. }
  247. for(%i = 1; %i <= $CD::GemCount; %i++) {
  248. %price = $CD::Gem[%i, Price];
  249. %count = $CD::gem[Amt, $CD::Gem[%i, Desc]];
  250. %totalcoins = %totalcoins + (%count * %price);
  251. %totaltext = ""@ %totaltext @" <f3>"@$CD::Gem[%i, Desc] @":<f2> " @ $CD::gem[Amt, $CD::Gem[%i, Desc]]@"<n>";
  252. }
  253. %totaltext = ""@ %totaltext @" <n>";
  254. %totaltext = ""@ %totaltext @"Total: <f2>"@%totalcoins@" coins.";
  255. Client::centerPrint("<jc><f2>"@%totaltext@"", 1);
  256. Schedule::Add("showtotalgems();", 5, showtotalgems);
  257. }
  258. }
  259. function CD::StoreGemsStop() {
  260. Schedule::Cancel(SaveCharacter);
  261. Schedule::Cancel(StoreGems);
  262. $RPGPlayerName = Client::GetName(GetManagerID());
  263. export("$CD::gemAmt*", "config\\afk_minestatus-" @ Client::GetName(GetManagerID()) @ ".cs", False);
  264. $minestatusloaded = 0;
  265. }
  266.  
  267. //Retreives all of an item from your storage. If you tell it to remove topa instead of topaz it will go and keep erroring.
  268. function CD::BuyAll($CD::BItem) {
  269. $BuyAll = 1; //Enables watching for the "You only have X of this item." message
  270. if($itemamt != "none") { //If you hit this then you must have less than 100 of the item.
  271. say(0, $itemamt);
  272. $itemamt = "none"; //Change back to none because this is done running.
  273. %nosched = 1;
  274. } else {
  275. say(0, "100");
  276. }
  277. buy($CD::BItem);
  278.  
  279. if($CD::lastamt != 0) { //Second+ loop
  280. if(getitemcount($CD::bitem) > $CD::lastamt) { //Make sure your count now is higher than last time so you know to continue retreiving.
  281. $CD::lastamt = getitemcount($CD::bitem);
  282. schedule::Add("$BuyAll = 0;", 0.5); // Turn off message watching.
  283. if(%nosched != 1) schedule::Add("CD::BuyAll($CD::BItem);", 1.2, CDBuyAll); //Run again.
  284. } else {
  285. schedule::Add("$BuyAll = 0;", 0.2); // Turn off message watching.
  286. schedule::Add("$CD::lastamt = 0;", 0.3); // Reset $CD::lastamt
  287. schedule::Add("$CD::BItem = \"\";", 0.4); //Reset the item var
  288. //DONE
  289. }
  290. } else { //Goes here on the first time run.
  291. $CD::lastamt = getitemcount($CD::bitem);
  292. schedule::Add("$BuyAll = 0;", 0.5); // Turn off message watching.
  293. if(%nosched != 1) schedule::Add("CD::BuyAll($CD::BItem);", 1.2, CDBuyAll); //Run again.
  294. }
  295. }
  296.  
  297. //Returns the item number of an equipped item.
  298. function CD::ItemNumEquip(%item) {
  299. %type = getItemType(%item);
  300. return %type + 1;
  301. }
  302.  
  303.  
  304. function doroll(%die) {
  305.  
  306. //Rolls a dice
  307. //Returns $RollResult[number]
  308. //Example: doroll("1d6");
  309. //This will roll a 6 sided die one time.
  310.  
  311. $RollResult = 0;
  312. $Roll = 1;
  313. say(0, "#roll " @%die);
  314. schedule("$Roll = 0;", 0.5);
  315. }
  316.  
  317. //Stores up to 100 of an item in one pass.
  318. function CD::Store(%item) {
  319. say(0, getItemCount(%item));
  320. sell(%item);
  321. }
  322.  
  323. //Sells all of the item you specify as fast as possible.
  324. function CD::SellAll($CD::SItem) {
  325. if(getItemCount($CD::SItem)) {
  326. say(0, getItemCount($CD::SItem));
  327. sell($CD::SItem);
  328. }
  329. if(getItemCount($CD::SItem)) schedule::Add("CD::SellAll($CD::SItem);", 1, CDsellall);
  330. }
  331.  
  332. //Drops the item until you have none.
  333. function CD::dropall($CD::dropitem) {
  334. if(getItemCount($CD::dropitem)) {
  335. drop($CD::dropitem);
  336. }
  337. if(getitemcount($CD::dropitem)) schedule::Add("CD::dropall($CD::dropitem);", 1, CDdropitem);
  338. }
  339.  
  340. function bashstats (%say) {
  341. if($RPGStatsLoaded != 1) {
  342. %RPGStatsScript = "afkmodule_stats-" @ Client::GetName(GetManagerID()) @ ".cs";
  343. exec(%RPGStatsScript);
  344. $RPGStatsLoaded = 1;
  345. }
  346.  
  347. say(0, "#"@%say@" Bash Stats: I last got bashed by "@$RPGPlayerStats::LastgotBashed@" for "@$RPGPlayerStats::gotBashedFor@" dmg. Total times bashed: "@$RPGPlayerStats::GotBashes@". I last bashed "@$RPGPlayerStats::LastBashed@" for "@$RPGPlayerStats::BashedFor@" dmg. Total bashes: "@$RPGPlayerStats::Bashes@"");
  348. }
  349.  
  350. //Fix me
  351. //Works but could be better.
  352. function CD::buyparchment() {
  353. //Make sure you are talking to thorin or it wont stop until you have less than 1mil coins.
  354. if(DeusRPG::FetchData(COINS) >= 1e6) {
  355. schedule("say(0, \"hi\");", 0.4);
  356. schedule("say(0, \"yes\");", 1.4);
  357. }
  358. if(DeusRPG::FetchData(COINS) >= 1e6) schedule::Add("CD::buyparchment();", 2.2, CDbuyparchment);
  359. }
  360. //Fix me
  361. //Works but could be better.
  362. function CD::buydust() {
  363. if(getItemCount("Parchment")) {
  364. schedule("say(0, \"hi\");", 0.4);
  365. schedule("say(0, \"yes\");", 1.4);
  366. }
  367. if(getItemCount("Parchment")) schedule::Add("CD::buydust();", 2.2, CDbuydust);
  368. }
  369. //Fix me
  370. //Works but could be better.
  371. function CD::usedust() {
  372. if(getItemCount("Magic Dust")) {
  373. schedule("say(0, \"hi\");", 0.4);
  374. schedule("say(0, \"yes\");", 1.4);
  375. }
  376. if(getItemCount("Magic Dust")) schedule::Add("CD::usedust();", 2.2, CDusedust);
  377. }
  378. //Fix me.
  379. //Works but could be better.
  380. function CD::withdraw(%amount) {
  381. schedule("say(0, \"hi\");", 0.4);
  382. schedule("say(0, \"withdraw\");", 1.4);
  383. schedule("say(0, \""@%amount@"\");", 2.4);
  384. }
  385.  
  386. function showdustreq(%startlvl,%endlvl,%say) {
  387. if(%say == ""){
  388. %say = "say";
  389. }
  390.  
  391. %startlvl = floor(%startlvl);
  392. %endlvl = floor(%endlvl);
  393. if(%startlvl < 0) %startlvl = 0;
  394. if(%endlvl < 0) %endlvl = 0;
  395.  
  396. %startexp = (%startlvl - 1 ) * (200 + 50 * ((%startlvl - 1) - 1));
  397. %endexp = (%endlvl - 1) * (200 + 50 * ((%endlvl -1) - 1));
  398. %expdiff = %endexp - %startexp;
  399.  
  400. %DustNeed = round(%expdiff / 4625);
  401.  
  402. say(0, "#" @%say@ " From level " @ %startlvl @ " to level " @ %endLvl @ " is " @ %DustNeed @ " dusts. (" @ %expdiff @ " exp)");
  403. }
  404.  
  405. function targetcalc(%lvl,%say) { //Arguments are optional. If none are specified then it will use your level and #say the results.
  406.  
  407. //This uses the PCRPG values.
  408. //This is only functional when you use the higher of the two levels. Ex. You are lvl 30 and you want to see if you can target a lvl 50.
  409. //Do targetcalc(50); instead of 30 (your level) to do it. If you are the lvl 50 wanting to target a lvl 30 then you use targetcalc(50);
  410.  
  411. if(%lvl == ""){
  412. %lvl = DeusRPG::FetchData(LVL);
  413. }
  414. if(%say == ""){
  415. %say = "say";
  416. }
  417.  
  418. %tgtpercent = 34.5/100;
  419. %lvldifference = %tgtpercent * %lvl;
  420. %tgtmin = round(%lvl - %lvldifference);
  421. %tgtmax = round(%lvldifference + %lvl);
  422. say(0, "#" @%say@ " A level " @%lvl@ " can target people from LVL " @%tgtmin@ " to LVL " @%tgtmax@ ".");
  423. }
  424. //Need to echo() twice for it to return something.
  425. function sellcost(%item) {
  426. %cost = DeusRPG::FetchData("getsellcost " @ %item);
  427. return %cost;
  428. }
  429. //Need to echo() twice for it to return something.
  430. function buycost(%item) {
  431. %cost = DeusRPG::FetchData("getbuycost " @ %item);
  432. return %cost;
  433. }
  434. function CD::currenttime() {
  435. return timestamp();
  436. }
  437. function CD::cancelall() {
  438. schedule::cancel(CDbuyall);
  439. schedule::cancel(CDsellall);
  440. schedule::cancel(CDbuyparchment);
  441. schedule::cancel(CDbuydust);
  442. schedule::cancel(CDusedust);
  443. schedule::cancel(CDcreatepack);
  444. schedule::cancel(CDdropitem);
  445. }
  446. function CD::GetMyInfo(%say) {
  447. //Update all the deus player variables.
  448. DeusRPG::FetchData("HP");
  449. DeusRPG::FetchData("MaxHP");
  450. DeusRPG::FetchData("MANA");
  451. DeusRPG::FetchData("MaxMANA");
  452. DeusRPG::FetchData("CLASS");
  453. DeusRPG::FetchData("RemortStep");
  454. DeusRPG::FetchData("zonedesc");
  455. DeusRPG::FetchData("SPcredits");
  456. DeusRPG::FetchData("LCK");
  457. DeusRPG::FetchData("LVL");
  458. DeusRPG::FetchData("RankPoints");
  459. DeusRPG::FetchData("bounty");
  460. DeusRPG::FetchData("MyHouse");
  461.  
  462. schedule("CD::ShowMyInfo(\""@%say@"\");", 1.0);
  463. }
  464.  
  465. function CD::ShowMyInfo(%say) {
  466.  
  467. // Modified Tauriks Myinfo function
  468. // Original at www.linneberg.com
  469. //
  470. // It was pretty much rewritten by me to use local variables and have the code easier to read.
  471. // This one REQUIRES Deus pack
  472. //
  473.  
  474. //Preset all the data
  475. %MyHP = $rpgdata["HP"];
  476. %MyMaxHP = $rpgdata["MaxHP"];
  477. %MyMANA = $rpgdata["MANA"];
  478. %MyMaxMANA = $rpgdata["MaxMANA"];
  479. %MyClass = $rpgdata["CLASS"];
  480. %MyRemort = $rpgdata["RemortStep"];
  481. %MyZone = $rpgdata["zonedesc"];
  482. %MySP = $rpgdata["SPcredits"];
  483. %MyLCK = $rpgdata["LCK"];
  484. %MyLVL = $rpgdata["LVL"];
  485. %MyRank = $rpgdata["RankPoints"];
  486. %MyBounty = $rpgdata["bounty"];
  487. %MyHouse = $rpgdata["MyHouse"];
  488. %RLRoman = Roman(%MyRemort);
  489.  
  490. //If you have tauriks scripts then you can show your bash and spells casted
  491. if ($ConfigLoaded == 1) {
  492. %RPGStatsScript = "afkmodule_stats-" @ Client::GetName(GetManagerID()) @ ".cs";
  493. if (Client::GetName(GetManagerID()) != "") {
  494. exec(%RPGStatsScript);
  495. }
  496.  
  497. %BashMessage = "";
  498. if ($RPGPlayerStats::LastBashed == "" && $RPGPlayerStats::BashedFor == "") {
  499. // Sigh.
  500. } else {
  501. %BashMessage = "I've bashed " @ $RPGPlayerStats::Bashes @ " times. I last bashed " @ $RPGPlayerStats::LastBashed @ " for " @ $RPGPlayerStats::BashedFor @ ".";
  502. }
  503.  
  504. %SpellsMessage = "";
  505. if ($RPGPlayerStats::SpellsCasted == "") {
  506. //Double sigh?
  507. } else {
  508. %SpellsMessage = "Spells Casted: " @$RPGPlayerStats::SpellsCasted@ ".";
  509. }
  510. }
  511.  
  512. %HouseMessage = "";
  513. %BountyMessage = "";
  514. %housestuff = Match::String(%MyHouse, "House *");
  515. %housename = Match::Result(0);
  516. if(%housestuff && $TellHouseData == "1") { %HouseMessage = "House: "@%housename@" RP: "@%MyRank@"."; }
  517.  
  518. if($TellBounty = "1") { %BountyMessage = "Bounty: "@%MyBounty@"."; }
  519.  
  520. if (%MyRemort == 0) {
  521. %RemortName = %MyClass;
  522. }
  523.  
  524. if (%MyRemort == 1) {
  525. if (%MyClass == "Cleric") {
  526. %RemortName = "Bishop"; }
  527. else if (%MyClass == "Druid") {
  528. %RemortName = "Archdruid"; }
  529. else if (%MyClass == "Theif") {
  530. %RemortName = "Bandit"; }
  531. else if (%MyClass == "Bard") {
  532. %RemortName = "Lyricist"; }
  533. else if (%MyClass == "Fighter") {
  534. %RemortName = "Berzerker"; }
  535. else if (%MyClass == "Paladin") {
  536. %RemortName = "Avenger"; }
  537. else if (%MyClass == "Ranger") {
  538. %RemortName = "Woodsman"; }
  539. else if (%MyClass == "Mage") {
  540. %RemortName = "Archmage"; }
  541. }
  542.  
  543. if (%MyRemort == 2) {
  544. if (%MyClass == "Cleric") {
  545. %RemortName = "Saint"; }
  546. else if (%MyClass == "Druid") {
  547. %RemortName = "Mystic"; }
  548. else if (%MyClass == "Theif") {
  549. %RemortName = "Outlaw"; }
  550. else if (%MyClass == "Bard") {
  551. %RemortName = "Musician"; }
  552. else if (%MyClass == "Fighter") {
  553. %RemortName = "Knight"; }
  554. else if (%MyClass == "Paladin") {
  555. %RemortName = "Centurian"; }
  556. else if (%MyClass == "Ranger") {
  557. %RemortName = "Marksman"; }
  558. else if (%MyClass == "Mage") {
  559. %RemortName = "Sorcerer"; }
  560. }
  561.  
  562. if (%MyRemort == 3) {
  563. if (%MyClass == "Cleric") {
  564. %RemortName = "Pope"; }
  565. else if (%MyClass == "Druid") {
  566. %RemortName = "Head Mystic"; }
  567. else if (%MyClass == "Theif") {
  568. %RemortName = "Klepto"; }
  569. else if (%MyClass == "Bard") {
  570. %RemortName = "Producer"; }
  571. else if (%MyClass == "Fighter") {
  572. %RemortName = "Guardian"; }
  573. else if (%MyClass == "Paladin") {
  574. %RemortName = "Centurian"; }
  575. else if (%MyClass == "Ranger") {
  576. %RemortName = "Archer"; }
  577. else if (%MyClass == "Mage") {
  578. %RemortName = "Wizard"; }
  579. }
  580.  
  581. if (%MyRemort >= 4) {
  582. if (%MyClass == "Cleric") {
  583. %RemortName = "Pope"; }
  584. else if (%MyClass == "Druid") {
  585. %RemortName = "Head Mystic"; }
  586. else if (%MyClass == "Theif") {
  587. %RemortName = "Klepto"; }
  588. else if (%MyClass == "Bard") {
  589. %RemortName = "Artiste"; }
  590. else if (%MyClass == "Fighter") {
  591. %RemortName = "Guardian"; }
  592. else if (%MyClass == "Paladin") {
  593. %RemortName = "Crusader"; }
  594. else if (%MyClass == "Ranger") {
  595. %RemortName = "Archer"; }
  596. else if (%MyClass == "Mage") {
  597. %RemortName = "Wizard"; }
  598. }
  599.  
  600. if (%MyRemort == 99) {
  601. if (%MyClass == "Cleric") {
  602. %RemortName = "Master Clerian"; }
  603. else if (%MyClass == "Druid") {
  604. %RemortName = "Druidian Leader"; }
  605. else if (%MyClass == "Theif") {
  606. %RemortName = "Elder Thief"; }
  607. else if (%MyClass == "Bard") {
  608. %RemortName = "Seasoned Rogue"; }
  609. else if (%MyClass == "Fighter") {
  610. %RemortName = "Swordsman Elite"; }
  611. else if (%MyClass == "Paladin") {
  612. %RemortName = "Holy Crusader"; }
  613. else if (%MyClass == "Ranger") {
  614. %RemortName = "High Archer"; }
  615. else if (%MyClass == "Mage") {
  616. %RemortName = "Master of Magic"; }
  617. }
  618.  
  619. if (%MyRemort >= 100) {
  620. %RemortName = "God";
  621. }
  622.  
  623. if (%MyRemort < 99) { %RemortFinal = %RemortName@%RLRoman; }
  624. if (%MyRemort == 99 || %MyRemort == 100) { %RemortFinal = %RemortName; }
  625. if (%MyRemort > 100) { %RemortFinal = %RemortName@%RLRoman; }
  626. if (%MyRemort <= 99) { %HPFinal = %MyHP@"/"@%MyMaxHP; %ManaFinal = %MyMANA@"/"@%MyMaxMANA; } else { %HPFinal = %MyMaxHP; %ManaFinal = %MyMANA; }
  627.  
  628. //Shorten your zone name
  629. if (%MyZone == -1) { %Myzone = "the unknown"; }
  630. else if (%MyZone == "Minotaur's Lair") { %Myzone = "Mino's"; }
  631. else if (%MyZone == "Jaten Outpost") { %Myzone = "Jaten"; }
  632. else if (%MyZone == "Keldrin Town") { %Myzone = "K-Town"; }
  633. else if (%MyZone == "Uber Zone") { %Myzone = "Ubers"; }
  634. else if (%MyZone == "Stronghold Yolanda") { %Myzone = "Yolanda"; }
  635. else if (%MyZone == "Fort Ethren") { %Myzone = "Ethren"; }
  636. else if (%MyZone == "Keldrin Mine") { %Myzone = "the Mines"; }
  637. else if (%MyZone == "Delkin Port") { %Myzone = "Delkin"; }
  638. else if (%MyZone == "Centuria Highhold") { %Myzone = "Centuria"; }
  639. else if (%MyZone == "Traveller's Den") { %Myzone = "Trav's"; }
  640. else if (%MyZone == "Ancient Crypt") { %Myzone = "the Crypt"; }
  641. else if (%MyZone == "Gran'Kar Ruins") { %Myzone = "the Ruins"; }
  642. else if (%MyZone == "water") { %Myzone = "the water"; }
  643.  
  644. schedule("say(0, \"#"@%say@" I am a Level "@%MyLVL@" "@%RemortFinal@" in "@%Myzone@", with "@%MyLCK@" LCK, "@%MySP@" SP, "@%HPFinal@" HP and "@%ManaFinal@" Mana. "@%BashMessage@" "@%HouseMessage@" EXP TNL: "@$DeusRPGHud::expneeded@". "@%SpellsMessage@" "@%BountyMessage@"\");", 1.0);
  645.  
  646. }
  647.  
  648. //Cowboys awesome conversion
  649. //http://www.cowboyscripts.org
  650. function Roman(%number) {
  651. %roman = "";
  652. while (%number >= 1000) {
  653. %roman = %roman @ "M";
  654. %number = %number - 1000;
  655. }
  656. if (%number >= 900) {
  657. %roman = %roman @ "CM";
  658. %number = %number - 900;
  659. }
  660. if (%number >= 500) {
  661. %roman = %roman @ "D";
  662. %number = %number - 500;
  663. }
  664. if (%number >= 400) {
  665. %roman = %roman @ "CD";
  666. %number = %number - 400;
  667. }
  668. while (%number >= 100) {
  669. %roman = %roman @ "C";
  670. %number = %number - 100;
  671. }
  672. if (%number >= 90) {
  673. %roman = %roman @ "XC";
  674. %number = %number - 90;
  675. }
  676. if (%number >= 50) {
  677. %roman = %roman @ "L";
  678. %number = %number - 50;
  679. }
  680. if (%number >= 40) {
  681. %roman = %roman @ "XL";
  682. %number = %number - 40;
  683. }
  684. while (%number >= 10) {
  685. %roman = %roman @ "X";
  686. %number = %number - 10;
  687. }
  688. if (%number >= 9) {
  689. %roman = %roman @ "IX";
  690. %number = %number - 9;
  691. }
  692. if (%number >= 5) {
  693. %roman = %roman @ "V";
  694. %number = %number - 5;
  695. }
  696. if (%number >= 4) {
  697. %roman = %roman @ "IV";
  698. %number = %number - 4;
  699. }
  700. while (%number >= 1) {
  701. %roman = %roman @ "I";
  702. %number = %number - 1;
  703. }
  704. return %roman;
  705. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement