SHARE
TWEET

Untitled

a guest Oct 21st, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function lam.pickForm(formType)
  2.   if not formType then
  3.     lam.echo("No argument given to lam.pickForm", "red")
  4.     return
  5.   end
  6.   local valid = {"iceArms", "iceLegs", "iceHinder", "dust"}
  7.   if not table.contains(valid, formType) then
  8.     lam.echo("Invalid argument given to lam.pickForm: " .. formType, "red")
  9.     return
  10.   end
  11.   local stance = lam.getStance()
  12.   local power = tonumber(gmcp.Char.Vitals.pow)
  13.   if formType == "dust" then
  14.     lam.nextForm = "dust"
  15.     if not lam.selfHasAff("recklessness") then
  16.       if power > 6 then
  17.         lam.boostNext = true
  18.       end
  19.       if target.shielded and power > 7 then
  20.         lam.boostNext = false
  21.         lam.tahtaiNext = true
  22.       end
  23.     end
  24.   elseif formType == "iceHinder" then
  25.     lam.nextForm = "icehinder"
  26.     if not lam.selfHasAff("recklessness") then
  27.       if power > 6 then
  28.         lam.boostNext = true
  29.       end
  30.       if target.shielded and power > 7 then
  31.         lam.boostNext = false
  32.         lam.tahtaiNext = true
  33.       end
  34.     end
  35.   elseif formType == "iceLegs" then
  36.     if stance == "n" then
  37.       lam.nextForm = "dmg"
  38.     elseif stance == "b" then
  39.       lam.nextForm = "rlm"
  40.     elseif stance == "th" then
  41.       lam.nextForm = "rlm"
  42.       lam.boostNext = true
  43.     elseif stance == "c" then
  44.       lam.nextForm = "rlm"
  45.       if target.hasAff("RLegMutilated") and target.hasAff("LLegMutilated") then
  46.         lam.nextForm = "sk"
  47.       end
  48.       if power > 7 then
  49.         lam.boostNext = true
  50.       end
  51.     elseif stance == "sh" then
  52.       lam.nextForm = "icehinder"
  53.       if target.hasAff("RLegMutilated") and not target.hasAff("LLegMutilated") then
  54.         lam.nextForm = "rlm"
  55.       elseif target.hasAff("LLegMutilated") and not target.hasAff("RLegMutilated") then
  56.         lam.nextForm = "llm"
  57.       end
  58.       if target.hasAff("Prone") then
  59.         lam.nextForm = "sk"
  60.         if target.hasAff("RLegMutilated") and target.hasAff("LLegMutilated") then
  61.           lam.nextForm = "dust"
  62.         end
  63.       end
  64.       if (lam.nextForm == "rlm" or lam.nextForm == "llm") and target.shielded then
  65.         lam.tahtaiNext = true
  66.       end
  67.     elseif stance == "k" then
  68.       lam.nextForm = "icehinder"
  69.       if target.hasAff("RLegMutilated") and not target.hasAff("LLegMutilated") then
  70.         if power > 1 then
  71.           lam.nextForm = "llm"
  72.           lam.regressNext = true
  73.         end
  74.       elseif target.hasAff("LLegMutilated") and not target.hasAff("RLegMutilated") then
  75.         if power > 1 then
  76.           lam.nextForm = "rlm"
  77.           lam.regressNext = true
  78.         else
  79.           lam.nextForm = "icehinder"
  80.         end
  81.       else
  82.         if target.hasAff("LLegMutilated") and target.hasAff("RLegMutilated") then
  83.           lam.nextForm = "icehinder"
  84.         else
  85.           if power > 1 then
  86.             lam.nextForm = "rlm"
  87.             lam.regressNext = true
  88.           else
  89.             lam.nextForm = "icehinder"
  90.           end
  91.         end
  92.       end
  93.     end
  94.     -- end ice legs
  95.   elseif formType == "iceArms" then
  96.     if stance == "n" then
  97.       lam.nextForm = "dmg"
  98.     elseif stance == "b" then
  99.       lam.nextForm = "rlm"
  100.     elseif stance == "th" then
  101.       lam.nextForm = "rlm"
  102.       lam.boostNext = true
  103.     elseif stance == "c" then
  104.       lam.nextForm = "ram"
  105.       if target.hasAff("RArmMutilated") and not target.hasAff("LArmMutilated") then
  106.         lam.nextForm = "lam"
  107.       elseif target.hasAff("RArmMutilated") and target.hasAff("LArmMutilated") then
  108.         lam.nextform = "sk"
  109.       end
  110.       if power > 7 then
  111.         lam.boostNext = true
  112.       end
  113.     elseif stance == "sh" then
  114.       lam.nextForm = "icehinder"
  115.       if target.hasAff("RArmMutilated") and not target.hasAff("RArmDamaged") then
  116.         lam.nextForm = "ram"
  117.       elseif target.hasAff("LArmMutilated") and not target.hasAff("LArmDamaged") then
  118.         lam.nextForm = "lam"
  119.       end
  120.       if (lam.nextForm == "ram" or lam.nextForm == "lam") and target.shielded then
  121.         lam.tahtaiNext = true
  122.       end
  123.     elseif stance == "k" then
  124.       lam.nextForm = "icehinder"
  125.       if target.hasAff("RArmMutilated") and not target.hasAff("LArmMutilated") then
  126.         if power > 1 then
  127.           lam.nextForm = "lam"
  128.           lam.regressNext = true
  129.         end
  130.       elseif target.hasAff("LArmMutilated") and not target.hasAff("RArmMutilated") then
  131.         if power > 1 then
  132.           lam.nextForm = "ram"
  133.           lam.regressNext = true
  134.         end
  135.       end
  136.     end
  137.     -- end ice arms
  138.   end
  139.   -- end form logic
  140. end
  141.  
  142. function lam.queueForm(form)
  143.   if not form then
  144.     form = lam.nextForm
  145.   end
  146.   if not lam.forms[form] then
  147.     lam.echo("Bad argument given to lam.queueForm: " .. form .. " not found in form db.", "red")
  148.     return
  149.   end
  150.   form = lam.forms[form]
  151.   if target.shielded then
  152.     form = lam.forms[form.raze]
  153.   end
  154.   local formString = form.short
  155.   local targ = target.name .. " "
  156.   local stance = lam.getStance()
  157.   local actionTable = {"sm clear"}
  158.   if not lam.artifactPipe then
  159.     table.insert(actionTable, "sm add free light pipes")
  160.   end
  161.   -- do poison stuff
  162.   if form.isRaze then
  163.     table.insert(actionTable, "sm add free wipe right|envenom right with " .. form.poison)
  164.   else
  165.     if form[stance] then
  166.       table.insert(
  167.         actionTable,
  168.         "sm add free wipe left|wipe right|envenom left with " ..
  169.         form[stance][1] ..
  170.         "|envenom right with " ..
  171.         form[stance][2]
  172.       )
  173.     end
  174.   end
  175.   -- beast poison spit too
  176.   if lam.beastBal and not target.shielded then
  177.     table.insert(actionTable, "sm add free beast order spit " .. target.name)
  178.   end
  179.   -- instakill stuff
  180.   if stance == "c" and target.hemo > 770 and tonumber(gmcp.Char.Vitals.pow) > 4 then
  181.     formString = formString .. " burst"
  182.     table.insert(actionTable, "sm add kata perform " .. targ .. formString)
  183.     lam.warning(targ:upper() .. "IS PREPPED FOR INSTAKILL, BURSTING HEMO", "orange_red")
  184.     lam.warning(targ:upper() .. "IS PREPPED FOR INSTAKILL, BURSTING HEMO", "orange_red")
  185.     if lam.cc then
  186.       mm.cc("Bursting hemorrhaging on " .. target.name .. ", HINDER THEM!")
  187.     end
  188.     lam.sendTable(actionTable)
  189.     return
  190.   end
  191.   -- prep for usual form stuff
  192.   if lam.boostNext and tonumber(gmcp.Char.Vitals.pow) > 1 and not lam.tahtaiNext then
  193.     formString = formString .. "+"
  194.     lam.boostNext = false
  195.   end
  196.   if lam.regressNext and tonumber(gmcp.Char.Vitals.pow) > 1 then
  197.     formString = formString .. " tahto'sho"
  198.     lam.regressNext = false
  199.   end
  200.   if lam.tahtaiNext and tonumber(gmcp.Char.Vitals.pow) > 2 then
  201.     formString = "=" .. formString
  202.     lam.tahtaiNext = false
  203.     lam.boostNext = false
  204.   end
  205.   -- finish up
  206.   table.insert(actionTable, "sm add kata perform " .. targ .. formString)
  207.   lam.echo("Attempting form: " .. formString)
  208.   lam.sendTable(actionTable)
  209.   lam.nextForm = form.short
  210.   return
  211. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top