Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- block spellmaking if you don't have enough gold, thanks to SpellMaker mod for this
- local function spellmaking_block(eventData)
- local menu = tes3ui.findMenu("MenuSpellmaking")
- if menu then
- local npcID = tes3ui.getServiceActor(e)
- if npcID then isSelfSpellmaking = 0 else isSelfSpellmaking = 1 end
- if isSelfSpellmaking == 0 then
- local buyButton = menu:findChild("MenuSpellmaking_Buybutton")
- local gold_amount = tes3.getPlayerGold()
- buyButton:registerBefore(tes3.uiEvent.mouseClick,
- function(mouseClickEventData)
- if gold_amount < math.floor(spellmaker_cost * cost_gold_mult) then
- tes3.messageBox("You don't have enough gold to create this spell")
- return false -- this will prevent the regular mouseclick event from being run
- end
- end
- )
- end
- end
- end
- local function spellmaking_payment(e)
- if isSelfSpellmaking == 0 then
- tes3.removeItem({reference = tes3.player, item = "gold_001", count = math.floor(spellmaker_cost * cost_gold_mult)})
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment