Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

[SKY] Using OnRead()


TripleSixes
 Share

Recommended Posts

I have a script that runs from a book that I open in my inventory, but it also works if I read the book from the world.



Scriptname TIS_BookTele_ToTristram extends ObjectReference

{This script teleports the player to Tristram, Unless the player is in one of Tristram's Dungeons}


import TIS_BookTele_ToSkyrim

import Utility


;----------------------------------

;PROPERTIES

;----------------------------------

Actor Property Player Auto

Ammo Property Arrows Auto


Armor Property Buckler Auto


Armor Property TIS_StartArmor_WarriorClothes Auto

Armor Property TIS_StartArmor_WarriorShoes Auto

Armor Property TIS_StartArmor_RogueClothes Auto

Armor Property TIS_StartArmor_RogueShoes Auto

Armor Property TIS_StartArmor_SorcererClothes Auto

Armor Property TIS_StartArmor_SorcererShoes Auto


Book Property TheBook Auto

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Globalvariable Property TIS_StartHealth_Global Auto

Globalvariable Property TIS_StartMagicka_Global Auto

Globalvariable Property TIS_StartStamina_Global Auto

Globalvariable Property TIS_StartOneHanded_Global Auto

Globalvariable Property TIS_StartTwoHanded_Global Auto

Globalvariable Property TIS_StartMarksman_Global Auto

Globalvariable Property TIS_StartBlock_Global Auto

Globalvariable Property TIS_StartSmithing_Global Auto

Globalvariable Property TIS_StartHeavyArmor_Global Auto

Globalvariable Property TIS_StartLightArmor_Global Auto

Globalvariable Property TIS_StartPickPocket_Global Auto

Globalvariable Property TIS_StartLockPicking_Global Auto

Globalvariable Property TIS_StartSneak_Global Auto

Globalvariable Property TIS_StartAlchemy_Global Auto

Globalvariable Property TIS_StartSpeechCraft_Global Auto

Globalvariable Property TIS_StartAlteration_Global Auto

Globalvariable Property TIS_StartConjuration_Global Auto

Globalvariable Property TIS_StartDestruction_Global Auto

Globalvariable Property TIS_StartIllusion_Global Auto

Globalvariable Property TIS_StartRestoration_Global Auto

Globalvariable Property TIS_StartEnchanting_Global Auto

Globalvariable Property TIS_StartCarryWeight_Global Auto

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Globalvariable Property TIS_TristramHealth_Global Auto

Globalvariable Property TIS_TristramMagicka_Global Auto

Globalvariable Property TIS_TristramStamina_Global Auto

Globalvariable Property TIS_TristramOneHanded_Global Auto

Globalvariable Property TIS_TristramTwoHanded_Global Auto

Globalvariable Property TIS_TristramMarksman_Global Auto

Globalvariable Property TIS_TristramBlock_Global Auto

Globalvariable Property TIS_TristramSmithing_Global Auto

Globalvariable Property TIS_TristramHeavyArmor_Global Auto

Globalvariable Property TIS_TristramLightArmor_Global Auto

Globalvariable Property TIS_TristramPickPocket_Global Auto

Globalvariable Property TIS_TristramLockPicking_Global Auto

Globalvariable Property TIS_TristramSneak_Global Auto

Globalvariable Property TIS_TristramAlchemy_Global Auto

Globalvariable Property TIS_TristramSpeechCraft_Global Auto

Globalvariable Property TIS_TristramAlteration_Global Auto

Globalvariable Property TIS_TristramConjuration_Global Auto

Globalvariable Property TIS_TristramDestruction_Global Auto

Globalvariable Property TIS_TristramIllusion_Global Auto

Globalvariable Property TIS_TristramRestoration_Global Auto

Globalvariable Property TIS_TristramEnchanting_Global Auto

Globalvariable Property TIS_TristramCarryWeight_Global Auto

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Message Property QuestionTristram Auto

Message Property YesTristram Auto

Message Property NoTristram Auto

Message Property ChooseSkillSet Auto

Message Property Warrior Auto

Message Property Rogue Auto

Message Property Sorcerer Auto

Message Property Hardcore Auto

Message Property SavedGame Auto

Message Property GoSaveGame Auto

Message Property Hero Auto

Message Property Gladiator Auto

Message Property Ranger Auto

Message Property Thief Auto

Message Property Mage Auto

Message Property Priest Auto

MiscObject Property Gold Auto

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

ObjectReference Property SkyrimPlayerStorage Auto

ObjectReference Property TristramPlayerStorage Auto

ObjectReference Property TeleDest1 Auto

ObjectReference Property Dungeon01 Auto

ObjectReference Property SkyrimLocation Auto

ObjectReference Property TristramLocation Auto

ObjectReference PlayerLoc

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Potion Property PotionOfHealing Auto

Potion Property PotionOfMana Auto

Potion Property PotionOfStamina Auto

Spell Property FullHeal Auto

Spell Property Firebolt Auto

Spell Property Healing Auto

Spell Property Flames Auto

Weapon Property ShortSword Auto

Weapon Property ShortBow Auto

Weapon Property ShortStaffChargedBolt Auto

WorldSpace Property Tristram Auto

;----------------------------------

;VARIABLES

;----------------------------------

Int FirstTime

Int Disclaimer

Int ReadBook

Int ReadBookAgain

Int SkillSet

Int WarriorType

Int RogueType

Int SorcererType

;----------------------------------

;THE GOOD STUFF

;----------------------------------

Event onRead()

PlayerLoc = (Player as ObjectReference)

If FirstTime == 0

WaitMenuMode(1.00)


if (Dungeon01.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #1")

ElseIf Game.GetPlayer().GetWorldSpace() != Tristram

Debug.Trace("You're In Skyrim"); Player is not in Tristram

ReadBook = QuestionTristram.show()

if ReadBook == 0

Disclaimer = SavedGame.show()

If Disclaimer == 0

YesTristram.show()

FirstTime = FirstTime + 1

SkyrimLocation.MoveTo(Game.GetPlayer())

Game.GetPlayer().MoveTo(TeleDest1); Teleport to Tristram

Game.GetPlayer().RemoveAllItems(akTransferTo = SkyrimPlayerStorage, abRemoveQuestItems = true); Move Skyrim items to temporary container.

Game.GetPlayer().RemoveSpell(Flames); Remove flames spell

Game.GetPlayer().RemoveSpell(Healing); Remove healing spell


if (Game.GetPlayer().GetItemCount(TheBook) == 0)

Debug.Trace("Player doesn't have the book yet, fix that")

Game.GetPlayer().Additem(TheBook); Add book to Player's Inventory

endIf


FullHeal.Cast(Game.GetPlayer());Preparation for Script


;Save These Stats, they will be restored later

Float StartHealth = Game.GetPlayer().GetAV("health") as Float

Float StartMagicka = Game.GetPlayer().GetAV("magicka") as Float

Float StartStamina = Game.GetPlayer().GetAV("stamina") as Float

Float StartOneHanded = Game.GetPlayer().GetAV("onehanded") as Float

Float StartTwoHanded = Game.GetPlayer().GetAV("twohanded") as Float

Float StartMarksman = Game.GetPlayer().GetAV("marksman") as Float

Float StartBlock = Game.GetPlayer().GetAV("block") as Float

Float StartSmithing = Game.GetPlayer().GetAV("smithing") as Float

Float StartHeavyArmor = Game.GetPlayer().GetAV("heavyarmor") as Float

Float StartLightArmor = Game.GetPlayer().GetAV("lightarmor") as Float

Float StartPickPocket = Game.GetPlayer().GetAV("pickpocket") as Float

Float StartLockPicking = Game.GetPlayer().GetAV("lockpicking") as Float

Float StartSneak = Game.GetPlayer().GetAV("sneak") as Float

Float StartAlchemy = Game.GetPlayer().GetAV("alchemy") as Float

Float StartSpeechCraft = Game.GetPlayer().GetAV("speechcraft") as Float

Float StartAlteration = Game.GetPlayer().GetAV("alteration") as Float

Float StartConjuration = Game.GetPlayer().GetAV("conjuration") as Float

Float StartDestruction = Game.GetPlayer().GetAV("destruction") as Float

Float StartIllusion = Game.GetPlayer().GetAV("illusion") as Float

Float StartRestoration = Game.GetPlayer().GetAV("restoration") as Float

Float StartEnchanting = Game.GetPlayer().GetAV("enchanting") as Float

Float StartCarryWeight = Game.GetPlayer().GetAV("carryweight") as Float

TIS_StartHealth_Global.SetValue(StartHealth)

TIS_StartMagicka_Global.SetValue(StartMagicka)

TIS_StartStamina_Global.SetValue(StartStamina)

TIS_StartOneHanded_Global.SetValue(StartOnehanded)

TIS_StartTwoHanded_Global.SetValue(StartTwohanded)

TIS_StartMarksman_Global.SetValue(StartMarksman)

TIS_StartBlock_Global.SetValue(StartBlock)

TIS_StartSmithing_Global.SetValue(StartSmithing)

TIS_StartHeavyArmor_Global.SetValue(StartHeavyArmor)

TIS_StartLightArmor_Global.SetValue(StartLightArmor)

TIS_StartPickPocket_Global.SetValue(StartPickPocket)

TIS_StartLockPicking_Global.SetValue(StartLockPicking)

TIS_StartSneak_Global.SetValue(StartSneak)

TIS_StartAlchemy_Global.SetValue(StartAlchemy)

TIS_StartSpeechCraft_Global.SetValue(StartSpeechCraft)

TIS_StartAlteration_Global.SetValue(StartAlteration)

TIS_StartConjuration_Global.SetValue(StartConjuration)

TIS_StartDestruction_Global.SetValue(StartDestruction)

TIS_StartIllusion_Global.SetValue(StartIllusion)

TIS_StartRestoration_Global.SetValue(StartRestoration)

TIS_StartEnchanting_Global.SetValue(StartEnchanting)

TIS_StartCarryWeight_Global.SetValue(StartCarryWeight)


SkillSet = ChooseSkillSet.show();Choose your Character

if SkillSet == 0;Choose to be a Warrior.

WarriorType = Warrior.show()

If WarriorType == 0;Hero

Hero.Show()

Game.GetPlayer().SetActorValue("health", 100)

Game.GetPlayer().SetActorValue("magicka", 14)

Game.GetPlayer().SetActorValue("stamina", 55)

Game.GetPlayer().SetActorValue("onehanded", 43)

Game.GetPlayer().SetActorValue("twohanded", 29)

Game.GetPlayer().SetActorValue("marksman", 29)

Game.GetPlayer().SetActorValue("block", 43)

Game.GetPlayer().SetActorValue("smithing", 43)

Game.GetPlayer().SetActorValue("heavyarmor", 29)

Game.GetPlayer().SetActorValue("lightarmor", 36)

Game.GetPlayer().SetActorValue("pickpocket", 29)

Game.GetPlayer().SetActorValue("lockpicking", 29)

Game.GetPlayer().SetActorValue("sneak", 29)

Game.GetPlayer().SetActorValue("alchemy", 14)

Game.GetPlayer().SetActorValue("speechcraft", 29)

Game.GetPlayer().SetActorValue("alteration", 14)

Game.GetPlayer().SetActorValue("conjuration", 14)

Game.GetPlayer().SetActorValue("destruction", 14)

Game.GetPlayer().SetActorValue("illusion", 14)

Game.GetPlayer().SetActorValue("restoration", 14)

Game.GetPlayer().SetActorValue("enchanting", 14)

ElseIf WarriorType == 1;Gladiator

Gladiator.Show()

Game.GetPlayer().SetActorValue("health", 100)

Game.GetPlayer().SetActorValue("magicka", 14)

Game.GetPlayer().SetActorValue("stamina", 55)

Game.GetPlayer().SetActorValue("onehanded", 29)

Game.GetPlayer().SetActorValue("twohanded", 43)

Game.GetPlayer().SetActorValue("marksman", 29)

Game.GetPlayer().SetActorValue("block", 43)

Game.GetPlayer().SetActorValue("smithing", 43)

Game.GetPlayer().SetActorValue("heavyarmor", 36)

Game.GetPlayer().SetActorValue("lightarmor", 29)

Game.GetPlayer().SetActorValue("pickpocket", 29)

Game.GetPlayer().SetActorValue("lockpicking", 29)

Game.GetPlayer().SetActorValue("sneak", 29)

Game.GetPlayer().SetActorValue("alchemy", 14)

Game.GetPlayer().SetActorValue("speechcraft", 29)

Game.GetPlayer().SetActorValue("alteration", 14)

Game.GetPlayer().SetActorValue("conjuration", 14)

Game.GetPlayer().SetActorValue("destruction", 14)

Game.GetPlayer().SetActorValue("illusion", 14)

Game.GetPlayer().SetActorValue("restoration", 14)

Game.GetPlayer().SetActorValue("enchanting", 14)

EndIf


;Outfit and Items

Game.GetPlayer().Additem(TIS_StartArmor_WarriorClothes)

Game.GetPlayer().Additem(TIS_StartArmor_WarriorShoes)

Game.GetPlayer().Additem(ShortSword)

Game.GetPlayer().Additem(Buckler)

Game.GetPlayer().Additem(Gold, 100)

Game.GetPlayer().Additem(PotionOfHealing, 2)

Utility.wait(0.25)

Game.GetPlayer().EquipItem(TIS_StartArmor_WarriorClothes, False, True)

Game.GetPlayer().EquipItem(TIS_StartArmor_WarriorShoes, False, True)

Game.GetPlayer().EquipItem(Buckler, False, True)

Game.GetPlayer().EquipItem(ShortSword, False, True)

FullHeal.Cast(Game.GetPlayer());Preparation for Script



ElseIf SkillSet == 1;Choose to be a Rogue.

RogueType = Rogue.show()

If RogueType == 0;Ranger

Ranger.Show()

Game.GetPlayer().SetActorValue("health", 64)

Game.GetPlayer().SetActorValue("magicka", 31)

Game.GetPlayer().SetActorValue("stamina", 100)

Game.GetPlayer().SetActorValue("onehanded", 29)

Game.GetPlayer().SetActorValue("twohanded", 29)

Game.GetPlayer().SetActorValue("marksman", 43)

Game.GetPlayer().SetActorValue("block", 29)

Game.GetPlayer().SetActorValue("smithing", 29)

Game.GetPlayer().SetActorValue("heavyarmor", 14)

Game.GetPlayer().SetActorValue("lightarmor", 29)

Game.GetPlayer().SetActorValue("pickpocket", 29)

Game.GetPlayer().SetActorValue("lockpicking", 43)

Game.GetPlayer().SetActorValue("sneak", 29)

Game.GetPlayer().SetActorValue("alchemy", 21)

Game.GetPlayer().SetActorValue("speechcraft", 29)

Game.GetPlayer().SetActorValue("alteration", 21)

Game.GetPlayer().SetActorValue("conjuration", 21)

Game.GetPlayer().SetActorValue("destruction", 21)

Game.GetPlayer().SetActorValue("illusion", 21)

Game.GetPlayer().SetActorValue("restoration", 21)

Game.GetPlayer().SetActorValue("enchanting", 21)

ElseIf RogueType == 1;Thief

Thief.Show()

Game.GetPlayer().SetActorValue("health", 64)

Game.GetPlayer().SetActorValue("magicka", 31)

Game.GetPlayer().SetActorValue("stamina", 100)

Game.GetPlayer().SetActorValue("onehanded", 29)

Game.GetPlayer().SetActorValue("twohanded", 29)

Game.GetPlayer().SetActorValue("marksman", 29)

Game.GetPlayer().SetActorValue("block", 29)

Game.GetPlayer().SetActorValue("smithing", 29)

Game.GetPlayer().SetActorValue("heavyarmor", 14)

Game.GetPlayer().SetActorValue("lightarmor", 21)

Game.GetPlayer().SetActorValue("pickpocket", 43)

Game.GetPlayer().SetActorValue("lockpicking", 29)

Game.GetPlayer().SetActorValue("sneak", 43)

Game.GetPlayer().SetActorValue("alchemy", 21)

Game.GetPlayer().SetActorValue("speechcraft", 43)

Game.GetPlayer().SetActorValue("alteration", 21)

Game.GetPlayer().SetActorValue("conjuration", 21)

Game.GetPlayer().SetActorValue("destruction", 21)

Game.GetPlayer().SetActorValue("illusion", 21)

Game.GetPlayer().SetActorValue("restoration", 21)

Game.GetPlayer().SetActorValue("enchanting", 21)

EndIf


;Outfit and Items

Game.GetPlayer().Additem(TIS_StartArmor_RogueClothes)

Game.GetPlayer().Additem(TIS_StartArmor_RogueShoes)

Game.GetPlayer().Additem(ShortBow)

Game.GetPlayer().Additem(Arrows, 999999)

Game.GetPlayer().Additem(Gold, 100)

Game.GetPlayer().Additem(PotionOfStamina, 2)

Utility.wait(0.25)

Game.GetPlayer().EquipItem(TIS_StartArmor_RogueClothes, False, True)

Game.GetPlayer().EquipItem(TIS_StartArmor_RogueShoes, False, True)

Game.GetPlayer().EquipItem(ShortBow, False, True)

Game.GetPlayer().EquipItem(Arrows, False, True)

FullHeal.Cast(Game.GetPlayer());Preparation for Script


ElseIf SkillSet == 2;Choose to be a Sorcerer.

SorcererType = Sorcerer.show()

If SorcererType == 0;Mage

Mage.Show()

Game.GetPlayer().SetActorValue("health", 43)

Game.GetPlayer().SetActorValue("magicka", 100)

Game.GetPlayer().SetActorValue("stamina", 14)

Game.GetPlayer().SetActorValue("onehanded", 21)

Game.GetPlayer().SetActorValue("twohanded", 21)

Game.GetPlayer().SetActorValue("marksman", 21)

Game.GetPlayer().SetActorValue("block", 21)

Game.GetPlayer().SetActorValue("smithing", 21)

Game.GetPlayer().SetActorValue("heavyarmor", 0)

Game.GetPlayer().SetActorValue("lightarmor", 21)

Game.GetPlayer().SetActorValue("pickpocket", 21)

Game.GetPlayer().SetActorValue("lockpicking", 21)

Game.GetPlayer().SetActorValue("sneak", 21)

Game.GetPlayer().SetActorValue("alchemy", 21)

Game.GetPlayer().SetActorValue("speechcraft", 21)

Game.GetPlayer().SetActorValue("alteration", 21)

Game.GetPlayer().SetActorValue("conjuration", 50)

Game.GetPlayer().SetActorValue("destruction", 50)

Game.GetPlayer().SetActorValue("illusion", 21)

Game.GetPlayer().SetActorValue("restoration", 21)

Game.GetPlayer().SetActorValue("enchanting", 50)

ElseIf SorcererType == 1;Priest

Priest.Show()

Game.GetPlayer().SetActorValue("health", 43)

Game.GetPlayer().SetActorValue("magicka", 100)

Game.GetPlayer().SetActorValue("stamina", 14)

Game.GetPlayer().SetActorValue("onehanded", 21)

Game.GetPlayer().SetActorValue("twohanded", 21)

Game.GetPlayer().SetActorValue("marksman", 21)

Game.GetPlayer().SetActorValue("block", 21)

Game.GetPlayer().SetActorValue("smithing", 21)

Game.GetPlayer().SetActorValue("heavyarmor", 0)

Game.GetPlayer().SetActorValue("lightarmor", 29)

Game.GetPlayer().SetActorValue("pickpocket", 21)

Game.GetPlayer().SetActorValue("lockpicking", 21)

Game.GetPlayer().SetActorValue("sneak", 21)

Game.GetPlayer().SetActorValue("alchemy", 50)

Game.GetPlayer().SetActorValue("speechcraft", 21)

Game.GetPlayer().SetActorValue("alteration", 50)

Game.GetPlayer().SetActorValue("conjuration", 29)

Game.GetPlayer().SetActorValue("destruction", 29)

Game.GetPlayer().SetActorValue("illusion", 50)

Game.GetPlayer().SetActorValue("restoration", 50)

Game.GetPlayer().SetActorValue("enchanting", 50)

EndIf

;Outfit and Items

Game.GetPlayer().Additem(TIS_StartArmor_SorcererClothes)

Game.GetPlayer().Additem(TIS_StartArmor_SorcererShoes)

Game.GetPlayer().Additem(ShortStaffChargedBolt)

Game.GetPlayer().Additem(Gold, 100)

Game.GetPlayer().Additem(PotionOfMana, 2)

Game.GetPlayer().AddSpell(Firebolt)

Utility.wait(0.25)

Game.GetPlayer().EquipItem(TIS_StartArmor_SorcererClothes, False, True)

Game.GetPlayer().EquipItem(TIS_StartArmor_SorcererShoes, False, True)

Game.GetPlayer().EquipItem(ShortStaffChargedBolt, False, True)

FullHeal.Cast(Game.GetPlayer());Preparation for Script


ElseIf SkillSet == 3;Choose to play Hardcore Mode.

Hardcore.show()

Game.GetPlayer().SetActorValue("health", 50)

Game.GetPlayer().SetActorValue("magicka", 50)

Game.GetPlayer().SetActorValue("stamina", 50)

Game.GetPlayer().SetActorValue("onehanded", 10)

Game.GetPlayer().SetActorValue("twohanded", 10)

Game.GetPlayer().SetActorValue("marksman", 10)

Game.GetPlayer().SetActorValue("block", 10)

Game.GetPlayer().SetActorValue("smithing", 10)

Game.GetPlayer().SetActorValue("heavyarmor", 10)

Game.GetPlayer().SetActorValue("lightarmor", 10)

Game.GetPlayer().SetActorValue("pickpocket", 10)

Game.GetPlayer().SetActorValue("lockpicking", 10)

Game.GetPlayer().SetActorValue("sneak", 10)

Game.GetPlayer().SetActorValue("alchemy", 10)

Game.GetPlayer().SetActorValue("speechcraft", 10)

Game.GetPlayer().SetActorValue("alteration", 10)

Game.GetPlayer().SetActorValue("conjuration", 10)

Game.GetPlayer().SetActorValue("illusion", 10)

Game.GetPlayer().SetActorValue("destruction", 10)

Game.GetPlayer().SetActorValue("restoration", 10)

Game.GetPlayer().SetActorValue("enchanting", 10)


;Outfit

;Items

FullHeal.Cast(Game.GetPlayer());Preparation for Script

ElseIf SkillSet == 4;Developer Debug Mode

Game.GetPlayer().SetActorValue("health", 9999)

Game.GetPlayer().SetActorValue("magicka", 9999)

Game.GetPlayer().SetActorValue("stamina", 9999)

Game.GetPlayer().SetActorValue("onehanded", 100)

Game.GetPlayer().SetActorValue("twohanded", 100)

Game.GetPlayer().SetActorValue("marksman", 100)

Game.GetPlayer().SetActorValue("block", 100)

Game.GetPlayer().SetActorValue("smithing", 100)

Game.GetPlayer().SetActorValue("heavyarmor", 100)

Game.GetPlayer().SetActorValue("lightarmor", 100)

Game.GetPlayer().SetActorValue("pickpocket", 100)

Game.GetPlayer().SetActorValue("lockpicking", 100)

Game.GetPlayer().SetActorValue("sneak", 100)

Game.GetPlayer().SetActorValue("alchemy", 100)

Game.GetPlayer().SetActorValue("speechcraft", 100)

Game.GetPlayer().SetActorValue("alteration", 100)

Game.GetPlayer().SetActorValue("conjuration", 100)

Game.GetPlayer().SetActorValue("illusion", 100)

Game.GetPlayer().SetActorValue("destruction", 100)

Game.GetPlayer().SetActorValue("restoration", 100)

Game.GetPlayer().SetActorValue("enchanting", 100)

FullHeal.Cast(Game.GetPlayer());Preparation for Script

Debug.Notification("You've entered Developer Debug Mode")

EndIf

Game.GetPlayer().SetActorValue("carryweight", 73)

Debug.MessageBox("You can reference back to the book if you'd like to leave, or if you wish to track your progress")

ElseIf Disclaimer == 1

GoSaveGame.Show()

EndIf

elseif ReadBook == 1

NoTristram.show();Just read book...

endif

endif

ElseIf FirstTime == 1

WaitMenuMode(1.00)

if (Dungeon01.GetParentCell() == Game.GetPlayer().GetParentCell())

Debug.MessageBox("You are currently on Floor #1")

ElseIf Game.GetPlayer().GetWorldSpace() != Tristram

Debug.Trace("You're In Skyrim"); Player is not in Tristram

ReadBook = QuestionTristram.show()

if ReadBook == 0

YesTristram.show()

SkyrimLocation.MoveTo(Game.GetPlayer())

Game.GetPlayer().MoveTo(TristramLocation); Teleport to Tristram

Game.GetPlayer().RemoveAllItems(akTransferTo = SkyrimPlayerStorage, abRemoveQuestItems = true); Move Skyrim items to temporary container.

TristramPlayerStorage.RemoveAllItems(akTransferTo = Game.GetPlayer(), abRemoveQuestItems = true); Return Tristram items.

Game.GetPlayer().RemoveSpell(Healing); Remove healing spell

Game.GetPlayer().RemoveSpell(Flames); Remove flames spell

Float TristramHealth = TIS_TristramHealth_Global.GetValue()

Float TristramMagicka = TIS_TristramMagicka_Global.GetValue()

Float TristramStamina = TIS_TristramStamina_Global.GetValue()

Float TristramOneHanded = TIS_TristramOneHanded_Global.GetValue()

Float TristramTwoHanded = TIS_TristramTwoHanded_Global.GetValue()

Float TristramMarksman = TIS_TristramMarksman_Global.GetValue()

Float TristramBlock = TIS_TristramBlock_Global.GetValue()

Float TristramSmithing = TIS_TristramSmithing_Global.GetValue()

Float TristramHeavyArmor = TIS_TristramHeavyArmor_Global.GetValue()

Float TristramLightArmor = TIS_TristramLightArmor_Global.GetValue()

Float TristramPickPocket = TIS_TristramPickPocket_Global.GetValue()

Float TristramLockPicking = TIS_TristramLockPicking_Global.GetValue()

Float TristramSneak = TIS_TristramSneak_Global.GetValue()

Float TristramAlchemy = TIS_TristramAlchemy_Global.GetValue()

Float TristramSpeechCraft = TIS_TristramSpeechCraft_Global.GetValue()

Float TristramAlteration = TIS_TristramAlteration_Global.GetValue()

Float TristramConjuration = TIS_TristramConjuration_Global.GetValue()

Float TristramDestruction = TIS_TristramDestruction_Global.GetValue()

Float TristramIllusion = TIS_TristramIllusion_Global.GetValue()

Float TristramRestoration = TIS_TristramRestoration_Global.GetValue()

Float TristramEnchanting = TIS_TristramEnchanting_Global.GetValue()

Float TristramCarryWeight = TIS_TristramCarryWeight_Global.GetValue()

Game.GetPlayer().SetAV("health", TristramHealth)

Game.GetPlayer().SetAV("magicka", TristramMagicka)

Game.GetPlayer().SetAV("stamina", TristramStamina)

Game.GetPlayer().SetAV("onehanded", TristramOnehanded)

Game.GetPlayer().SetAV("twohanded", TristramTwohanded)

Game.GetPlayer().SetAV("marksman", TristramMarksman)

Game.GetPlayer().SetAV("block", TristramBlock)

Game.GetPlayer().SetAV("smithing", TristramSmithing)

Game.GetPlayer().SetAV("heavyarmor", TristramHeavyArmor)

Game.GetPlayer().SetAV("lightarmor", TristramLightArmor)

Game.GetPlayer().SetAV("pickpocket", TristramPickpocket)

Game.GetPlayer().SetAV("lockpicking", TristramLockpicking)

Game.GetPlayer().SetAV("sneak", TristramSneak)

Game.GetPlayer().SetAV("alchemy", TristramAlchemy)

Game.GetPlayer().SetAV("speechcraft", TristramSpeechcraft)

Game.GetPlayer().SetAV("alteration", TristramAlteration)

Game.GetPlayer().SetAV("conjuration", TristramConjuration)

Game.GetPlayer().SetAV("destruction", TristramDestruction)

Game.GetPlayer().SetAV("illusion", TristramIllusion)

Game.GetPlayer().SetAV("restoration", TristramRestoration)

Game.GetPlayer().SetAV("enchanting", TristramEnchanting)

Game.GetPlayer().SetAV("carryweight", TristramCarryWeight)

FullHeal.Cast(Game.GetPlayer())

Debug.MessageBox("You can reference back to the book if you'd like to leave, or if you wish to track your progress")

elseif ReadBook == 1

NoTristram.show();Just read book...

endif

endif

EndIf

EndEvent

But something isn't working this easily in another script I use that uses the Event OnRead().

ScriptName TIS_SpellLvlUp_HolyBolt Extends ObjectReference

{Script that allows incremental spell lvl up}


Sound TIS_UI_SpellUp

Spell Property TIS_Spell_HolyBolt01 Auto

Spell Property TIS_Spell_HolyBolt02 Auto

Spell Property TIS_Spell_HolyBolt03 Auto

Spell Property TIS_Spell_HolyBolt04 Auto

Spell Property TIS_Spell_HolyBolt05 Auto


Event OnRead()

Float AVlvl = Game.GetPlayer().GetAV("Restoration")

If AVlvl < 15

debug.MessageBox("I need more practice with this spell before I learn this new technique (Requires a Restoration Level of 15)")

ElseIf AVlvl >= 15 && AVlvl < 30

If Game.GetPlayer().HasSpell(TIS_Spell_HolyBolt01) == False

Game.GetPlayer().AddSpell(TIS_Spell_HolyBolt01)

Self.Disable()

TIS_UI_SpellUp.Play(Game.GetPlayer())

ElseIf Game.GetPlayer().HasSpell(TIS_Spell_HolyBolt01)

debug.MessageBox("I need more practice with this spell before I learn this new technique (Requires a Restoration Level of 30)")

EndIf

ElseIf AVlvl >= 30 && AVlvl < 45

If Game.GetPlayer().HasSpell(TIS_Spell_HolyBolt01) == False

Game.GetPlayer().AddSpell(TIS_Spell_HolyBolt01)

Self.Disable()

TIS_UI_SpellUp.Play(Game.GetPlayer())

ElseIf Game.GetPlayer().HasSpell(TIS_Spell_HolyBolt01)

Game.GetPlayer().RemoveSpell(TIS_Spell_HolyBolt01)

Game.GetPlayer().AddSpell(TIS_Spell_HolyBolt02)

Self.Disable()

TIS_UI_SpellUp.Play(Game.GetPlayer())

ElseIf Game.GetPlayer().HasSpell(TIS_Spell_HolyBolt02)

debug.MessageBox("I need more practice with this spell before I learn this new technique (Requires a Restoration Level of 45)")

EndIf

ElseIf AVlvl >= 45 && AVlvl < 60

If Game.GetPlayer().HasSpell(TIS_Spell_HolyBolt01) == False

Game.GetPlayer().AddSpell(TIS_Spell_HolyBolt01)

Self.Disable()

TIS_UI_SpellUp.Play(Game.GetPlayer())

ElseIf Game.GetPlayer().HasSpell(TIS_Spell_HolyBolt01)

Game.GetPlayer().RemoveSpell(TIS_Spell_HolyBolt01)

Game.GetPlayer().AddSpell(TIS_Spell_HolyBolt02)

Self.Disable()

TIS_UI_SpellUp.Play(Game.GetPlayer())

ElseIf Game.GetPlayer().HasSpell(TIS_Spell_HolyBolt02)

Game.GetPlayer().RemoveSpell(TIS_Spell_HolyBolt02)

Game.GetPlayer().AddSpell(TIS_Spell_HolyBolt03)

Self.Disable()

TIS_UI_SpellUp.Play(Game.GetPlayer())

ElseIf Game.GetPlayer().HasSpell(TIS_Spell_HolyBolt03)

debug.MessageBox("I need more practice with this spell before I learn this new technique (Requires a Restoration Level of 60)")

EndIf

ElseIf AVlvl >= 60 && AVlvl < 75

If Game.GetPlayer().HasSpell(TIS_Spell_HolyBolt01) == False

Game.GetPlayer().AddSpell(TIS_Spell_HolyBolt01)

Self.Disable()

TIS_UI_SpellUp.Play(Game.GetPlayer())

ElseIf Game.GetPlayer().HasSpell(TIS_Spell_HolyBolt01)

Game.GetPlayer().RemoveSpell(TIS_Spell_HolyBolt01)

Game.GetPlayer().AddSpell(TIS_Spell_HolyBolt02)

Self.Disable()

TIS_UI_SpellUp.Play(Game.GetPlayer())

ElseIf Game.GetPlayer().HasSpell(TIS_Spell_HolyBolt02)

Game.GetPlayer().RemoveSpell(TIS_Spell_HolyBolt02)

Game.GetPlayer().AddSpell(TIS_Spell_HolyBolt03)

Self.Disable()

TIS_UI_SpellUp.Play(Game.GetPlayer())

ElseIf Game.GetPlayer().HasSpell(TIS_Spell_HolyBolt03)

Game.GetPlayer().RemoveSpell(TIS_Spell_HolyBolt03)

Game.GetPlayer().AddSpell(TIS_Spell_HolyBolt04)

Self.Disable()

TIS_UI_SpellUp.Play(Game.GetPlayer())

ElseIf Game.GetPlayer().HasSpell(TIS_Spell_HolyBolt04)

debug.MessageBox("I need more practice with this spell before I learn this new technique (Requires a Restoration Level of 75)")

EndIf

ElseIf AVlvl >= 75

If Game.GetPlayer().HasSpell(TIS_Spell_HolyBolt01) == False

Game.GetPlayer().AddSpell(TIS_Spell_HolyBolt01)

Self.Disable()

TIS_UI_SpellUp.Play(Game.GetPlayer())

ElseIf Game.GetPlayer().HasSpell(TIS_Spell_HolyBolt01)

Game.GetPlayer().RemoveSpell(TIS_Spell_HolyBolt01)

Game.GetPlayer().AddSpell(TIS_Spell_HolyBolt02)

Self.Disable()

TIS_UI_SpellUp.Play(Game.GetPlayer())

ElseIf Game.GetPlayer().HasSpell(TIS_Spell_HolyBolt02)

Game.GetPlayer().RemoveSpell(TIS_Spell_HolyBolt02)

Game.GetPlayer().AddSpell(TIS_Spell_HolyBolt03)

Self.Disable()

TIS_UI_SpellUp.Play(Game.GetPlayer())

ElseIf Game.GetPlayer().HasSpell(TIS_Spell_HolyBolt03)

Game.GetPlayer().RemoveSpell(TIS_Spell_HolyBolt03)

Game.GetPlayer().AddSpell(TIS_Spell_HolyBolt04)

Self.Disable()

TIS_UI_SpellUp.Play(Game.GetPlayer())

ElseIf Game.GetPlayer().HasSpell(TIS_Spell_HolyBolt04)

Game.GetPlayer().RemoveSpell(TIS_Spell_HolyBolt04)

Game.GetPlayer().AddSpell(TIS_Spell_HolyBolt05)

Self.Disable()

TIS_UI_SpellUp.Play(Game.GetPlayer())

ElseIf Game.GetPlayer().HasSpell(TIS_Spell_HolyBolt05)

debug.MessageBox("I've already mastered this spell")

EndIf

EndIf

EndEvent

The problem is that when I read the book from the world, it works fine, but the .disable commands disable the world model, like it's supposed to, but if the player presses "e" to take the book while they are reading it, it will add the book to the player's inventory, which leads me to my real problem, the second script won't run when I open the book from the player's inventory, regardless if it was the "disabled" book, or a fresh book in a container for me to add to my inventory and skip the read sequence... which is odd because the Events in the two scripts are the same (Event OnRead()). I'm going to debug the second script, and see if I find anything further, but any help on this subject would be highly appreciated.

EDIT: Just debugged the second script and confirmed that it is indeed not firing when read from the inventory, while the first script fires in both cases (read from the world, read from the inventory)

I'm stumped!

EDIT:EDIT: Changed the sound property to an actual property (making sense?), and that seemed to fix the issue... now a new question..

When the player reads the book from the world, how do I delete this item after it is read? Disabling it works if the player presses "tab" to leave the book menu, but if the player presses "e", the player receives the book. and can still reread it from the inventory, but can't drop it as doing so drops a disabled item (book vanishes) which is fine... but I want to avoid the player keeping the book after reading it altogether. The player can also sell it to a vendor and rebuy it as an enabled book (as opposed to disabled).

Edited by TripleSixes
Link to comment
Share on other sites

There is an option in the Book Editor that says "Can't be Taken" Select that, and the book when opened will not have the option to be taken by the player.

BookEditorScreen.jpg

However if the book is in a container I believe it can still be taken, so make sure that the book is not in a container.

Might try adding another script:

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)

  if akNewContainer == Game.GetPlayer()

    Game.GetPlayer().RemoveItem(YourBookREF, 1)

  Endif

EndEvent

If you use this, make sure to change "YourBookREF" to what you have your Book REF ID is :yes:

Edited by DsoS
  • Upvote 1
Link to comment
Share on other sites

What's weird is that didn't work. I'm still able to take the books in both cases (in a container and in the world). I added a remove item command and now if the player reads from his/her inventory, the books work fine. The only issues are reading the book which is located outside of the player's inventory and when a book is dropped from the inventory then read (obviously the same issue as the first, but complicates reading from the inventory).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...