Your browser does not support JavaScript or its disabled!
Please turn it on, or be aware that some features on this website will not work correctly.
154
Buff Cast #40
This is used for spells from OxygenOT.
Utito, Recovery, Party.
Allows you to select which vocation you play.
5.17kb | 197 lines.
setDefaultTab("Main")
local buffCastPanelName = "iBuffPanel"
if not storage[buffCastPanelName] then
    storage[buffCastPanelName] = {
        granBlessType = "Sorcerer",
        vocId = 1,
        blessType = false,
        recovery = false,
        party = false,
        utito = false,
    }
end

local buff_data = {
    [1] = { -- sorc
        utito = "magic",
        recovery = "mage",
        party = "utori",
    },
    [2] = { -- druid
        utito = "magic",
        recovery = "mana",
        party = "utura",
    },
    [3] = { -- paladin
        utito = "tempo san",
        recovery = "divine",
        party = "utamo",
    },
    [4] = { -- knight
        utito = "tempo",
        recovery = "exura",
        party = "utito",
    },
}

local buffCast = setupUI([[
GranBlessComboBoxPopupMenu < ComboBoxPopupMenu
GranBlessComboBoxPopupMenuButton < ComboBoxPopupMenuButton
GranBlessComboBox < ComboBox
  @onSetup: |
    self:addOption("Sorcerer", 1)
    self:addOption("Druid", 2)
    self:addOption("Paladin", 3)
    self:addOption("Knight", 4)

Panel
  height: 130
  padding-top: 5

  HorizontalSeparator
    id: separator
    anchors.right: parent.right
    anchors.left: parent.left
    anchors.top: parent.top
    margin-bottom: 6

  Label
    anchors.right: parent.right
    anchors.left: parent.left
    anchors.top: prev.bottom
    text: Buffs
    text-align: center
    margin-top: 6

  HorizontalSeparator
    id: separator
    anchors.right: parent.right
    anchors.left: parent.left
    anchors.top: prev.bottom
    margin-top: 3
    margin-bottom: 6

  GranBlessComboBox
    id: GranBlessType
    anchors.top: prev.bottom
    anchors.right: parent.right
    anchors.left: parent.left
    margin-top: 6
    margin-left: 5
    margin-right: 5

  BotSwitch
    id: utitoSwitch
    anchors.top: prev.bottom
    anchors.left: parent.left
    anchors.right: parent.right
    text-align: center
    margin-top: 4
    margin-left: 5
    margin-right: 5
    width: 110
    height: 18
    !text: tr('Utito')

  BotSwitch
    id: recSwitch
    anchors.top: prev.bottom
    anchors.left: parent.left
    text-align: center
    margin-top: 4
    margin-right: 3
    margin-left: 5
    width: 110
    height: 18
    !text: tr('Recovery')

  CheckBox
    id: BlessType
    !text: tr('Gran')
    anchors.top: recSwitch.top
    anchors.right: parent.right
    margin-top: 4
    margin-left: 5
    margin-right: 5
    color: #ffaa00
    width: 46

  BotSwitch
    id: partySwitch
    anchors.top: prev.bottom
    anchors.left: parent.left
    anchors.right: parent.right
    text-align: center
    margin-top: 6
    margin-left: 5
    margin-right: 5
    width: 110
    height: 18
    !text: tr('Party Buff')

  HorizontalSeparator
    id: separator1
    anchors.right: parent.right
    anchors.left: parent.left
    anchors.top: prev.bottom
    margin-top: 6
    margin-bottom: 6
  ]])

local utito_type = buff_data[storage[buffCastPanelName].vocId].utito
local recovery_type = buff_data[storage[buffCastPanelName].vocId].recovery
local party_type = buff_data[storage[buffCastPanelName].vocId].party

buffCast.GranBlessType:setOption(storage[buffCastPanelName].granBlessType)
buffCast.GranBlessType.onOptionChange = function(widget)
    storage[buffCastPanelName].granBlessType = widget:getCurrentOption().text
    storage[buffCastPanelName].vocId = widget:getCurrentOption().data
    utito_type = buff_data[storage[buffCastPanelName].vocId].utito
    recovery_type = buff_data[storage[buffCastPanelName].vocId].recovery
    party_type = buff_data[storage[buffCastPanelName].vocId].party
end

buffCast.BlessType:setChecked(storage[buffCastPanelName].blessType)
buffCast.BlessType.onClick = function(widget)
    storage[buffCastPanelName].blessType = not storage[buffCastPanelName].blessType
    widget:setChecked(storage[buffCastPanelName].blessType)
end

buffCast.recSwitch:setOn(storage[buffCastPanelName].recovery)
buffCast.recSwitch.onClick = function(widget)
    storage[buffCastPanelName].recovery = not storage[buffCastPanelName].recovery
    widget:setOn(storage[buffCastPanelName].recovery)
end
buffCast.partySwitch:setOn(storage[buffCastPanelName].party)
buffCast.partySwitch.onClick = function(widget)
    storage[buffCastPanelName].party = not storage[buffCastPanelName].party
    widget:setOn(storage[buffCastPanelName].party)
end
buffCast.utitoSwitch:setOn(storage[buffCastPanelName].utito)
buffCast.utitoSwitch.onClick = function(widget)
    storage[buffCastPanelName].utito = not storage[buffCastPanelName].utito
    widget:setOn(storage[buffCastPanelName].utito)
end

function spellcast(spell)
    if TargetBot then
        TargetBot.saySpell(spell)
    else
        say(spell)
    end
end

utitoCast = macro(9000, function()
    if isInPz() or not storage[buffCastPanelName].utito then return end
    spellcast("utito " .. utito_type)
end)
recoveryCast = macro(14000, function()
    if isInPz() or not storage[buffCastPanelName].recovery then return end
    spellcast(recovery_type .. (storage[buffCastPanelName].blessType and " gran" or '') .. ' bless "' .. name())
end)

partyCast = macro(100, function()
    if isInPz() or not storage[buffCastPanelName].party or not player:isPartyMember() then return end
    spellcast(party_type .. ' mas sio')
    delay(120000)
end)

09 Aug 2021