Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------------
- -- Put your Lua functions here. --
- -- --
- -- Note that you can also use external Scripts --
- -------------------------------------------------
- function monkAttack()
- km.attackCommands = {}
- table.insert(km.attackCommands, "quickdismount")
- local tar = tmp.target
- local t = cdb.chars[tar:title()]
- local kai = tonumber(gmcp.Char.Vitals.kai)
- monkBlackout(t, tar)
- -- if t.defs.shielded then
- -- table.insert(km.attackCommands, "sck "..tar)
- -- else
- if not monkFitness(t, tar) then
- if not monkKaiPush(t, tar) then
- if not monkKaido(t, tar) then
- monkCombo(t, tar)
- monkTelepathy(t, tar)
- end
- end
- end
- -- end
- if affs.diag then
- km.attackCommands = {"diagnose",}
- end
- if #gmcp.Room.Players >= 3 then
- table.insert(km.attackCommands, 1, "get body")
- end
- table.insert(km.attackCommands, 1, "kipup")
- parry()
- table.insert(km.attackCommands, 2, "guard "..defs.parry.limb)
- if o.vitals.wield_left ~= "empty" then
- send("wear buckler234212")
- send("secure left")
- end
- if o.vitals.wield_right ~= "empty" then
- send("secure right")
- end
- if #inv.pipes.filled == 0 then send("pipelist") end
- if #inv.pipes.filled < 3 then
- local pipeTypes = {"elm", "valerian", "skullcap",}
- for _,v in ipairs(pipeTypes) do
- if not table.contains(inv.pipes.filled, v) then
- table.insert(km.attackCommands, 2, "put "..v.." in emptypipe"..o.config_sep.."outc "..v)
- end
- end
- end
- -- if defs.active.kai_recursion and not defs.active.kai_boost then table.insert(km.attackCommands, "kai boost") end
- if o.stats.mounted then send("quickdismount") end
- -- table.insert(km.attackCommands, "combo "..tar.." jpk ucp ucp")
- if #km.attackCommands >= 10 then send("pipelist") end
- -- if #km.attackCommands < 10 then table.insert(km.attackCommands, "guard right arm") end
- local queueCommand = table.concat(km.attackCommands, o.config_sep)
- if km.beheading then queueCommand = "" end
- send("qeb "..queueCommand)
- end
- function monkFitness(t, tar)
- if fs.cd.fitness then return false end
- if affs.current.asthma
- and affs.current.slickness
- and affs.current.anorexia
- and (affs.current.paresis or affs.current.stupidity or affs.current.impatience)
- then
- table.insert(km.attackCommands, "fitness")
- return true
- end
- return false
- end
- function monkKaiPush(t, tar)
- if fs.cd.mindPush then return false end
- local affList = {}
- for aff, v in pairs(affs.current) do
- if table.contains(affs.lib.tree, aff) and v and aff ~= "hidden" then
- table.insert(affList, aff)
- end
- end
- if #affList > 3
- or (t.class == "syssin" and (affs.current.hypochondria or affs.current.hypersomnia or affs.current.impatience or affs.current.confusion))
- then
- cecho("\n<cyan>Mind Push dat bitch!")
- table.insert(km.attackCommands, "mind push "..tar)
- return true
- end
- return false
- end
- function monkKaido(t, tar)
- local kai = tonumber(gmcp.Char.Vitals.kai)
- if kai >= 40 and ((t.affs.left_leg_damaged and t.restoring ~= "left leg") or (t.affs.right_leg_damaged and t.restoring ~= "right leg")) then
- local brokenLimbs = checkBrokenLimbs(t)
- if brokenLimbs < 2 or (brokenLimbs < 3 and not t.traits.prone) then
- table.insert(km.attackCommands, "kai cripple "..tar)
- return true
- end
- end
- if kai >= 20 and km.kai_strike_target and not (t.affs.kai_strike_left_leg or t.affs.kai_strike_right_leg or t.affs.kai_stright_left_arm or t.affs.kai_stright_right_arm) then
- local what = km.kai_strike_target
- table.insert(km.attackCommands, "kai strike "..tar.." "..what)
- return true
- end
- return false
- end
- function checkBrokenLimbs(t)
- local numberOfBreaks = 0
- local limbs = {
- "left_leg_broken",
- "left_arm_broken",
- "right_leg_broken",
- "right_arm_broken",
- }
- for _, limb in ipairs(limbs) do
- if t.affs[limb] then
- numberOfBreaks = numberOfBreaks + 1
- end
- end
- return numberOfBreaks
- end
- function monkTelepathy(t, tar)
- if t.class == "Shapeshifter" then return false end
- if affs.current.right_leg_broken and affs.current.left_leg_broken then return end
- local afflictions = {
- "indifference",
- "paresis",
- "stupidity",
- }
- local useAff = "indifference"
- for _, aff in ipairs(afflictions) do
- if aff == "paresis" and t.affs.paralysis then
- elseif not t.affs[aff] then
- useAff = aff
- break
- end
- end
- local affCmds = {
- ["indifference"] = "mind indifference "..tar,
- ["stupidity"] = "mind stupidity "..tar,
- ["paresis"] = "mind paralyse "..tar,
- }
- local cmd = affCmds[useAff]
- table.insert(km.attackCommands, cmd)
- end
- function monkBlackout(t, tar)
- if km.shouldBlackout then
- table.insert(km.attackCommands, "mind blackout")
- return true
- end
- return false
- end
- function monkCombo(t, tar)
- if gmcp.Char.Vitals.mounted ~= "0" then
- table.insert(km.attackCommands, "quickdismount")
- end
- local stance = "tgs"
- local limb = monkTarget(t, tar)
- local secondaryLimb = monkSecondaryTarget(t, tar)
- local kicks = {
- ["right arm"] = "mnk right",
- ["left arm"] = "mnk left",
- ["right leg"] = "snk right",
- ["left leg"] = "snk left",
- ["torso"] = "sdk",
- ["head"] = "wwk",
- }
- --[[
- local punches = {
- ["right arm"] = "spp right spp right",
- ["left arm"] = "spp left spp left",
- ["right leg"] = "hfp right hfp right",
- ["left leg"] = "hfp left hfp left",
- ["torso"] = "hkp hkp",
- ["head"] = "ucp ucp",
- }
- --]]
- --[[]]
- local punches = {
- ["right arm"] = "jbp jbp",
- ["left arm"] = "jbp jbp",
- ["right leg"] = "jbp jbp",
- ["left leg"] = "jbp jbp",
- ["torso"] = "jbp jbp",
- ["head"] = "jbp jbp",
- }
- --]]
- local kick = kicks[limb]
- if t.affs.left_arm_damaged and t.affs.right_arm_damaged and not t.affs.numb_arms then
- kick = "cmk"
- end
- local cmd = "combo "..tar.." "..kick.." "..punches[secondaryLimb]
- if t.traits.prone and not t.affs.impaled and kick ~= "cmk" then
- cmd = cmd:gsub("mnk right", "wrt right arm"):gsub("mnk left", "wrt left arm"):gsub("snk right", "wrt right leg"):gsub("snk left", "wrt left leg")
- cmd = cmd:gsub("wwk", "wrt ##"):gsub("sdk", "wrt ##")
- local limbs = {"left_leg_broken", "right_leg_broken", "right_arm_broken", "left_arm_broken", }
- local wrtTar = "head"
- for i, v in ipairs(limbs) do
- if not t.affs[v] then
- wrtTar = v:gsub("_broken", ""):gsub("_", " ")
- break
- end
- end
- cmd = cmd:gsub("##", wrtTar)
- end
- if ((t.affs.left_leg_damaged and t.restoring ~= "left leg") or (t.affs.right_leg_damaged and t.restoring ~= "right leg") or (t.affs.left_leg_mangled or t.affs.right_leg_mangled)) then
- if not t.traits.prone then
- cmd = cmd:gsub("mnk", "swk"):gsub("snk", "swk"):gsub("sdk", "swk"):gsub("wwk", "swk"):gsub("wrt", "swk")
- else
- -- cmd = cmd:gsub("spp", "ucp"):gsub("hfp", "ucp"):gsub("hkp","ucp")
- end
- end
- if t.defs.shielded then
- cmd = cmd:gsub("mnk", "sck"):gsub("snk", "sck"):gsub("sdk", "sck"):gsub("wwk", "sck"):gsub("wrt", "sck"):gsub("swk", "sck")
- end
- if t.traits.tumbling then
- cmd = cmd:gsub("mnk", "slt"):gsub("snk", "slt"):gsub("sdk", "slt"):gsub("wwk", "slt"):gsub("wrt", "slt")
- end
- if t.traits.prone and t.affs.head_mangled and not t.defs.shielded and ((t.affs.right_arm_broken and t.affs.left_arm_broken) or km.sapienceParry ~= "head") then
- cmd = "combo "..tar.." axk ucp ucp"
- end
- table.insert(km.attackCommands, "target "..secondaryLimb)
- table.insert(km.attackCommands, stance)
- table.insert(km.attackCommands, cmd)
- end
- function monkLimbTargets()
- local limbs = {
- "right leg",
- "left leg",
- -- "head",
- "right arm",
- "left arm",
- "head",
- "torso",
- }
- return limbs
- end
- function monkTarget(t, tar)
- if not tar then tar = tmp.target end
- if not t then t = cdb.chars[tar:title()] end
- local limbs = monkLimbTargets()
- local tlimbs = {}
- for limb, damage in pairs(t.limbs) do
- table.insert(tlimbs, { ["limb"] = limb, ["damage"] = damage})
- end
- table.sort(tlimbs, function (a, b) return a.damage > b.damage end)
- local parry = tlimbs[1].limb:gsub("_", " ")
- --[[
- if t.restoring == parry then
- if tlimbs[1].damage < 30 then
- parry = tlimbs[2].limb:gsub("_", " ")
- end
- end
- --]]
- local lastParry = t.lastParry or nil
- parry = lastParry or parry
- local canParry = not (t.affs.numb_arms or (t.affs.left_arm_broken and t.affs.right_arm_broken) or t.affs.paresis or t.affs.paralysis)
- local targetLimb = ""
- for _, limb in ipairs(limbs) do
- if not canParry and limb == "head" and not t.affs[limb:gsub(" ","_").."_mangled"] then
- targetLimb = limb
- break
- end
- if not canParry and not t.affs[limb:gsub(" ","_").."_mangled"] then
- targetLimb = limb
- break
- end
- if limb == "head" and limb ~= lastParry and parry ~= limb and not t.affs[limb:gsub(" ","_").."_mangled"]
- and t.restoring ~= limb
- then
- targetLimb = limb
- break
- end
- if limb ~= lastParry and (not t.affs[limb:gsub(" ","_").."_mangled"] and parry ~= limb and t.restoring ~= limb)
- then
- targetLimb = limb
- break
- end
- end
- return targetLimb
- end
- function monkSecondaryTarget(t, tar)
- if not tar then tar = tmp.target end
- if not t then t = cdb.chars[tar:title()] end
- local limbs = monkLimbTargets()
- local tlimbs = {}
- for limb, damage in pairs(t.limbs) do
- table.insert(tlimbs, { ["limb"] = limb, ["damage"] = damage})
- end
- table.sort(tlimbs, function (a, b) return a.damage > b.damage end)
- local parry = tlimbs[1].limb:gsub("_", " ")
- --[[
- if t.restoring == parry then
- if tlimbs[1].damage < 30 then
- parry = tlimbs[2].limb:gsub("_", " ")
- end
- end
- --]]
- local lastParry = t.lastParry or nil
- parry = lastParry or parry
- local canParry = not (t.affs.numb_arms or (t.affs.left_arm_broken and t.affs.right_arm_broken) or t.affs.impaled or t.affs.paresis or t.affs.paralysis)
- local targetLimb = ""
- local kickLimb = monkTarget(t, tar)
- for _, limb in ipairs(limbs) do
- if limb == kickLimb then
- else
- if not canParry and limb == "head" and not t.affs[limb:gsub(" ","_").."_mangled"] then
- targetLimb = limb
- break
- end
- if not canParry and not t.affs[limb:gsub(" ","_").."_mangled"] then
- targetLimb = limb
- break
- end
- if limb == "head" and limb ~= lastParry and parry ~= limb and not t.affs[limb:gsub(" ","_").."_mangled"]
- and t.restoring ~= limb
- then
- targetLimb = limb
- break
- end
- if limb ~= lastParry and (not t.affs[limb:gsub(" ","_").."_mangled"] and parry ~= limb and t.restoring ~= limb)
- then
- targetLimb = limb
- break
- end
- end
- end
- return targetLimb
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement