Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trax.cure = function(name,cure)
- local flag = false
- if name ~= "" and cure ~= "" and dban[cure] then -- OPEN
- if config and config.trax == 2 then
- local count = 0
- for i=1, #dban[cure] do
- if has(name,dban[cure][i]) > 0 and dba[dban[cure][i]].m_take == "" then
- count = count + 1
- flag = true
- end
- end
- if count > 0 then
- count = 1/count
- for i=1, #dban[cure] do
- local aff = dban[cure][i]
- if has(name,aff) > 0 and dba[aff].m_take == "" then
- local short = dbp.players_[name].affs_[aff]
- short = short - count
- if short < 0 then
- short = 0
- trax.take(name,aff)
- end
- dbp.players_[name].affs_[aff] = short
- end
- end
- end
- if dbp then
- dbp.ui_refresh()
- dbp.ui_refresh_()
- end
- else
- -- Cycle through known afflictions to cure
- for i=1, #dban[cure] do -- display(dban[cure][i])
- if has(name,dban[cure][i]) and dba[dban[cure][i]].m_take == "" then
- trax.take(name,dban[cure][i])
- flag = true
- break
- end
- end
- end
- end -- CLOSE
- -- If you did not cure any afflictions, take a random aff
- -- exclusion table
- local exc_t = {"quince","primrose","juniper","hyssop","violet","toadstool","linseed"}
- if not flag and not table.contains(exc_t,cure) then
- local random_affs = has(name,"random_affs")
- if random_affs > 0 then
- set(name,"random_affs",random_affs - 1)
- cecho("\n<white>Taking Random Aff...")
- end
- end
- -- Clear the memory
- trax.pending_name = ""
- trax.pending = ""
- end
- dban.maidenhair = {
- "numbness",
- "paralysis",
- "metrazol",
- "slickness",
- "frozen",
- "hellsight",
- "sensitivity",
- "frostbite"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement