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