Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2014
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.39 KB | None | 0 0
  1. wrackAff = "paralyse"
  2. trueAff1 = ""
  3. trueAff2 = ""
  4. aignore = "nothing"
  5.  
  6. temperNums = {
  7. ["choleric"] = 0,
  8. ["melancholic"] = 0,
  9. ["phlegmatic"] = 0,
  10. ["sanguine"] = 0
  11. };
  12.  
  13. shortHum = {
  14. ["c"] = "choleric",
  15. ["m"] = "melancholic",
  16. ["p"] = "phlegmatic",
  17. ["s"] = "sanguine"
  18. };
  19.  
  20. wrackAffs = {
  21. ["choleric"] = {
  22. ["nausea"] = 0,
  23. ["sensitivity"] = 2,
  24. ["slickness"] = 3
  25. },
  26. ["melancholic"] = {
  27. ["stupidity"] = 0,
  28. ["anorexia"] = 2,
  29. ["impatience"] = 3
  30. },
  31. ["phlegmatic"] = {
  32. ["clumsiness"] = 0,
  33. ["weariness"] = 2,
  34. ["asthma"] = 3
  35. },
  36. ["sanguine"] = {
  37. ["haemophilia"] = 0,
  38. ["recklessness"] = 2,
  39. ["paralysis"] = 3
  40. },
  41. };
  42.  
  43. wrackPrio = { "paralysis", "impatience", "asthma",
  44. "clumsiness", "haemophilia", "nausea", "sensitivity",
  45. "stupidity", "weariness", "recklessness",
  46. "slickness", "anorexia"};
  47. wrackDmg = { "paralysis", "sensitivity", "clumsiness", "asthma",
  48. "impatience", "haemophilia", "nausea"};
  49.  
  50. wrackBleed = { "paralysis", "haemophilia", "sensitivity", "clumsiness", "asthma",
  51. "impatience", "nausea"};
  52.  
  53. herbWrackPrio = { "paralysis", "impatience", "asthma",
  54. "clumsiness", "haemophilia", "nausea",
  55. "sensitivity"};
  56.  
  57. wrackPrioConv = {
  58. ["paralysis"] = "paralyse",
  59. ["impatience"] = "impatience",
  60. ["asthma"] = "kalmia",
  61. ["clumsiness"] = "xentio",
  62. ["stupidity"] = "stupidity",
  63. ["recklessness"] = "eurypteria",
  64. ["haemophilia"] = "haemophilia",
  65. ["sensitivity"] = "sensitivity",
  66. ["nausea"] = "euphorbia",
  67. ["slickness"] = "gecko",
  68. ["anorexia"] = "slike",
  69. ["weariness"] = "vernalius"
  70. };
  71.  
  72. wrackHum = {
  73. ["paralysis"] = "sanguine",
  74. ["impatience"] = "melancholic",
  75. ["asthma"] = "phlegmatic",
  76. ["clumsiness"] = "phlegmatic",
  77. ["stupidity"] = "melancholic",
  78. ["recklessness"] = "sanguine",
  79. ["haemophilia"] = "sanguine",
  80. ["sensitivity"] = "choleric",
  81. ["nausea"] = "choleric",
  82. ["slickness"] = "choleric",
  83. ["anorexia"] = "melancholic",
  84. ["weariness"] = "phlegmatic",
  85. };
  86.  
  87. function numTempered()
  88. local i = 0
  89. for k,v in pairs(temperNums) do
  90. if v > 0 then
  91. i = i + 1
  92. end
  93. end
  94. return i
  95. end
  96.  
  97. function minHumour(humour)
  98. local minC = 100
  99. local minT = "choleric"
  100. for k,v in pairs(humour) do
  101. if temperNums[v] < minC then
  102. minC = temperNums[v]
  103. minT = v
  104. end
  105. end
  106. return minT
  107. end
  108.  
  109. function canTrueWrack(aff1, aff2, humour)
  110. local temper1 = wrackHum[aff1]
  111. local temper2 = wrackHum[aff2]
  112. if canWrack(temper1, aff1) and canWrack(temper2, aff2) then
  113. return minHumour(humour)
  114. elseif canWrack(temper1, aff1) then
  115. if canTemperWrack(temper2, aff2) then
  116. return temper2
  117. end
  118. elseif canWrack(temper2, aff2) then
  119. if canTemperWrack(temper1, aff1) then
  120. return temper1
  121. end
  122. end
  123. return "none"
  124. end
  125.  
  126. function canWrack(temper, v)
  127. if temperNums[temper] >= wrackAffs[temper][v] then
  128. return true
  129. else
  130. return false
  131. end
  132. end
  133.  
  134. function canTemperWrack(temper, v)
  135. if affInWrackPool()+affInTemper(temper) > 1 then
  136. if temperNums[temper] + 3 >= wrackAffs[temper][v] then
  137. return true
  138. end
  139. else
  140. if temperNums[temper] + affInWrackPool()+affInTemper(temper)+1 >= wrackAffs[temper][v] then
  141. return true
  142. end
  143. end
  144. return false
  145. end
  146.  
  147. function autoWrack(humour, prio)
  148. local wrack1 = ""
  149. local wrack2 = ""
  150. local temperVar = ""
  151. local v1 = ""
  152. local loopTmp = true
  153. for k,v in ipairs(prio) do
  154. for kk, vv in ipairs(prio) do
  155. if vv ~= v and (not tarAff[wrackPrioConv[v]] and not tarAff[wrackPrioConv[vv]])
  156. and wrackHum[v]~=wrackHum[vv] and aignore ~= wrackPrioConv[v] and aignore ~= wrackPrioConv[vv] then
  157. if table.contains(humour, canTrueWrack(v, vv, humour)) and loopTmp then
  158. send("temper " ..target.. " " ..canTrueWrack(v, vv, humour))
  159. truewrackWhat(v, vv)
  160. loopTmp = false
  161. end
  162. end
  163. end
  164. end
  165. for k,v in ipairs(wrackPrio) do
  166. if not tarAff[wrackPrioConv[v]] and aignore ~= wrackPrioConv[v] then
  167. if loopTmp then
  168. send("temper " ..target.. " " ..minHumour(humour))
  169. end
  170. if v == "paralysis" then
  171. torcOrWrack("paralyse", humour)
  172. else
  173. wrackWhat(v)
  174. end
  175. return
  176. end
  177. end
  178. end
  179.  
  180. function wrackWhat(aff)
  181. wrackAff = wrackPrioConv[aff]
  182. send("wrack " ..target.. " " ..aff)
  183. end
  184.  
  185. function truewrackWhat(aff1, aff2)
  186. trueAff1 = wrackPrioConv[aff1]
  187. trueAff2 = wrackPrioConv[aff2]
  188. send("truewrack " ..target.. " " ..aff1.. " " ..aff2)
  189. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement