AlferZep

Main Fight Command ©

Jun 18th, 2024
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.89 KB | None | 0 0
  1. $nomention
  2. $var[user;$authorID]
  3.  
  4. $var[ability;$getVar[data.ability]]
  5.  
  6. $jsonParse[
  7. {
  8. "element":$getVar[element;$var[user]],
  9. "profile":$getVar[profile;$var[user]],
  10. "fight":$getVar[fight;$authorID],
  11. "hp":$getVar[hp;$authorID],
  12. "ability":$var[ability],
  13. "game":$getVar[profile],
  14. "floor":$getVar[floor;$authorID],
  15. "stats":$getVar[stats;$authorID],
  16. "floordata":$getVar[data.floor]
  17. }
  18. ]
  19.  
  20. $if[$json[hp;min]>0]
  21.  
  22. $if[$json[profile;version]==$json[game;version]]
  23.  
  24. $jsonSet[fight;cd;15]
  25. $cooldown[4s;]
  26.  
  27. $try
  28.  
  29. $if[$json[profile;element;name]!=none]
  30.  
  31. $if[$json[ability;$json[profile;element;name]]!=]
  32. $var[element;$json[profile;element;name]]
  33. $else
  34. $var[element;none]
  35. $endif
  36.  
  37. $var[floor;$json[floordata;$sub[$json[floor;current];1]]]
  38.  
  39. $setVar[fight;$json[fight];$authorID]
  40. $setVar[interface;{};$authorID]
  41. $jsonParse[
  42. {
  43. "element":$getVar[element;$var[user]],
  44. "profile":$getVar[profile;$var[user]],
  45. "fight":$getVar[fight;$authorID],
  46. "hp":$getVar[hp;$authorID],
  47. "skill1":$json[ability;$var[element];1],
  48. "skill2":$json[ability;$var[element];2],
  49. "skill3":$json[ability;$var[element];3],
  50. "devskill1":$json[ability;dev;1],
  51. "mobs":$getVar[data.mobs],
  52. "floor":$var[floor],
  53. "level":$getVar[level;$authorID],
  54. "stats":$getVar[stats;$authorID],
  55. "assets":$getVar[assets],
  56. "interface":$getVar[interface;$authorID],
  57. "story":$getVar[story;$authorID]
  58. }
  59. ]
  60.  
  61. $if[$json[fight;name]!=]
  62.  
  63. $ephemeral
  64. $author[$username]
  65. $authorIcon[$authorAvatar]
  66. $description[You are currently fighting someone, this command cannot be used yet.
  67. > [Jump to fight\](https://discord.com/channels/$json[fight;srvr]/$json[fight;chnl]/$json[fight;id])]
  68. $addButton[no;fight end $authorID;End Fight;danger]
  69.  
  70. $elseif[$json[fight;story]==true]
  71.  
  72. $author[$username]
  73. $authorIcon[$authorAvatar]
  74. $description[You are currently in a story fight, this command cannot be used yet.
  75. Use the **vstory** command and continue the story or press the button to continue.]
  76. $addButton[no;story start $authorID "$json[story;name]";Continue Story;secondary]
  77.  
  78. $else
  79.  
  80. $if[$sum[$json[fight;cd];$json[fight;last]]<=$getTimestamp]
  81.  
  82. $enableDecimals[yes]
  83. $var[chance;$round[$random[0;1];3]]
  84. $enableDecimals[no]
  85.  
  86. $jsonSetString[fight;last;$getTimestamp]
  87.  
  88. $if[$var[chance]>=0.01]
  89. $var[enemy;$json[floor;mobs;$random[0;$jsonArrayCount[floor;mobs]]]]
  90. $else
  91. $var[enemy;sans]
  92. $endif
  93.  
  94. $var[avatar;$json[mobs;stats;$var[enemy];avatar]]
  95.  
  96. $if[$json[mobs;stats;$var[enemy]]!=]
  97. $var[hp;$json[mobs;stats;$var[enemy];hp]]
  98. $var[def;$json[mobs;stats;$var[enemy];def]]
  99.  
  100. $else
  101. $var[hp;$json[mobs;stats;other;hp]]
  102. $var[def;$json[mobs;stats;other;def]]
  103.  
  104. $endif
  105.  
  106. $if[$var[avatar]==]
  107. $var[avatar;https://cdn.discordapp.com/attachments/1101860440465752065/1122147783001002134/A3818875-1BEA-4510-9FAF-B449B9DD6485.png]
  108. $endif
  109.  
  110. $if[$var[enemy]==]
  111. $var[enemy;error]
  112. $endif
  113.  
  114. $var[name;$var[enemy]]
  115.  
  116. $jsonSet[profile;fight;name;$var[name]]
  117.  
  118. $if[$json[mobs;stats;$var[name];desc]!=]
  119. $var[desc;$json[mobs;stats;$var[name];desc]]
  120. $else
  121. $var[desc;...]
  122. $endif
  123.  
  124. $if[$json[mobs;stats;$var[name]]!=]
  125. $var[hp;$json[mobs;stats;$var[name];hp]]
  126. $var[def;$json[mobs;stats;$var[name];def]]
  127.  
  128. $else
  129. $var[hp;$json[mobs;stats;other;hp]]
  130. $var[def;$json[mobs;stats;other;def]]
  131.  
  132. $endif
  133.  
  134. $if[$json[mobs;stats;$var[enemy];lv]==]
  135. $var[lv;$random[$json[floor;lv;min];$json[floor;lv;max]]]
  136. $else
  137. $var[lv;$json[mobs;stats;$var[enemy];lv]]
  138. $endif
  139.  
  140. $jsonSet[fight;lv;$var[lv]]
  141. $setVar[fightAvatar;$var[avatar]]
  142.  
  143. $if[1==1]
  144. $reply
  145. $author[$username]
  146. $authorIcon[$authorAvatar]
  147. $description[## $json[assets;skull] ENCOUNTER $json[assets;skull]
  148. ### $toTitleCase[$var[name]] LV$var[lv]
  149. HP: $multi[$var[hp];$var[lv]]
  150. DEF: $var[def]
  151. - `“$var[desc]”`]
  152. $footer[You have 15 seconds to fight]
  153. $thumbnail[$var[avatar]]
  154. $color[#FFFFFF]
  155. $endif
  156.  
  157. $if[1==2]
  158. $var[msg;$sendEmbedMessage[$channelID
  159. ;$c[content]
  160. ;$c[title]
  161. ;$c[Title URL]
  162. ;## $json[assets;skull] ENCOUNTER $json[assets;skull]
  163. ### $toTitleCase[$var[name]] LV$var[lv]
  164. HP: $multi[$var[hp];$var[lv]]
  165. DEF: $var[def]
  166. - `“$var[desc]”`
  167. ;#FFFFFF
  168. ;$username
  169. ;$authorAvatar
  170. ;You have 15 seconds to fight
  171. ;$c[ficon]
  172. ;$var[avatar]
  173. ;$c[img]
  174. ;$c[Add timestamp]
  175. ;yes]]
  176. $endif
  177.  
  178. $setVar[profile;$json[profile];$authorID]
  179. $setVar[fight;$json[fight];$authorID]
  180.  
  181. $addButton[no;fight hunt $authorID $getTimestamp;Fight;danger;;;$var[msg]]
  182.  
  183. $else
  184.  
  185. $reply
  186. $author[$username]
  187. $authorIcon[$authorAvatar]
  188. $description[Cooldown: <t:$sum[$json[fight;cd];$json[fight;last]]:R>]
  189.  
  190. $endif
  191.  
  192. $endif
  193.  
  194. $else
  195.  
  196. $reply
  197. $description[You haven't rolled yet.]
  198. $footer[tip: vroll to roll an element]
  199.  
  200. $endif
  201.  
  202. $catch
  203.  
  204. $eval[$getVar[errorMsg]]
  205.  
  206. $endtry
  207.  
  208. $else
  209. $ephemeral
  210. Your data is outdated. Please use the </update:$slashID[update]> command to update.
  211. $endif
  212.  
  213. $else
  214. $ephemeral
  215. You’re dead, you can’t fight. Buy a Revive Potion in </shop:$slashID[shop]> to revive yourself.
  216. $endif
Advertisement
Add Comment
Please, Sign In to add comment