Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local world = require("openmw.world")
- local core = require("openmw.core")
- local storage = require("openmw.storage")
- local settings = storage.globalSection("SettingsPetTheScribs_settings")
- local l10n = core.l10n("PetTheScribs")
- local function normalScrib(actor, scrib, options)
- local jellyCooldown = settings:get("jellyCooldown") * 60 * 60 -- in hours
- local lastJellyTime = options.lastJellyTimeList[scrib.id] or -jellyCooldown
- local currTime = world.getSimulationTime()
- local minJelly = settings:get("minJelly")
- local maxJelly = settings:get("maxJelly")
- local jellyCount = math.random(minJelly, maxJelly)
- if currTime > lastJellyTime + jellyCooldown and jellyCount > 0 then
- local jelly = world.createObject("ingred_scrib_jelly_01", jellyCount)
- local inv = actor.type.inventory(actor)
- ---@diagnostic disable-next-line: discard-returns
- jelly:moveInto(inv)
- options.lastJellyTimeList[scrib.id] = currTime
- actor:sendEvent("ShowMessage", {
- message = l10n("msg_jellyGot", { jellyCount = jellyCount })
- })
- end
- end
- local function diseasedScrib(actor, scrib, options)
- local activeEffects = actor.type.activeEffects(actor)
- local diseaseResist = options.resistEffect
- and activeEffects:getEffect(options.resistEffect).magnitude / 100
- or 0
- local proc = math.random() < options.diseaseChance - diseaseResist
- local alreadyDiseased = actor.type.activeSpells(actor):isSpellActive(options.disease.id)
- local telekinesisActive = activeEffects:getEffect(core.magic.EFFECT_TYPE.Telekinesis).magnitude > 0
- if proc and not alreadyDiseased and not telekinesisActive then
- actor.type.spells(actor):add(options.disease.id)
- actor:sendEvent("ShowMessage", {
- message = l10n("msg_caughtDisease", { disease = options.disease.name })
- })
- end
- end
- local function iceScrib(actor, scrib, options)
- local telekinesisActive = actor.type.activeEffects(actor):getEffect("telekinesis").magnitude > 0
- if not telekinesisActive then
- actor.type.activeSpells(actor):add({
- id = "frostbite",
- effects = { 0 }
- })
- end
- end
- Scribs = {
- -- vanilla
- ["scrib"] = normalScrib,
- ["t_cyr_fau_tantha_01"] = normalScrib,
- ["aa_cr_rabbit_orange"] = normalScrib,
- ["t_cyr_fau_hrs_01"] = normalScrib,
- ["t_cyr_fau_hrs_02"] = normalScrib,
- ["t_cyr_fau_hrs_03"] = normalScrib,
- ["t_cyr_fau_hrsst_01"] = normalScrib,
- ["t_cyr_fau_hrsst_02"] = normalScrib,
- ["t_cyr_fau_hrsst_03"] = normalScrib,
- ["pc_m1_anv_fthorse"] = normalScrib,
- ["t_cyr_fau_hrssadl_03"] = normalScrib,
- ["t_cyr_fau_hrssadl_01"] = normalScrib,
- ["t_cyr_fau_hrssadl_02"] = normalScrib,
- ["t_cyr_fau_rvnewt_01"] = normalScrib,
- ["t_cyr_fau_rvnewt_02"] = normalScrib,
- ["t_cyr_fau_rvnewt_03"] = normalScrib,
- ["t_glb_fau_birdchirs_01"] = normalScrib,
- ["t_glb_fau_birdchirs_02"] = normalScrib,
- ["t_glb_fau_birdchirs_03"] = normalScrib,
- ["t_glb_fau_birdchirs_04"] = normalScrib,
- ["t_glb_fau_birdchirs_05"] = normalScrib,
- ["t_glb_fau_birdchi_01"] = normalScrib,
- ["t_glb_fau_birdchi_02"] = normalScrib,
- ["t_glb_fau_birdchi_03"] = normalScrib,
- ["t_glb_fau_birdchi_04"] = normalScrib,
- ["t_glb_fau_birdchi_05"] = normalScrib,
- ["t_glb_fau_birdchi_06"] = normalScrib,
- ["t_cyr_fau_frogbul_01"] = normalScrib,
- ["t_cyr_fau_frogbul_02"] = normalScrib,
- ["t_cyr_fau_frogbul_03"] = normalScrib,
- ["t_mw_fau_molec_01"] = normalScrib,
- ["t_mw_fau_molec_02"] = normalScrib,
- ["t_mw_fau_molec_03"] = normalScrib,
- ["tr_m4_q_tmm_bolsguar"] = normalScrib,
- ["t_glb_fau_squirrel_01"] = normalScrib,
- ["t_glb_fau_squirrel_02"] = normalScrib,
- ["t_glb_fau_squirrel_03"] = normalScrib,
- ["aa_cr_turtle01"] = normalScrib,
- ["aa_cr_turtle02"] = normalScrib,
- ["aa_cr_turtle03"] = normalScrib,
- ["guar"] = normalScrib,
- ["guar_feral"] = normalScrib,
- ["t_mw_fau_velk_01"] = normalScrib,
- ["t_mw_fau_velk_02"] = normalScrib,
- ["t_mw_fau_velk_03"] = normalScrib,
- ["tr_m3_oe_fg_cr_velk"] = normalScrib,
- ["tr_m4_rr_catcatchernix"] = normalScrib,
- ["tr_m3_giapackrat"] = normalScrib,
- ["t_mw_fau_guarhrn_01"] = normalScrib,
- ["t_mw_fau_guarhrn_02"] = normalScrib,
- ["t_mw_fau_guarhrn_03"] = normalScrib,
- ["tr_m7_cb_guar_farm"] = normalScrib,
- ["aa_cr_ant_giant_01b"] = normalScrib,
- ["aa_pack_guar_harness"] = normalScrib,
- ["netch_bull"] = normalScrib,
- ["pc_m1_sdk_fthorse"] = normalScrib,
- ["t_ham_fau_goat_01"] = normalScrib,
- ["t_ham_fau_goat_02"] = normalScrib,
- ["tr_m4_fg_ushuguar_01"] = normalScrib,
- ["t_ham_fau_goat_03"] = normalScrib,
- ["t_glb_fau_deer_01"] = normalScrib,
- ["t_glb_fau_deer_02"] = normalScrib,
- ["t_glb_fau_deer_03"] = normalScrib,
- ["t_glb_fau_deer_04"] = normalScrib,
- ["t_glb_fau_deer_05"] = normalScrib,
- ["t_cyr_fau_catlcow_01"] = normalScrib,
- ["t_cyr_fau_catlcow_02"] = normalScrib,
- ["t_cyr_fau_catlcow_03"] = normalScrib,
- ["t_cyr_fau_catlbull_01"] = normalScrib,
- ["t_cyr_fau_catlbull_02"] = normalScrib,
- ["aa_rat_pack01"] = normalScrib,
- ["aa_rat_pack02"] = normalScrib,
- ["aa_rat_pack03"] = normalScrib,
- ["aa_rat_pack04"] = normalScrib,
- ["aa_rat_pack05"] = normalScrib,
- ["aa_rat_pack06"] = normalScrib,
- ["t_cyr_fau_catlbull_03"] = normalScrib,
- ["t_cyr_fau_donk_01"] = normalScrib,
- ["t_cyr_fau_donk_02"] = normalScrib,
- ["t_cyr_fau_donk_03"] = normalScrib,
- ["sky_xre_horse_01_s"] = normalScrib,
- ["sky_xre_horse_02_s"] = normalScrib,
- ["sky_xre_horse_03_s"] = normalScrib,
- ["sky_xre_horse_04_s"] = normalScrib,
- ["sky_xre_horse_05_s"] = normalScrib,
- ["t_sky_fau_catlcow_01"] = normalScrib,
- ["t_sky_fau_catlcow_02"] = normalScrib,
- ["tr_m4_q_troupe_guar"]= normalScrib,
- ["t_sky_fau_catlcow_03"] = normalScrib,
- ["t_sky_fau_catlcow_04"] = normalScrib,
- ["t_mw_fau_ashfowl_01"] = normalScrib,
- ["t_mw_fau_ashfowl_02"] = normalScrib,
- ["t_mw_fau_ashfowl_03"] = normalScrib,
- ["tr_m4_cr_aa_llandesag"] = normalScrib,
- ["tr_m4_redhnd_uman"] = normalScrib,
- ["tr_m4_cr_nulenguar"] = normalScrib,
- ["t_mw_fau_hoom_01"] = normalScrib,
- ["t_mw_fau_hoom_02"] = normalScrib,
- ["t_mw_fau_hoom_03"] = normalScrib,
- ["t_mw_fau_hoom_04"] = normalScrib,
- ["t_mw_fau_hoom_05"] = normalScrib,
- ["t_mw_fau_kwoom_01"] = normalScrib,
- ["t_mw_fau_kwoom_02"] = normalScrib,
- ["t_mw_fau_kwoom_03"] = normalScrib,
- ["t_mw_fau_kwoom_04"] = normalScrib,
- ["t_mw_fau_kwoom_05"] = normalScrib,
- ["t_mw_fau_sharaihoppe_01"] = normalScrib,
- ["t_mw_fau_sharaihoppe_02"] = normalScrib,
- ["t_mw_fau_sharaihoppe_03"] = normalScrib,
- ["t_mw_fau_sharaihoppe_04"] = normalScrib,
- ["t_mw_fau_sharaihoppe_05"] = normalScrib,
- ["t_mw_fau_orn_01"] = normalScrib,
- ["t_mw_fau_orn_02"] = normalScrib,
- ["t_mw_fau_orn_03"] = normalScrib,
- ["t_cyr_fau_hrssadlst_01"] = normalScrib,
- ["t_cyr_fau_hrssadlst_02"] = normalScrib,
- ["t_cyr_fau_hrssadlst_03"] = normalScrib,
- ["netch_betty"] = normalScrib,
- ["kwama queen"] = normalScrib,
- ["aa_cr_w_newt"] = normalScrib,
- ["aa_cr_kriin_herd"] = normalScrib,
- ["a_siltstrider"] = normalScrib,
- ["rp_guar_domesticated"] = normalScrib,
- ["kwama worker entrance"] = normalScrib,
- ["kwama worker"] = normalScrib,
- ["tr_m1_q_lesa"] = normalScrib,
- ["aa_trader_guar_pack"] = normalScrib,
- ["guar_pack"] = normalScrib,
- ["scrib diseased"] = function(actor, scrib, options)
- options.diseaseChance = settings:get("diseaseChance")
- options.disease = core.magic.spells.records["droops"]
- options.resistEffect = core.magic.EFFECT_TYPE.ResistCommonDisease
- diseasedScrib(actor, scrib, options)
- end,
- ["scrib_vaba-amus"] = normalScrib,
- ["scrib blighted"] = function(actor, scrib, options)
- options.diseaseChance = settings:get("blightChance")
- options.disease = core.magic.spells.records["droops"]
- options.resistEffect = core.magic.EFFECT_TYPE.ResistBlightDisease
- diseasedScrib(actor, scrib, options)
- end,
- ["scrib_rerlas"] = normalScrib,
- -- ice scrib
- -- https://www.nexusmods.com/morrowind/mods/51338
- ["icescrib"] = iceScrib,
- -- Creatures and Critters
- -- https://www.nexusmods.com/morrowind/mods/54518
- ["aa_cr_horned_scrib"] = normalScrib,
- -- Diverse Scribs
- -- https://www.nexusmods.com/morrowind/mods/56176
- ["scrib_2"] = normalScrib,
- ["scrib diseased_2"] = function(actor, scrib, options)
- options.diseaseChance = settings:get("diseaseChance")
- options.disease = core.magic.spells.records["droops"]
- options.resistEffect = core.magic.EFFECT_TYPE.ResistCommonDisease
- diseasedScrib(actor, scrib, options)
- end,
- ["ttooth_scrib_2"] = normalScrib,
- -- TriangleTooth's Ecology Mod
- -- https://www.nexusmods.com/morrowind/mods/47061
- ["ttooth_scrib"] = normalScrib,
- -- Utility Spells
- -- https://www.nexusmods.com/morrowind/mods/58288
- ["scrib_summon"] = normalScrib,
- }
Advertisement
Add Comment
Please, Sign In to add comment