Scripts

TR_m1_Pub_Black_Ogre

TR_Mainland.esm
Variables 9
Local Variables
TR_Map
control
rent
rentDay
rentMonth
setup
cleanup
T_Local_NPC
NoLore
Source
1begin TR_m1_Pub_Black_Ogre 2 3;Cell: Bal Oyra, The Black Ogre Tavern 4;Publican: TR_m1_Yersod 5;Flag: TR_m1_Rent_Black_Ogre 6;Room Door: TR_m1_rd_Black_Ogre 7 8 9;all rooms get rented for one day 10;This NPC must be in the map where the room is if you use the locked door cell loading cleanup 11;rename the script for the NPC and make a specific door to unlock or flag to set 12;NO actual key is given to player, a global flag is set that removes the ownership on the beds. 13 14;this script fires off when RENT is set true. Rent is set true through the BEDS topic in dialogue, which all Publicans have. 15;Each publican will also have a separate response to buying the bed, so they can give simple directions. There is also a default one. 16 17short TR_Map 18short control 19short rent ;if room is rented, set through dialogue on this NPC 20short rentDay ;the day of the rental 21short rentMonth ;the month of the rental 22short setup ;if setup has been done 23short cleanup ;true if you want to cleanup all the flags, rental is over and can be reset 24short T_Local_NPC 25short NoLore 26;this script also uses a global variable (TR_Rent_Black_Ogre ). Make a new one for each rental. You can have as many 27;beds as you want use that variable, it is used through the ownership data on the object reference 28 29 30 31if ( rent == 1 ) 32 33 if ( setup == 0 ) 34 set rentDay to Day 35 set rentMonth to Month 36 set setup to 1 37 set TR_m1_Rent_Black_Ogre to 1 ;this is the flag for the ownership on the bed 38 TR_m1_rd_Black_Ogre->unlock ;opens the door 39 TR_m1_rd_Black_Ogre->PlaySound3D "Open Lock" 40 41 else ;setup is done so check to see if the day is over 42 43 if ( Day != rentDay ) 44 set cleanup to 1 45 46 elseif ( Month != rentMonth ) 47 set cleanup to 1 48 49 endif 50 51 endif 52 53 if ( CellChanged ) ;this is only needed if you've done a locked door. If so, you only want to do this on cell change so you don't lock them in the room 54 if ( cleanup == 1 ) ;this gets called when the rental is over and everything can be cleaned up 55 set rent to 0 56 set TR_m1_Rent_Black_Ogre to 0 57 TR_m1_rd_Black_Ogre->lock 25 ;locks the door 58 TR_m1_rd_Black_Ogre->PlaySound3D "LockedDoor" 59 set setup to 0 60 set rentDay to 0 61 set rentMonth to 0 62 set cleanup to 0 63 endif 64 endif 65 66endif 67 68; This short script is there to allow dialogue to be filtered on the TR_Map local variable, 69; allowing for regional topics such as "Morrowind Lore" or "Geographic Regions" to be 70; appropriate to the location the NPC is. 71 72if ( TR_Map == 1 ) 73 return 74endif 75 76set TR_Map to 1 77 78End