Advertisement
AlferZep

fight interaction

May 5th, 2024 (edited)
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 40.44 KB | None | 0 0
  1. $nomention
  2. $onlyIf[$and[$checkContains[$customID;$authorID]==true;$checkContains[$customID;fight;dummy-exit]==true]==true;]
  3.  
  4. $var[user;$authorID]
  5.  
  6. $var[shop;$getVar[data.shop]]
  7. $var[ability;$getVar[data.ability]]
  8.  
  9. $jsonParse[
  10. {
  11. "level":$getVar[level;$authorID],
  12. "element":$getVar[element;$var[user]],
  13. "profile":$getVar[profile;$var[user]],
  14. "fight":$getVar[fight;$authorID],
  15. "hp":$getVar[hp;$authorID],
  16. "ability":$var[ability],
  17. "floor":$getVar[floor;$authorID],
  18. "stats":$getVar[stats;$authorID],
  19. "guide":$getVar[guide;$authorID],
  20. "floordata":$getVar[data.floor],
  21. "mp":$getVar[mp;$authorID],
  22. "story":$getVar[story;$authorID],
  23. "inv":$getVar[inventory;$authorID],
  24. "shop":$var[shop],
  25. "game":$getVar[profile;$botID]
  26. }
  27. ]
  28.  
  29. $if[$json[profile;version]==$json[game;version]]
  30.  
  31. $onlyIf[$json[fight;name]!=;]
  32.  
  33. $try
  34.  
  35. $if[$json[ability;$json[profile;element;name]]!=]
  36. $var[element;$json[profile;element;name]]
  37. $else
  38. $var[element;none]
  39. $endif
  40.  
  41. $var[floor;$json[floordata;$sub[$json[floor;current];1]]]
  42.  
  43. $if[$or[$customID==fight $authorID;$customID==fight brace $authorID;$customID==fight scene skip $authorID;$customID==fight melee $authorID;$customID==fight item-use $authorID]==true]
  44.  
  45. $removeComponent[fight item-use $authorID]
  46.  
  47. $textSplit[$customID; ]
  48. $var[cmd;$splitText[2]]
  49.  
  50. $jsonParse[
  51. {
  52. "level":$getVar[level;$authorID],
  53. "element":$getVar[element;$var[user]],
  54. "profile":$getVar[profile;$var[user]],
  55. "fight":$getVar[fight;$authorID],
  56. "skill1":$json[ability;$var[element];1],
  57. "skill2":$json[ability;$var[element];2],
  58. "skill3":$json[ability;$var[element];3],
  59. "devskill1":$json[ability;dev;1],
  60. "hp":$getVar[hp;$authorID],
  61. "ability":$json[ability],
  62. $if[$message!=]"skill":$message,$elseif[$customID==fight melee $authorID]"skill":{"skill.type":"melee"},$endif
  63. "floor":$var[floor],
  64. "stats":$getVar[stats;$authorID],
  65. "guide":$json[guide],
  66. "story":$json[story],
  67. "equipment":$getVar[equipment;$authorID],
  68. "inv":$json[inv],
  69. "shop":$json[shop]
  70. }
  71. ]
  72.  
  73. $jsonParse[
  74. {
  75. "level":$getVar[level;$authorID],
  76. "element":$getVar[element;$var[user]],
  77. "profile":$getVar[profile;$var[user]],
  78. "fight":$getVar[fight;$authorID],
  79. "skill1":$json[skill1],
  80. "skill2":$json[skill2],
  81. "skill3":$json[skill3],
  82. "devskill1":$json[devskill1],
  83. "hp":$getVar[hp;$authorID],
  84. "ability":$json[ability],
  85. $if[$json[skill;skill.type]==dev]"skill":$json[ability;dev;$json[skill;skill.id]],$elseif[$json[skill;skill.type]==melee]"skill":{"name":"$json[equipment;melee;name]","type":"dmg","dmg":$json[equipment;melee;dmg],"lv":0,"-mp":0,"acc":99999,"melee":true},$elseif[$json[skill;skill.type]!=]"skill":$json[ability;$var[element];$json[skill;skill.id]],$elseif[$customID==fight item-use $authorID]"skill":{"name":"$json[shop;$json[skill;item.type];$json[skill;item.id];name]","type":"$json[shop;$json[skill;item.type];$json[skill;item.id];type]","int":"$json[shop;$json[skill;item.type];$json[skill;item.id];int]","dmg":0,"lv":0,"-mp":0,"acc":999999},$elseif[$message!=]"skill":$json[skill],$else"skill":{"name":"nothing","type":"dmg","dmg":0,"lv":0,"-mp":0,"acc":100},$endif
  86. $if[$json[skill;skill.type]==dev]"skillName":"$json[ability;dev;$json[skill;skill.id];name]",$elseif[$json[skill;skill.id]!=]"skillName":"$json[ability;$var[element];$json[skill;skill.id];name]",$elseif[$json[skill;skill.type]==melee]"skillName":"$json[equipment;melee;name]",$elseif[$customID==fight item-use $authorID]"skillName":"$json[shop;$json[skill;item.type];$json[skill;item.id];name]",$elseif[$message!=]"skillName":"$json[skill;name]",$else"skillName":"none",$endif
  87. "link":$getVar[data.mobs],
  88. "floor":$var[floor],
  89. "stats":$getVar[stats;$authorID],
  90. "avatar":"$getVar[fightAvatar;$authorID]",
  91. "guide":$json[guide],
  92. "assets":$getVar[assets],
  93. "mp":$getVar[mp;$authorID],
  94. "story":$json[story],
  95. "equipment":$json[equipment],
  96. "inv":$json[inv]
  97. }
  98. ]
  99.  
  100. $var[cd;$json[fight;cd]]
  101. $enableDecimals[yes]
  102.  
  103. $var[hp;$json[hp;min]]
  104. $enableDecimals[no]
  105.  
  106. $if[$json[skill;melee]!=true]
  107. $var[dmg;$min[$sub[$multi[$random[$divide[$multi[$json[skill;dmg];$json[element;level]];2];$sum[$multi[$json[skill;dmg];$json[element;level]];1]];$json[stats;-dmg]];$random[$divide[$json[fight;def];2];$json[fight;def]]];$json[fight;hp]]]
  108. $else
  109. $var[dmg;$min[$random[$divide[$json[skill;dmg];2];$sum[$json[skill;dmg];1]];$json[fight;hp]]]
  110. $endif
  111.  
  112. $if[$var[dmg]<0]
  113. $var[dmg;0]
  114. $endif
  115.  
  116. $var[chance;$random[0;101]]
  117. $enableDecimals[yes]
  118. $var[skillAcc;$round[$multi[$json[skill;acc];$divide[$json[stats;fight;acc];100]];0]]
  119. $enableDecimals[no]
  120. $var[acc;$optOff[$random[0;101]]]
  121.  
  122. $if[$customID!=fight brace $authorID]
  123.  
  124.  
  125. $if[$json[skill;-mp]==]
  126. $jsonSet[skill;-mp;0]
  127. $endif
  128.  
  129.  
  130. $if[$json[mp;min]<$json[skill;-mp]]
  131. $enableDecimals[yes]
  132. $var[-hp;$round[$multi[$json[hp;min];$divide[$sub[$json[skill;-mp];$json[mp;min]];100]];0]]
  133. $enableDecimals[no]
  134. $var[desc.mp;$username suffered $var[-hp] damage due to lack of MP.]
  135. $jsonSetString[hp;min;$sub[$json[hp;min];$var[-hp]]]
  136.  
  137. $endif
  138.  
  139. $if[$var[acc]<=$var[skillAcc]]
  140.  
  141. $if[$or[$json[fight;effect;tick]<=0;$json[fight;effect;type]!=stn]==true]
  142. $var[evaChance;$optOff[$random[1;101]]]
  143. $else
  144. $var[evaChance;999999]
  145. $endif
  146.  
  147. $if[$or[$var[evaChance]>=$json[fight;eva];$json[skill;dmg]<=0]==true]
  148.  
  149. $if[$and[$json[skill;tick]!=;$json[fight;effect;tick]<=0;$or[$json[profile;effect;type]!=stn;$json[profile;effect;tick]<=0]==true;$var[chance]<55]==true]
  150.  
  151. $if[$json[skill;type]!=]
  152.  
  153. $optOff[$var[effect;$random[$divide[$multi[$json[skill;dmg];$json[element;level]];2];$sum[$multi[$json[skill;dmg];$json[element;level]];1]]]
  154. ]
  155.  
  156. $var[desc;$nickname used $toTitleCase[$json[skill;name]] and dealt $var[dmg] damage.]
  157.  
  158. $if[$json[skill;type]==brn]
  159. $var[desc;$var[desc]
  160. $toTitleCase[$json[fight;name]] is burning.]
  161. $elseif[$json[skill;type]==stn]
  162. $var[desc;$var[desc]
  163. $toTitleCase[$json[fight;name]] is stunned.]
  164. $elseif[$json[skill;type]==frz]
  165. $var[desc;$var[desc]
  166. $toTitleCase[$json[fight;name]] is frozen.]
  167. $elseif[$json[skill;type]==bld]
  168. $var[desc;$var[desc]
  169. $toTitleCase[$json[fight;name]] is bleeding.]
  170. $elseif[$json[skill;type]==psn]
  171. $var[desc;$var[desc]
  172. $toTitleCase[$json[fight;name]] is poisoned.]
  173. $endif
  174.  
  175. $endif
  176.  
  177. $c[if[var[effect\]!=\]
  178. jsonSet[fight\;hp\;sub[json[fight\;hp\]\;var[effect\]\]\]
  179. endif]
  180.  
  181. $jsonSet[fight;effect;type;$json[skill;type]]
  182. $jsonSet[fight;effect;tick;$json[skill;tick]]
  183. $jsonSet[fight;effect;dmg;$json[skill;dmg]]
  184.  
  185. $elseif[$json[skill;type]==skls]
  186.  
  187. $if[$json[link;skills;$json[fight;name]]!=]
  188. $var[skill;$json[link;skills;$json[fight;name]]]
  189. $else
  190. $var[skill;$json[link;skills;other]]
  191. $endif
  192.  
  193. $jsonParse[{"skill":$var[skill],"cpy":$json[skill],"fight":$json[fight]}]
  194.  
  195.  
  196. $description[## CHOOSE AN ELEMENT]
  197.  
  198. $removeButtons
  199. $removeComponent[fight $authorID]
  200.  
  201. $newSelectMenu[fight $authorID;1;1;$toUppercase[$json[fight;name]]’S SKILLS];$var[a]]
  202. $addSelectMenuOption[fight $authorID;$toTitleCase[$json[skill;1;name]];$json[skill;1];$c[desc];;$c[emoji];$var[a]]
  203.  
  204. $addSelectMenuOption[fight $authorID;$toTitleCase[$json[skill;2;name]];$json[skill;2];$c[desc];;$c[emoji];$var[a]]
  205.  
  206. $addSelectMenuOption[fight $authorID;$toTitleCase[$json[skill;3;name]];$json[skill;3];$c[desc];;$c[emoji];$var[a]]
  207.  
  208.  
  209. $elseif[$json[skill;type]==cpy]
  210.  
  211. $if[$json[link;skills;$json[fight;name]]!=]
  212. $var[skill;$json[link;skills;$json[fight;name]]]
  213. $else
  214. $var[skill;$json[link;skills;other]]
  215. $endif
  216.  
  217. $jsonParse[{"skill":$var[skill],"cpy":$json[skill],"fight":$json[fight]}]
  218.  
  219. $if[$json[cpy;double]==true]
  220. $jsonSet[skill;1;dmg;$multi[$json[skill;1;dmg];2]]
  221. $jsonSet[skill;2;dmg;$multi[$json[skill;2;dmg];2]]
  222. $jsonSet[skill;3;dmg;$multi[$json[skill;3;dmg];2]]
  223. $endif
  224.  
  225. $jsonSet[skill;1;-mp;$json[cpy;-mp]]
  226. $jsonSet[skill;2;-mp;$json[cpy;-mp]]
  227. $jsonSet[skill;3;-mp;$json[cpy;-mp]]
  228.  
  229. $if[$json[cpy;double]==true]
  230. $description[## CHOOSE A SKILL TO COPY
  231. ### DOUBLE DAMAGE]
  232. $else
  233. $description[## CHOOSE A SKILL TO COPY]
  234. $endif
  235.  
  236. $removeButtons
  237. $removeComponent[fight $authorID]
  238.  
  239. $newSelectMenu[fight $authorID;1;1;$toUppercase[$json[fight;name]]’S SKILLS];$var[a]]
  240. $addSelectMenuOption[fight $authorID;$toTitleCase[$json[skill;1;name]];$json[skill;1];$c[desc];;$c[emoji];$var[a]]
  241.  
  242. $addSelectMenuOption[fight $authorID;$toTitleCase[$json[skill;2;name]];$json[skill;2];$c[desc];;$c[emoji];$var[a]]
  243.  
  244. $addSelectMenuOption[fight $authorID;$toTitleCase[$json[skill;3;name]];$json[skill;3];$c[desc];;$c[emoji];$var[a]]
  245.  
  246.  
  247. $elseif[$json[skill;type]==+hp]
  248.  
  249. $if[$customID!=fight item-use $authorID]
  250. $optOff[
  251. $var[+hp;$random[$divide[$multi[$json[skill;+hp];$json[element;level]];2];$sum[$multi[$json[skill;+hp];$json[element;level]];1]]]
  252. ]
  253. $else
  254. $optOff[
  255. $var[+hp;$json[skill;int]]
  256. ]
  257. $endif
  258.  
  259. $var[desc;$username used $toTitleCase[$json[skill;name]] and restored $var[+hp] of their HP.]
  260.  
  261. $elseif[$json[skill;type]==+mp]
  262.  
  263. $if[$customID!=fight item-use $authorID]
  264. $optOff[
  265. $var[+mp;$random[$divide[$multi[$json[skill;+mp];$json[element;level]];2];$sum[$multi[$json[skill;+mp];$json[element;level]];1]]]
  266. ]
  267. $else
  268. $optOff[
  269. $var[+mp;$json[skill;int]]
  270. ]
  271. $endif
  272.  
  273. $var[desc;$username used $toTitleCase[$json[skill;name]] and restored $var[+mp] of their MP.]
  274.  
  275. $elseif[$json[skill;type]==buff]
  276.  
  277. $if[$json[skill;+def]!=]
  278. $var[buffs;$var[buffs],defense]
  279. $jsonSet[stats;fight;def;$sum[$json[stats;fight;def];$json[skill;+def]]]
  280. $endif
  281. $if[$json[skill;+eva]!=]
  282. $var[buffs;$var[buffs],evasiveness]
  283. $jsonSet[stats;fight;eva;$sum[$json[stats;fight;eva];$json[skill;+eva]]]
  284. $endif
  285. $if[$json[skill;+spd]!=]
  286. $var[buffs;$var[buffs],speed]
  287. $jsonSet[stats;fight;spd;$sum[$json[stats;fight;spd];$json[skill;+spd]]]
  288. $endif
  289.  
  290. $textSplit[$var[buffs];,]
  291.  
  292. $if[$splitText[1]==]
  293. $removeSplitTextElement[1]
  294. $endif
  295.  
  296. $var[buffs;$joinSplitText[, ]]
  297.  
  298. $if[$getTextSplitLength>1]
  299. $var[buffs;$replaceText[$var[buffs];, $splitText[>]; and $splitText[>]]]
  300. $endif
  301.  
  302. $var[desc;$username used $toTitleCase[$json[skill;name]]
  303. $username’s $var[buffs] rose.]
  304.  
  305. $elseif[$json[skill;type]==drn]
  306.  
  307. $optOff[
  308. $var[+hp;$var[dmg]]
  309. ]
  310.  
  311. $var[desc;$username used $toTitleCase[$json[skill;name]] and drained $var[+hp] HP from $toTitleCase[$json[fight;name]].]
  312.  
  313. $elseif[$json[skill;type]==-acc]
  314.  
  315. $enableDecimals[true]
  316. $var[-acc;$multi[$json[fight;stats;acc];$json[skill;-acc]]]
  317. $enableDecimals[false]
  318.  
  319. $var[desc;$username used $toTitleCase[$json[skill;name]]
  320. $toTitleCase[$json[fight;name]]’s accuracy fell.]
  321.  
  322. $jsonSetString[fight;stats;acc;$sub[$json[fight;stats;acc];$var[-acc]]]
  323.  
  324. $elseif[$json[skill;type]==-spd]
  325.  
  326. $enableDecimals[true]
  327. $var[-spd;$multi[$json[fight;stats;spd];$json[skill;-spd]]]
  328. $enableDecimals[false]
  329.  
  330. $var[desc;$username used $toTitleCase[$json[skill;name]]
  331. $toTitleCase[$json[fight;name]]’s speed fell.]
  332.  
  333. $jsonSetString[fight;stats;spd;$sub[$json[fight;stats;spd];$var[-spd]]]
  334.  
  335. $elseif[$json[skill;type]==-dmg]
  336.  
  337. $enableDecimals[true]
  338. $var[-dmg;$multi[$json[fight;stats;-dmg];$json[skill;-dmg]]]
  339. $enableDecimals[false]
  340.  
  341. $var[desc;$username used $toTitleCase[$json[skill;name]]
  342. $toTitleCase[$json[fight;name]]’s damage fell.]
  343.  
  344. $enableDecimals[true]
  345. $jsonSetString[fight;stats;-dmg;$sub[$json[stats;-dmg];$var[-dmg]]]
  346. $enableDecimals[false]
  347.  
  348. $elseif[$json[skill;type]==-def]
  349.  
  350. $enableDecimals[true]
  351. $var[-def;$sub[$json[fight;stats;-def];$multi[$json[stats;-def];$json[skill;-def]]]]
  352. $enableDecimals[false]
  353.  
  354. $var[desc;$username used $toTitleCase[$json[skill;name]]
  355. $toTitleCase[$json[fight;name]]’s defense fell.]
  356.  
  357. $jsonSetString[fight;stats;-def;$sub[$json[fight;stats;-def];$var[-def]]]
  358.  
  359. $else
  360. $var[desc;$username used $toTitleCase[$json[skill;name]] and dealt $var[dmg] damage.]
  361. $endif
  362.  
  363. $else
  364. $var[miss;true]
  365. $var[dmg;0]
  366. $var[-hp;0]
  367. $var[heal;0]
  368. $var[desc;$username used $toTitleCase[$json[skill;name]] but $toTitleCase[$json[fight;name]] evaded the attack.]
  369. $endif
  370.  
  371. $else
  372. $var[dmg;0]
  373. $var[-hp;0]
  374. $var[heal;0]
  375. $var[desc;$username used $toTitleCase[$json[skill;name]] but it failed.]
  376.  
  377. $if[$json[guide;acc]!=true]
  378.  
  379. $var[guide;true]
  380.  
  381. $description[Yikes! You failed your attack! T^T
  382. Failing an attack can vary depending on your skill’s accuracy and your accuracy!
  383. If your opponent has the skill or spell to reduce your accuracy, it will be a very tough battle...
  384. What’s scarier than damage are debuffs... @-@
  385. Be careful!;2]
  386.  
  387. $jsonSet[guide;acc;true]
  388.  
  389. $endif
  390.  
  391. $endif
  392.  
  393. $else
  394. $var[dmg;0]
  395. $var[heal;0]
  396. $var[+def;5]
  397. $var[desc;$username braced themself.]
  398.  
  399. $if[$json[guide;brace]!=true]
  400.  
  401. $var[guide;true]
  402.  
  403. $description[Ah, the classic "I-dunno-what-to-do" move. Brace increases your defense a little bit for a single turn, which is great when you get stunned.
  404. Brace can increase your MP by 25 when used. Doing something without enough MP can inflect self damage or even stun. @-@;2]
  405.  
  406. $jsonSet[guide;brace;true]
  407.  
  408. $endif
  409.  
  410. $if[$json[mp;min]<=$json[mp;max]]
  411.  
  412. $jsonSet[mp;min;$sum[$json[mp;min];25]]
  413.  
  414. $if[$json[mp;min]>$json[mp;max]]
  415. $jsonSet[mp;min;$json[mp;max]]
  416. $endif
  417.  
  418. $endif
  419.  
  420. $endif
  421.  
  422. $if[$json[profile;effect;tick]>0]
  423.  
  424. $optOff[
  425. $var[-hp;$min[$random[$divide[$json[profile;effect;dmg];2];$sum[$json[profile;effect;dmg];1]];$json[hp;min]]]
  426. ]
  427.  
  428. $if[$json[profile;effect;type]==stn]
  429. $var[immob;true]
  430. $var[dmg;0]
  431. $var[-hp;0]
  432. $var[+hp;0]
  433. $var[desc;$username is stunned.]
  434. $elseif[$json[profile;effect;type]==frz]
  435. $var[immob;true]
  436. $var[dmg;0]
  437. $var[-hp;0]
  438. $var[+hp;0]
  439. $var[desc;$username is frozen.]
  440. $else
  441. $var[desc;$var[desc]
  442. ($toUppercase[$json[profile;effect;type]] effect dealt $var[-hp] damage to $username)]
  443. $endif
  444.  
  445. $jsonSetString[hp;min;$sub[$json[hp;min];$var[-hp]]]
  446. $jsonSet[profile;effect;tick;$sub[$json[profile;effect;tick];1]]
  447.  
  448. $endif
  449.  
  450. $if[$var[+hp]!=]
  451.  
  452. $jsonSet[hp;min;$sum[$json[hp;min];$var[+hp]]]
  453.  
  454. $if[$json[hp;min]>$json[hp;max]]
  455. $jsonSet[hp;min;$json[hp;max]]
  456. $endif
  457.  
  458. $endif
  459.  
  460. $if[$var[+mp]!=]
  461.  
  462. $jsonSet[mp;min;$sum[$json[mp;min];$var[+mp]]]
  463.  
  464. $if[$json[mp;min]>$json[mp;max]]
  465. $jsonSet[mp;min;$json[mp;max]]
  466. $endif
  467.  
  468. $endif
  469.  
  470. $jsonSet[mp;min;$sub[$json[mp;min];$json[skill;-mp]]]
  471.  
  472. $if[$json[mp;min]<=0]
  473. $jsonSet[mp;min;0]
  474. $endif
  475.  
  476. $jsonSet[fight;hp;$sub[$json[fight;hp];$var[dmg]]]
  477.  
  478. $if[$var[desc.mp]!=]
  479. $var[desc;$var[desc]
  480. $var[desc.mp]]
  481. $endif
  482.  
  483. $if[$json[fight;hp]>0]
  484.  
  485. $if[$json[link;dialogue;$json[fight;name];hurt]==]
  486. $var[dialogue;...]
  487. $else
  488. $var[dialogue;$json[link;dialogue;$json[fight;name];hurt;$random[0;$jsonArrayCount[link;dialogue;$json[fight;name];hurt]]]]
  489. $endif
  490.  
  491. $else
  492.  
  493. $if[$$json[fight;name]==dummy]
  494. $removeComponent[$customID]
  495. $endif
  496.  
  497. $if[$json[link;dialogue;$json[fight;name];death]==]
  498. $var[dialogue;$toTitleCase[$json[fight;name]]: ...]
  499. $else
  500. $var[dialogue;$toTitleCase[$json[fight;name]]: $json[link;dialogue;$json[fight;name];death;$random[0;$jsonArrayCount[link;dialogue;$json[fight;name];death]]]]
  501. $endif
  502.  
  503. $endif
  504.  
  505. $removeComponent[fight $authorID]
  506. $removeButtons
  507.  
  508. $if[$json[fight;name]!=]
  509.  
  510. $if[$and[1==1;true==true]==true]
  511.  
  512. $if[$and[true==true;$toTitleCase[$json[fight;name]]!=]==true]
  513.  
  514. $if[$json[link;skills;$json[fight;name];$random[1;4]]!=]
  515. $var[skill;$json[link;skills;$json[fight;name];$random[1;4]]]
  516. $else
  517. $var[skill;$json[link;skills;other;$random[1;4]]]
  518. $endif
  519.  
  520. $jsonParse[
  521. {
  522. "level":$json[level],
  523. "element":$json[element],
  524. "profile":$json[profile],
  525. "fight":$json[fight],
  526. "ability":$json[ability],
  527. "skill1":$json[skill1],
  528. "skill2":$json[skill2],
  529. "skill3":$json[skill3],
  530. "devskill1":$json[devskill1],
  531. "hp":$json[hp],
  532. "mp":$json[mp],
  533. "skill":$var[skill],
  534. "skillName":"$json[skill;name]",
  535. "link":$json[link],
  536. "floor":$var[floor],
  537. "stats":$json[stats],
  538. "avatar":"$getVar[fightAvatar;$authorID]",
  539. "guide":$json[guide],
  540. "assets":$getVar[assets],
  541. "story":$json[story],
  542. "equipment":$json[equipment],
  543. "inv":$json[inv]
  544. }
  545. ]
  546.  
  547. $if[$json[fight;hp]>0]
  548.  
  549. $optOff[
  550. $var[edmg;$min[$sub[$multi[$random[$divide[$json[skill;dmg];2];$sum[$json[skill;dmg];1]];$json[fight;stats;-dmg]];$random[$divide[$json[stats;fight;def];2];$json[stats;fight;def]]];$json[hp;min]]]
  551. ]
  552.  
  553. $if[$var[+def]!=]
  554. $var[edmg;$sub[$var[edmg];$var[+def]]]
  555. $endif
  556.  
  557. $if[$var[edmg]<0]
  558. $var[edmg;0]
  559. $endif
  560.  
  561. $optOff[$var[chance;$random[0;101]]]
  562. $enableDecimals[yes]
  563. $var[skillAcc;$round[$multi[$json[skill;acc];$divide[$json[fight;stats;acc];100]];0]]
  564. $enableDecimals[no]
  565. $var[acc;$optOff[$random[0;101]]]
  566.  
  567. $if[$var[acc]<=$var[skillAcc]]
  568.  
  569. $var[enemyEvaChance;$optOff[$random[1;101]]]
  570.  
  571. $if[$or[$var[enemyEvaChance]>=$json[stats;fight;eva];$json[skill;dmg]<=0]==true]
  572.  
  573. $if[$and[$json[skill;tick]!=;$json[profile;effect;tick]<=0; $or[$json[fight;effect;type]!=stn;$json[fight;effect;tick]<=0]==true;$var[chance]<50]==true]
  574.  
  575. $if[$json[skill;type]!=]
  576.  
  577. $optOff[$var[effect;$random[$divide[$json[skill;dmg];2];$sum[$json[skill;dmg];1]]]
  578. ]
  579.  
  580. $var[edesc;$toTitleCase[$json[fight;name]] used $toTitleCase[$json[skill;name]] and dealt $var[edmg] damage.]
  581.  
  582. $if[$json[skill;type]==brn]
  583. $var[edesc;$var[edesc]
  584. $username is burning.]
  585. $elseif[$json[skill;type]==stn]
  586. $var[edesc;$var[edesc]
  587. $username is stunned.]
  588. $elseif[$json[skill;type]==bld]
  589. $var[edesc;$var[edesc]
  590. $username is bleeding.]
  591. $elseif[$json[skill;type]==psn]
  592. $var[edesc;$var[edesc]
  593. $username is poisoned.]
  594. $endif
  595.  
  596. $else
  597. $var[edesc;$toTitleCase[$json[fight;name]] used $toTitleCase[$json[skill;name]] and dealt $var[edmg] damage.]
  598. $endif
  599.  
  600. $c[if[var[effect\]!=\]
  601. jsonSet[hp\;min\;sub[json[hp\;min\]\;var[effect\]\]\]
  602. endif]
  603.  
  604. $jsonSet[profile;effect;type;$json[skill;type]]
  605. $jsonSet[profile;effect;tick;$json[skill;tick]]
  606. $jsonSet[profile;effect;dmg;$json[skill;dmg]]
  607.  
  608. $elseif[$json[skill;type]==rndm]
  609.  
  610. $if[$json[link;skills;$toTitleCase[$json[fight;name]];$random[1;4]]!=]
  611. $var[skill;$json[link;skills;$toTitleCase[$json[fight;name]];$random[1;4]]]
  612. $else
  613. $var[skill;$json[link;skills;other;$random[1;4]]]
  614. $endif
  615.  
  616. $elseif[$json[skill;type]==heal]
  617.  
  618. $optOff[
  619. $var[eheal;$random[$divide[$json[skill;+hp];2];$sum[$json[skill;+hp];1]]]
  620. ]
  621.  
  622. $var[edesc;$toTitleCase[$json[fight;name]] used $toTitleCase[$json[skill;name]] and restored $var[eheal] of their HP.]
  623.  
  624. $elseif[$json[skill;type]==-acc]
  625.  
  626. $enableDecimals[true]
  627. $var[-acc;$multi[$json[stats;fight;acc];$json[skill;-acc]]]
  628. $enableDecimals[false]
  629.  
  630. $var[edesc;$toTitleCase[$json[fight;name]] used $toTitleCase[$json[skill;name]]
  631. $username’s accuracy fell.]
  632.  
  633. $enableDecimals[true]
  634. $jsonSetString[stats;fight;acc;$sub[$json[stats;fight;acc];$var[-acc]]]
  635. $enableDecimals[false]
  636.  
  637. $elseif[$json[skill;type]==-spd]
  638.  
  639. $enableDecimals[true]
  640. $var[-spd;$multi[$json[stats;spd];$json[skill;-spd]]]
  641. $enableDecimals[false]
  642.  
  643. $var[edesc;$toTitleCase[$json[fight;name]] used $toTitleCase[$json[skill;name]]
  644. $username’s speed fell.]
  645.  
  646. $jsonSetString[stats;spd;$sub[$json[stats;spd];$var[-spd]]]
  647.  
  648. $elseif[$json[skill;type]==-dmg]
  649.  
  650. $enableDecimals[true]
  651. $var[-dmg;$multi[$json[stats;-dmg];$json[skill;-dmg]]]
  652. $enableDecimals[false]
  653.  
  654. $var[edesc;$toTitleCase[$json[fight;name]] used $toTitleCase[$json[skill;name]]
  655. $username’s damage fell.]
  656.  
  657. $enableDecimals[true]
  658. $jsonSetString[stats;-dmg;$sub[$json[stats;-dmg];$var[-dmg]]]
  659. $enableDecimals[false]
  660.  
  661. $elseif[$json[skill;type]==-def]
  662.  
  663. $enableDecimals[true]
  664. $var[-def;$sub[$json[fight;stats;-def];$multi[$json[stats;-def];$json[skill;-def]]]]
  665. $enableDecimals[false]
  666.  
  667. $var[edesc;$toTitleCase[$json[fight;name]] used $toTitleCase[$json[skill;name]]
  668. $username’s defense fell.]
  669.  
  670. $jsonSetString[stats;-def;$sub[$json[stats;-def];$var[-def]]]
  671.  
  672. $else
  673. $var[edesc;$toTitleCase[$json[fight;name]] used $toTitleCase[$json[skill;name]] and dealt $var[edmg] damage.]
  674. $endif
  675.  
  676. $else
  677. $var[emiss;true]
  678. $var[edmg;0]
  679. $var[-ehp;0]
  680. $var[eheal;0]
  681. $var[edesc;$toTitleCase[$json[fight;name]] used $toTitleCase[$json[skill;name]] but $username evaded the attack.]
  682. $endif
  683.  
  684. $else
  685. $var[edmg;0]
  686. $var[-ehp;0]
  687. $var[eheal;0]
  688. $var[edesc;$toTitleCase[$json[fight;name]] used $toTitleCase[$json[skill;name]] but it failed.]
  689. $endif
  690.  
  691. $if[$json[fight;effect;tick]>0]
  692.  
  693. $optOff[
  694. $var[-ehp;$min[$random[$divide[$multi[$json[fight;effect;dmg];$json[element;level]];2];$sum[$multi[$json[fight;effect;dmg];$json[element;level]];1]];$json[fight;hp]]]
  695. ]
  696.  
  697. $if[$json[fight;effect;type]==stn]
  698. $var[enemy.immob;true]
  699. $var[edmg;0]
  700. $var[-ehp;0]
  701. $var[eheal;0]
  702. $var[edesc;$toTitleCase[$json[fight;name]] is stunned.]
  703. $elseif[$json[fight;effect;type]==frz]
  704. $var[enemy.immob;true]
  705. $var[edmg;0]
  706. $var[-ehp;0]
  707. $var[eheal;0]
  708. $var[edesc;$toTitleCase[$json[fight;name]] is frozen.]
  709. $else
  710. $var[edesc;$var[edesc]
  711. ($toUppercase[$json[fight;effect;type]] effect dealt $var[-ehp] damage to $toTitleCase[$json[fight;name]])]
  712. $endif
  713.  
  714. $jsonSet[fight;hp;$sub[$json[fight;hp];$var[-ehp]]]
  715. $jsonSet[fight;effect;tick;$sub[$json[fight;effect;tick];1]]
  716.  
  717. $endif
  718.  
  719. $if[$var[eheal]!=]
  720. $jsonSet[fight;hp;$sum[$json[fight;hp];$var[eheal]]]
  721.  
  722. $if[$json[fight;hp]>$json[fight;maxHP]]
  723. $jsonSet[fight;hp;$json[fight;maxHP]]
  724. $endif
  725.  
  726. $endif
  727.  
  728. $jsonSet[hp;min;$sub[$json[hp;min];$var[edmg]]]
  729.  
  730. $if[$json[link;dialogue;$json[fight;name];idle]==]
  731. $var[dialogue;$toTitleCase[$json[fight;name]]: …]
  732. $else
  733. $var[dialogue;$toTitleCase[$json[fight;name]]: $json[link;dialogue;$json[fight;name];idle;$random[0;$jsonArrayCount[link;dialogue;$json[fight;name];idle]]]]
  734. $endif
  735.  
  736. $enableDecimals[yes]
  737. $var[hp;$json[hp;min]]
  738. $enableDecimals[no]
  739.  
  740. $elseif[$json[link;stats;$json[fight;name];phase 2]!=]
  741.  
  742. $var[enemy;$json[link;stats;$json[fight;name];phase 2]]
  743.  
  744. $var[edesc;...]
  745.  
  746. $if[$json[link;stats;$var[enemy];cutscene]!=]
  747.  
  748. $if[$json[fight;page]==]
  749. $jsonSet[fight;page;0]
  750. $elseif[$customID==fight scene skip $authorID]
  751. $jsonSet[fight;page;$sub[$jsonArrayCount[link;stats;$var[enemy];cutscene];1]]
  752. $endif
  753.  
  754. $var[cutscene;true]
  755.  
  756. $if[$json[fight;page]>=$sub[$jsonArrayCount[link;stats;$var[enemy];cutscene];1]]
  757.  
  758. $var[enemy;$json[link;stats;$json[fight;name];phase 2]]
  759.  
  760. $var[avatar;$json[link;stats;$var[enemy];avatar]]
  761.  
  762. $if[$json[link;stats;$var[enemy]]!=]
  763. $var[hp;$json[link;stats;$var[enemy];hp]]
  764. $var[def;$json[link;stats;$var[enemy];def]]
  765. $var[eva;$json[link;stats;$var[enemy];eva]]
  766.  
  767. $else
  768. $var[hp;$json[link;stats;other;hp]]
  769. $var[def;$json[link;stats;other;def]]
  770. $var[eva;$json[link;stats;other;eva]]
  771.  
  772. $endif
  773.  
  774. $if[$var[avatar]==]
  775. $var[avatar;https://cdn.discordapp.com/attachments/1101860440465752065/1122147783001002134/A3818875-1BEA-4510-9FAF-B449B9DD6485.png]
  776. $endif
  777.  
  778. $if[$var[enemy]==]
  779. $var[enemy;error]
  780. $endif
  781.  
  782. $if[$json[link;stats;$var[enemy];lv]==]
  783. $var[lv;$random[$json[floor;lv;min];$json[floor;lv;max]]]
  784. $else
  785. $var[lv;$json[link;stats;$var[enemy];lv]]
  786. $endif
  787.  
  788. $jsonSet[fight;name;$var[enemy]]
  789.  
  790. $if[$json[link;dialogue;$json[fight;name];box]==]
  791. $var[dialogue;…]
  792. $else
  793. $var[dialogue;$json[link;dialogue;$json[fight;name];box;$random[0;$jsonArrayCount[link;dialogue;$json[fight;name];box]]]]
  794. $endif
  795.  
  796. $jsonSet[fight;lv;$var[lv]]
  797. $jsonSet[fight;def;$var[def]]
  798. $jsonSet[fight;eva;$var[eva]]
  799. $jsonSetString[fight;hp;$multi[$var[hp];$var[lv]]]
  800. $jsonSetString[fight;maxHP;$multi[$var[hp];$var[lv]]]
  801. $setVar[fightAvatar;$var[avatar];$authorID]
  802. $jsonSet[fight;gold;$multi[$json[floor;gold];2]]
  803. $jsonSet[fight;xp;$multi[$json[floor;xp];2]]
  804. $jsonSet[fight;stats;spd;100]
  805. $jsonSet[fight;stats;acc;100]
  806. $jsonSetString[fight;stats;-dmg;1.000]
  807. $jsonSetString[fight;stats;-def;1.000]
  808.  
  809. $endif
  810.  
  811. $endif
  812.  
  813. $elseif[$json[fight;story]==true]
  814.  
  815. $var[story;true]
  816.  
  817. $else
  818.  
  819. $var[edesc;$toTitleCase[$json[fight;name]] isn't moving.]
  820.  
  821. $endif
  822.  
  823. $endif
  824.  
  825. $var[hpBarE;$replaceText[$repeatMessage[6;<:barempty:1227182702927810560>];<:barempty:1227182702927810560>;<:barfull:1227194621319184405>;$round[$divide[$divide[$multi[$json[fight;hp];12];$json[fight;maxHP]];2];0]]]
  826. $var[hpBar;$replaceText[$repeatMessage[6;<:barempty:1227182702927810560>];<:barempty:1227182702927810560>;<:barfull:1227194621319184405>;$round[$divide[$divide[$multi[$json[hp;min];12];$json[hp;max]];2];0]]]
  827. $enableDecimals[true]
  828. $var[hp%;$multi[$divide[$json[hp;min];$json[hp;max]];100]]
  829. $enableDecimals[false]
  830.  
  831. $if[$var[hp%]<=0]
  832. $var[color;#000001]
  833. $elseif[$var[hp%]<=25]
  834. $var[color;#c20202]
  835. $elseif[$var[hp%]<=50]
  836. $var[color;#c28502]
  837. $elseif[$var[hp%]<=75]
  838. $var[color;#b2c202]
  839. $elseif[$var[hp%]<=100]
  840. $var[color;#AAFF00]
  841. $endif
  842.  
  843. $if[$var[edmg]!=]
  844.  
  845. $if[$var[-hp]!=]
  846.  
  847. $if[$var[-hp]>0]
  848. $var[edmg;-$sum[$var[edmg];$var[-hp]]]
  849. $else
  850. $if[$var[edmg]>0]
  851. $var[edmg;-$var[edmg]]
  852. $else
  853. $var[edmg;]
  854. $endif
  855. $endif
  856.  
  857. $else
  858.  
  859. $if[$var[edmg]>0]
  860. $var[edmg;-$var[edmg]]
  861. $else
  862. $var[edmg;]
  863. $endif
  864.  
  865. $endif
  866.  
  867. $elseif[$var[-hp]!=]
  868.  
  869. $if[$var[-hp]>0]
  870. $var[edmg;-$var[-hp]]
  871. $endif
  872.  
  873. $endif
  874.  
  875. $if[$var[enemy.immob]!=true]
  876. $if[$var[emiss]==true]
  877. $var[edmg;MISS]
  878. $if[$var[-hp]!=]
  879. $if[$var[-hp]>0]
  880. $var[dmg;$var[edmg] (-$var[-hp])]
  881. $endif
  882. $endif
  883. $endif
  884. $endif
  885.  
  886.  
  887.  
  888. $if[yes==1]
  889. $if[$var[dmg]==0]
  890.  
  891. $if[$var[dmg]<=0]
  892.  
  893. $if[$var[miss]!=true]
  894. $var[dmg;]
  895. $else
  896. $var[dmg;MISS]
  897. $if[$json[link;stats;$json[fight;name];mod;miss]!=]
  898. $var[dmg;$toUppercase[$json[link;stats;$json[fight;name];mod;miss;new]]]
  899. $var[desc;$replaceText[$replaceText[$replaceText[$json[link;stats;$json[fight;name];mod;miss;desc];{fight.name};$toTitleCase[$json[fight;name]]];{skill.name};$toTitleCase[$json[skillName]]];{username};$username]]
  900. $endif
  901. $endif
  902.  
  903. $else
  904.  
  905. $if[$var[-ehp]!=]
  906. $var[dmg;-$sum[$var[dmg];$var[-ehp]]]
  907. $else
  908. $var[dmg;-$var[dmg]]
  909. $endif
  910.  
  911. $endif
  912.  
  913. $elseif[$var[-ehp]>0]
  914. $var[dmg;-$var[-ehp]]
  915.  
  916. $else
  917.  
  918. $var[dmg;]
  919. $endif
  920. $endif
  921.  
  922.  
  923.  
  924. $if[$var[dmg]!=]
  925.  
  926. $if[$var[-ehp]!=]
  927.  
  928. $if[$var[-ehp]>0]
  929. $var[dmg;-$sum[$var[dmg];$var[-ehp]]]
  930. $else
  931. $if[$var[dmg]>0]
  932. $var[dmg;-$var[dmg]]
  933. $else
  934. $var[dmg;]
  935. $endif
  936. $endif
  937.  
  938. $else
  939.  
  940. $if[$var[dmg]>0]
  941. $var[dmg;-$var[dmg]]
  942. $else
  943. $var[dmg;]
  944. $endif
  945.  
  946. $endif
  947.  
  948. $elseif[$var[-ehp]!=]
  949.  
  950. $if[$var[-ehp]>0]
  951. $var[dmg;-$var[-ehp]]
  952. $endif
  953.  
  954. $endif
  955.  
  956. $if[$var[immob]!=true]
  957. $if[$var[miss]==true]
  958. $var[dmg;MISS]
  959. $if[$json[link;stats;$json[fight;name];mod;miss]!=]
  960. $var[dmg;$toUppercase[$json[link;stats;$json[fight;name];mod;miss;new]]]
  961. $var[desc;$replaceText[$replaceText[$replaceText[$json[link;stats;$json[fight;name];mod;miss;desc];{fight.name};$toTitleCase[$json[fight;name]]];{skill.name};$toTitleCase[$json[skillName]]];{username};$username]]
  962. $if[$var[-ehp]!=]
  963. $if[$var[-ehp]>0]
  964. $var[dmg;$var[dmg] (-$var[-ehp])]
  965. $endif
  966. $endif
  967. $endif
  968. $endif
  969. $endif
  970.  
  971.  
  972. $if[$var[cutscene]==true]
  973.  
  974.  
  975.  
  976. $jsonParse[
  977. {
  978. "level":$json[level],
  979. "element":$json[element],
  980. "profile":$json[profile],
  981. "fight":$json[fight],
  982. "ability":$json[ability],
  983. "skill1":$json[skill1],
  984. "skill2":$json[skill2],
  985. "skill3":$json[skill3],
  986. "devskill1":$json[devskill1],
  987. "hp":$json[hp],
  988. "mp":$json[mp],
  989. "skill":$var[skill],
  990. "skillName":"$json[skill;name]",
  991. "link":$json[link],
  992. "floor":$var[floor],
  993. "stats":$json[stats],
  994. "avatar":"$getVar[fightAvatar;$authorID]",
  995. "guide":$json[guide],
  996. "assets":$getVar[assets],
  997. "cutscene":$json[link;stats;$var[enemy];cutscene;$json[fight;page]],
  998. "story":$json[story],
  999. "inv":$json[inv]
  1000. }
  1001. ]
  1002.  
  1003. $if[$json[cutscene;desc]!=]
  1004. $description[```$json[cutscene;desc]```]
  1005. $endif
  1006. $if[$json[cutscene;img]!=]
  1007. $image[$json[cutscene;img]]
  1008. $endif
  1009.  
  1010. $if[$json[fight;page]>=$sub[$jsonArrayCount[link;stats;$var[enemy];cutscene];1]]
  1011.  
  1012. $if[$json[cutscene;desc]==]
  1013. $var[cutscene.desc;...]
  1014. $else
  1015. $var[cutscene.desc;$json[cutscene;desc]]
  1016. $endif
  1017.  
  1018. $description[## $json[assets;skullred] $toTitleCase[$var[enemy]] $json[assets;skullred]
  1019. ```$var[cutscene.desc]```]
  1020.  
  1021. $jsonSetString[msg;id;$messageID]
  1022. $addButton[no;fight hunt $authorID $sum[$getTimestamp;999999] $messageID;Continue Fight;secondary]
  1023. $jsonSet[profile;fight;name;$var[enemy]]
  1024. $if[$json[fight;name]!=]$jsonUnset[fight;name]$endif
  1025. $jsonUnset[fight;page]
  1026.  
  1027. $else
  1028.  
  1029. $jsonSet[fight;page;$sum[$json[fight;page];1]]
  1030. $addButton[no;fight $authorID;Proceed;secondary]
  1031. $addButton[no;fight scene skip $authorID;SKIP;primary]
  1032.  
  1033. $endif
  1034.  
  1035. $elseif[$var[story]==true]
  1036.  
  1037. $httpGet[https://snippet.host/kbmgce/raw]
  1038.  
  1039. $jsonParse[
  1040. {
  1041. "level":$json[level],
  1042. "element":$json[element],
  1043. "profile":$json[profile],
  1044. "fight":$json[fight],
  1045. "ability":$json[ability],
  1046. "skill1":$json[skill1],
  1047. "skill2":$json[skill2],
  1048. "skill3":$json[skill3],
  1049. "devskill1":$json[devskill1],
  1050. "hp":$json[hp],
  1051. "mp":$json[mp],
  1052. "skill":$var[skill],
  1053. "skillName":"$json[skill;name]",
  1054. "link":$json[link],
  1055. "floor":$var[floor],
  1056. "stats":$json[stats],
  1057. "avatar":"$getVar[fightAvatar;$authorID]",
  1058. "guide":$json[guide],
  1059. "assets":$getVar[assets],
  1060. "story":$json[story],
  1061. "storyLink":$httpResult,
  1062. "inv":$json[inv]
  1063. }
  1064. ]
  1065.  
  1066. $textSplit[$json[story;$json[story;name]];-]
  1067. $var[chap;$splitText[1]]
  1068. $var[page;$splitText[2]]
  1069.  
  1070. $author[$username | $toTitleCase[$json[story;name]]]
  1071. $authorIcon[$authorAvatar]
  1072. $description[## Chapter $sum[$var[chap];1] - $toTitleCase[$json[storyLink;$json[story;name];chapter;$var[chap];name]]
  1073. You beat $toTitleCase[$json[fight;name]]!]
  1074. $thumbnail[$getVar[fightAvatar;$authorID]]
  1075.  
  1076. $jsonSetString[story;id;$messageID]
  1077. $addButton[no;story next $authorID $messageID;Proceed;secondary]
  1078.  
  1079. $if[$json[fight;story]!=]$jsonUnset[fight;story]$endif
  1080. $if[$json[fight;name]!=]$jsonUnset[fight;name]$endif
  1081.  
  1082. $else
  1083.  
  1084. $if[$var[+def]!=]
  1085. $if[$var[+def]>0]
  1086. $var[+def;+$var[+def]]
  1087. $else
  1088. $var[+def;]
  1089. $endif
  1090. $endif
  1091.  
  1092. $author[$username]
  1093. $authorIcon[$authorAvatar]
  1094. $description[### $toTitleCase[$json[fight;name]] LV$json[fight;lv]
  1095. $json[assets;heart] $var[hpBarE] `$json[fight;hp]/$json[fight;maxHP]
  1096. $var[dmg]`
  1097. $json[assets;shield1] $json[fight;def]
  1098. ### $username LV$json[level;lv]
  1099. $json[assets;heart] $var[hpBar] `$json[hp;min]/$json[hp;max]
  1100. $var[edmg]`
  1101. $json[assets;shield1] $json[stats;fight;def] $var[+def]
  1102. ```$var[dialogue]```]
  1103. $footer[$var[desc]
  1104. ---------
  1105. $var[edesc]]
  1106. $thumbnail[$getVar[fightAvatar;$authorID]]
  1107. $color[$var[color]]
  1108.  
  1109. $if[$and[$json[hp;min]>0;$json[fight;hp]>0]==true]
  1110.  
  1111. $newSelectMenu[fight $authorID;1;1;SKILLS | MP: $json[mp;min]/$json[mp;max];$var[a]]
  1112. $addSelectMenuOption[fight $authorID;$toTitleCase[$json[skill1;name]];{"skill.type":"skill","skill.id":1};$json[skill1;-mp]MP;;$c[emoji];$var[a]]
  1113. $if[$json[skill2;lv]<=$json[element;level]]
  1114. $addSelectMenuOption[fight $authorID;$toTitleCase[$json[skill2;name]];{"skill.type":"skill","skill.id":2};$json[skill2;-mp]MP;;$c[emoji];$var[a]]
  1115. $endif
  1116. $if[$json[skill3;lv]<=$json[element;level]]
  1117. $addSelectMenuOption[fight $authorID;$toTitleCase[$json[skill3;name]];{"skill.type":"skill","skill.id":3};$json[skill3;-mp]MP;;$c[emoji];$var[a]]
  1118. $endif
  1119. $if[$checkContains[$getVar[devs];$authorID]==true]
  1120. $addSelectMenuOption[fight $authorID;DEV: $toTitleCase[$json[ability;dev;1;name]];{"skill.type":"dev","skill.id":1};$json[ability;dev;1;-mp]MP;;$c[emoji];$var[a]]
  1121. $endif
  1122. $if[$checkContains[$getVar[devs];$authorID]==true]
  1123. $addSelectMenuOption[fight $authorID;DEV: $toTitleCase[$json[ability;dev;2;name]];{"skill.type":"dev","skill.id":2};$json[ability;dev;2;-mp]MP;;$c[emoji];$var[a]]
  1124. $endif
  1125. $if[$json[equipment;melee;name]!=]
  1126. $addButton[no;fight melee $authorID;Attack;primary]
  1127. $else
  1128. $addButton[no;interface no.melee $authorID;Attack;primary]
  1129. $endif
  1130. $addButton[no;fight brace $authorID;Brace;secondary;;$json[assets;shield1];$var[a]]
  1131. $addButton[no;interface fight.end $authorID;Run;danger;;$json[assets;flee];$var[a]]
  1132.  
  1133. $if[$json[inv;potions]!=]
  1134. $addButton[yes;fight items $authorID;Items;secondary;no]
  1135. $else
  1136. $addButton[yes;fight items $authorID;Items;secondary;yes]
  1137. $endif
  1138.  
  1139. $endif
  1140.  
  1141.  
  1142.  
  1143. $endif
  1144.  
  1145.  
  1146.  
  1147. $endif
  1148.  
  1149.  
  1150. $if[$and[$var[story]!=true;$var[cutscene]!=true]==true]
  1151.  
  1152. $if[$json[fight;hp]<=0]
  1153.  
  1154. $var[exp;$random[$divide[$json[fight;xp];2];$json[fight;xp]]]
  1155. $var[gold;$random[$divide[$json[fight;gold];2];$json[fight;gold]]]
  1156.  
  1157. $async[win]
  1158. $replyIn[1s]
  1159. $sendEmbedMessage[$channelID;$reply;;;You won!
  1160. You earned $var[gold] gold.;$c[color];$username;$authorAvatar;$c[footer];$c[footerIcon];;$c[image];;no]
  1161.  
  1162.  
  1163.  
  1164. $endasync
  1165.  
  1166. $if[$json[fight;story]==true]
  1167. $textSplit[$json[story;$json[story;name]];-]
  1168. $jsonSet[story;$json[story;name];$splitText[1]-$sum[$splitText[2];1]]
  1169.  
  1170. $async[story]
  1171. $replyIn[7s]
  1172. $var[msg;$sendMessage[<@$authorID>
  1173. Story **$toTitleCase[$json[story;name]]** has been updated.;yes]]
  1174. $async[story.button]
  1175. $replyIn[1s]
  1176. $addButton[no;story start $authorID "$json[story;name]";Continue Story;secondary;no;;$var[msg]]
  1177. $endasync
  1178. $setVar[story;$json[story];$authorID]
  1179. $endasync
  1180. $endif
  1181.  
  1182. $if[$json[fight;story]!=]$jsonUnset[fight;story]$endif
  1183. $if[$json[fight;name]!=]$jsonUnset[fight;name]$endif
  1184. $if[$json[profile;kd;kills]==]
  1185. $jsonSet[profile;kd;kills;1]
  1186. $else
  1187. $jsonSet[profile;kd;kills;$sum[$json[profile;kd;kills];1]]
  1188. $endif
  1189. $jsonSet[fight;effect;tick;0]
  1190. $jsonSetString[stats;-def;1.000]
  1191. $jsonSetString[stats;-dmg;1.000]
  1192.  
  1193. $setVar[story;$json[story];$authorID]
  1194. $setVar[fight;$json[fight];$authorID]
  1195. $setVar[profile;$json[profile];$authorID]
  1196. $setVar[stats;$json[stats];$authorID]
  1197.  
  1198. $if[$and[$json[guide;kills]!=true;$json[profile;kd;kills]>=0]==true]
  1199.  
  1200. $var[guide;true]
  1201.  
  1202. $description[Hey! You got your first win! Woohoo! \:D
  1203. It is worth celebrating! Your first win will always be your best win.
  1204. Hey, if you feel confident enough, you can try fighting the floor boss! **vboss**
  1205. You can check the floor information to gain insights about the rewards and possible encounters. **vfloor**
  1206. Have fun! \:3;2]
  1207.  
  1208. $jsonSet[guide;kills;true]
  1209.  
  1210. $endif
  1211.  
  1212. $elseif[$json[hp;min]<=0]
  1213.  
  1214. $async[ded]
  1215. $replyIn[2s]
  1216. $sendEmbedMessage[$channelID;$reply;;;You died!
  1217. You lost $random gold.;$c[color];$username;$authorAvatar;$c[footer];$c[footerIcon];;$c[image];;no]
  1218.  
  1219. $endasync
  1220.  
  1221. $if[$json[fight;story]!=]$jsonUnset[fight;story]$endif
  1222. $if[$json[fight;name]!=]$jsonUnset[fight;name]$endif
  1223. $if[$json[profile;kd;deaths]==]
  1224. $jsonSet[profile;kd;deaths;1]
  1225. $else
  1226. $jsonSet[profile;kd;deaths;$sum[$json[profile;kd;deaths];1]]
  1227. $endif
  1228. $jsonSet[fight;effect;tick;0]
  1229. $jsonSetString[stats;-def;1.000]
  1230. $jsonSetString[stats;-dmg;1.000]
  1231. $setVar[mp;$json[mp];$authorID]
  1232. $setVar[hp;$json[hp];$authorID]
  1233. $setVar[fight;$json[fight];$authorID]
  1234. $setVar[profile;$json[profile];$authorID]
  1235. $setVar[stats;$json[stats];$authorID]
  1236.  
  1237. $if[$and[$json[guide;deaths]!=true;$json[profile;kd;deaths]>=0]==true]
  1238.  
  1239. $var[guide;true]
  1240.  
  1241. $description[Hey! You got your first death! Aw, man. You lost some gold from that!
  1242. You should have a little peep in the shop, you need a revive potion to revive yourself.
  1243. There’s also a bunch of useful things in the shop such as Healing Potions and Weapons. See what you like! </shop:$slashID[shop]>;2]
  1244.  
  1245. $jsonSet[guide;deaths;true]
  1246. $endif
  1247.  
  1248. $endif
  1249.  
  1250. $endif
  1251.  
  1252. $endif
  1253.  
  1254. $elseif[$customID==fight items $authorID]
  1255.  
  1256. $if[$message!=]
  1257.  
  1258. $var[type;$message]
  1259.  
  1260. $description[## Select the item.]
  1261.  
  1262. $removeButtons
  1263. $removeComponent[fight items $authorID]
  1264.  
  1265. $newSelectMenu[fight item-use $authorID;1;1;Item]
  1266.  
  1267. $var[a;0]
  1268. $var[n;1]
  1269.  
  1270. $eval[$repeatMessage[2;$repeatMessage[10;
  1271. %{DOL}%textSplit[%{DOL}%json[inv\;%{DOL}%toLowercase[%{DOL}%var[type\]\]\]\;,\]
  1272.  
  1273. %{DOL}%try
  1274. %{DOL}%if[%{DOL}%splitText[%{DOL}%var[n\]\]!=\]
  1275. %{DOL}%var[item%{DOL}%var[n\]\;%{DOL}%replaceText[%{DOL}%replaceText[%{DOL}%splitText[%{DOL}%var[n\]\]\;[\;\]\;\\]\;\]\]
  1276. %{DOL}%textSplit[%{DOL}%var[item%{DOL}%var[n\]\]\; \]
  1277.  
  1278. %{DOL}%addSelectMenuOption[fight item-use %{DOL}%authorID\;%{DOL}%toTitleCase[%{DOL}%json[shop\;%{DOL}%var[type\]\;%{DOL}%splitText[1\]\;name\]\]\;{"item.type":"%{DOL}%var[type\]","item.id":%{DOL}%splitText[1\]}\;%{DOL}%json[shop\;%{DOL}%var[type\]\;%{DOL}%splitText[1\]\;desc\]\]
  1279.  
  1280. %{DOL}%endif
  1281. %{DOL}%endtry
  1282.  
  1283. %{DOL}%var[a\;%{DOL}%sum[%{DOL}%var[a\]\;1\]\]
  1284. %{DOL}%var[n\;%{DOL}%sum[%{DOL}%var[n\]\;1\]\]
  1285. ]]
  1286. ]
  1287.  
  1288. $addButton[no;fight items $authorID;<<;secondary]
  1289.  
  1290. $else
  1291.  
  1292. $description[## What type of item?]
  1293.  
  1294. $removeButtons
  1295. $removeComponent[fight $authorID]
  1296. $removeComponent[fight item-use $authorID]
  1297.  
  1298. $newSelectMenu[fight items $authorID;1;1;Item Type]
  1299. $addSelectMenuOption[fight items $authorID;Potions;potions;Restore some of user’s status.]
  1300. $addButton[no;fight continue $authorID $sum[$getTimestamp;$getTimestamp];<<;secondary]
  1301.  
  1302. $endif
  1303.  
  1304. $elseif[$customID==dummy-exit $authorID]
  1305.  
  1306. $try$deleteMessage[$channelID;$messageID]$endtry
  1307.  
  1308. $if[$json[fight;name]!=]$jsonUnset[fight;name]$endif
  1309. $if[$json[fight;story]!=]$jsonUnset[fight;story]$endif
  1310.  
  1311. $elseif[$customID==fight end $authorID]
  1312.  
  1313. $try$deleteMessage[$channelID;$messageID]$endtry
  1314. $try$deleteMessage[$json[fight;chnl];$json[fight;id]]$endtry
  1315.  
  1316. $if[$json[fight;name]!=]
  1317. $sendEmbedMessage[$channelID;$reply;;;You lost your fight with $toTitleCase[$json[fight;name]] by forfeit. You took $multi[$optOff[$random];$json[fight;lv]] damage.;$c[color];$username;$authorAvatar;$c[footer];$c[footerIcon];;$c[image];;no]
  1318.  
  1319. $jsonSetString[stats;-def;1.000]
  1320. $jsonSetString[stats;-dmg;1.000]
  1321. $jsonSet[profile;effect;tick;0]
  1322.  
  1323. $if[$json[fight;name]!=]$jsonUnset[fight;name]$endif
  1324. $if[$json[fight;story]!=]$jsonUnset[fight;story]$endif
  1325. $else
  1326. $ephemeral
  1327. $removeButtons
  1328. You’re not fighting anyone.
  1329. $endif
  1330.  
  1331. $endif
  1332.  
  1333. $if[$var[exp]!=]
  1334. $var[int;$var[exp]]
  1335.  
  1336. $jsonSetString[level;exp;$sum[$json[level;exp];$var[int]]]
  1337. $jsonSetString[element;exp;$sum[$json[element;exp];$random[$divide[$var[int];2];$var[int]]]]
  1338. $setVar[gold;$sum[$getVar[gold;$authorID];$var[gold]];$authorID]
  1339.  
  1340. $async[level]
  1341. $replyIn[4s]
  1342.  
  1343. $var[a;0]
  1344. $var[n;1]
  1345. $var[exp.type;level]
  1346. $var[lv.txt;lv]
  1347. $eval[$repeatMessage[5;$repeatMessage[10;
  1348. %{DOL}%if[%{DOL}%json[%{DOL}%var[exp.type\]\;exp\]>=%{DOL}%json[%{DOL}%var[exp.type\]\;maxEXP\]\]
  1349. %{DOL}%var[excess\;%{DOL}%sub[%{DOL}%json[%{DOL}%var[exp.type\]\;exp\]\;%{DOL}%json[%{DOL}%var[exp.type\]\;maxEXP\]\]\]
  1350. %{DOL}%if[%{DOL}%var[excess\]<=0\]
  1351. %{DOL}%var[excess\;0\]
  1352. %{DOL}%endif
  1353. %{DOL}%jsonSetString[%{DOL}%var[exp.type\]\;maxEXP\;%{DOL}%sum[%{DOL}%divide[%{DOL}%multi[55\;%{DOL}%json[%{DOL}%var[exp.type\]\;maxEXP\]\]\;100\]\;%{DOL}%json[%{DOL}%var[exp.type\]\;maxEXP\]\]\]
  1354. %{DOL}%jsonSet[%{DOL}%var[exp.type\]\;%{DOL}%var[lv.txt\]\;%{DOL}%sum[%{DOL}%json[%{DOL}%var[exp.type\]\;%{DOL}%var[lv.txt\]\]\;1\]\]
  1355. %{DOL}%jsonSet[%{DOL}%var[exp.type\]\;exp\;%{DOL}%var[excess\]\]
  1356. %{DOL}%jsonSet[hp\;max\;%{DOL}%sum[100\;%{DOL}%multi[25\;%{DOL}%json[level\;lv\]\]\]\]
  1357. %{DOL}%jsonSet[hp\;min\;%{DOL}%json[hp\;max\]\]
  1358. %{DOL}%var[a\;%{DOL}%sum[%{DOL}%var[a\]\;1\]\]
  1359. %{DOL}%endif
  1360. %{DOL}%var[n\;%{DOL}%sum[%{DOL}%var[n\]\;1\]\]
  1361. ]]
  1362. ]
  1363.  
  1364. $if[$var[a]>0]
  1365. $sendMessage[
  1366. **$username**
  1367. You just leveled up! `$sub[$json[level;lv];$var[a]] > $json[level;lv]`
  1368. + $multi[$var[a];2] Skill Points]
  1369.  
  1370. $jsonSet[stats;sp;$multi[$var[a];2]]
  1371. $jsonSet[hp;max;$sum[100;$multi[25;$json[level;lv]]]]
  1372. $jsonSet[hp;min;$json[hp;max]]
  1373. $endif
  1374.  
  1375. $endif
  1376.  
  1377. $async[element]
  1378. $replyIn[1s]
  1379.  
  1380. $var[a;0]
  1381. $var[n;1]
  1382. $var[exp.type;element]
  1383. $var[lv.txt;level]
  1384. $eval[$repeatMessage[5;$repeatMessage[10;
  1385. %{DOL}%if[%{DOL}%json[%{DOL}%var[exp.type\]\;exp\]>=%{DOL}%json[%{DOL}%var[exp.type\]\;maxEXP\]\]
  1386. %{DOL}%var[excess\;%{DOL}%sub[%{DOL}%json[%{DOL}%var[exp.type\]\;exp\]\;%{DOL}%json[%{DOL}%var[exp.type\]\;maxEXP\]\]\]
  1387. %{DOL}%if[%{DOL}%var[excess\]<=0\]
  1388. %{DOL}%var[excess\;0\]
  1389. %{DOL}%endif
  1390. %{DOL}%jsonSetString[%{DOL}%var[exp.type\]\;maxEXP\;%{DOL}%sum[%{DOL}%divide[%{DOL}%multi[55\;%{DOL}%json[%{DOL}%var[exp.type\]\;maxEXP\]\]\;100\]\;%{DOL}%json[%{DOL}%var[exp.type\]\;maxEXP\]\]\]
  1391. %{DOL}%jsonSet[%{DOL}%var[exp.type\]\;%{DOL}%var[lv.txt\]\;%{DOL}%sum[%{DOL}%json[%{DOL}%var[exp.type\]\;%{DOL}%var[lv.txt\]\]\;1\]\]
  1392. %{DOL}%jsonSet[%{DOL}%var[exp.type\]\;exp\;%{DOL}%var[excess\]\]
  1393. %{DOL}%jsonSet[hp\;max\;%{DOL}%sum[100\;%{DOL}%multi[25\;%{DOL}%json[level\;lv\]\]\]\]
  1394. %{DOL}%jsonSet[hp\;min\;%{DOL}%json[hp\;max\]\]
  1395. %{DOL}%var[a\;%{DOL}%sum[%{DOL}%var[a\]\;1\]\]
  1396. %{DOL}%endif
  1397. %{DOL}%var[n\;%{DOL}%sum[%{DOL}%var[n\]\;1\]\]
  1398. ]]
  1399. ]
  1400.  
  1401. $if[$var[a]>0]
  1402. $sendMessage[
  1403. **$username**
  1404. Your element just leveled up! `$sub[$json[element;level];$var[a]] > $json[element;level]`]
  1405. $endif
  1406.  
  1407. $setVar[stats;$json[stats];$authorID]
  1408. $setVar[level;$json[level];$authorID]
  1409. $setVar[hp;$json[hp];$authorID]
  1410. $setVar[element;$json[element];$authorID]
  1411. $endif
  1412.  
  1413. $endasync
  1414.  
  1415. $endasync
  1416.  
  1417. $if[$and[$json[profile;kd;kills]>=2;$json[guide;stats]!=true]==true]
  1418.  
  1419. $var[guide;true]
  1420.  
  1421. $description[Don’t forget to check your stats **vstats** once in a while! Gotta keep track of our progress, y’know?
  1422. Use **vability** to check your element stats and **vskills** to check your skills.
  1423. You can also use **vskills** to check a specific element’s skills.
  1424. > example: vskill fire
  1425. Goodluck!;2]
  1426.  
  1427. $jsonSet[guide;stats;true]
  1428.  
  1429. $endif
  1430.  
  1431. $endif
  1432.  
  1433. $setVar[story;$json[story];$authorID]
  1434. $setVar[stats;$json[stats];$authorID]
  1435. $setVar[fight;$json[fight];$authorID]
  1436. $setVar[profile;$json[profile];$authorID]
  1437. $setVar[guide;$json[guide];$authorID]
  1438. $setVar[mp;$json[mp];$authorID]
  1439. $setVar[hp;$json[hp];$authorID]
  1440. $setVar[inventory;$json[inv];$authorID]
  1441.  
  1442. $catch
  1443.  
  1444. $eval[$getVar[errorMsg]]
  1445.  
  1446. $endtry
  1447.  
  1448. $else
  1449. $ephemeral
  1450. Your data is outdated. Please use the </update:$slashID[update]> command to update.
  1451. $endif
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement