TR_m3_A8_Dralin_Belvayn_S
TR_Mainland.esm
Variables
10
Local Variables
rent
rentDay
rentMonth
setup
cleanup
TR_Map
control
controlQ
T_Local_NPC
NoLore
Source
1begin TR_m3_A8_Dralin_Belvayn_S
2;Yay for stealing scripts
3;this script fires off when RENT is set true. Rent is set true throuhg the BEDS topic in dialogue, which all Publicans have.
4;Each publican will also have a separate response to buying the bed, so they can give simple directions. There is also a default one.
5
6short rent ;if room is rented, set through dialogue on this NPC
7short rentDay ;the day of the rental
8short rentMonth ;the month of the rental
9short setup ;if setup has been done
10short cleanup ;true if you want to cleanup all the flags, rental is over and can be reset
11short TR_Map
12short control
13short controlQ
14short T_Local_NPC
15short NoLore
16
17;this script also uses a global variable (TR_m3_Rent_Gorne_EmeraldHaven). Make a new one for each rental. You can have as many
18;beds as you want use that variable, it is used through the ownership data on the object reference
19
20if ( TR_Map == 0 )
21 set TR_Map to 3
22endif
23
24if ( rent == 1 )
25 if ( setup == 0 )
26 set rentDay to Day
27 set rentMonth to Month
28 set setup to 1
29 set TR_m3_Rent_Gorne_EmeraldHaven to 1 ;this is the flag for the ownership on the bed
30 "TR_m3_Gor4_DoorRoom1"->unlock ;also needed if you have locked the room, use a specific objectRef
31
32 else ;setup is done so check to see if the day is over
33
34 if ( Day != rentDay )
35 set cleanup to 1
36
37 elseif ( Month != rentMonth )
38 set cleanup to 1
39
40 endif
41
42 endif
43
44 if ( CellChanged == 1 ) ;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
45 if ( cleanup == 1 ) ;this gets called when the rental is over and everything can be cleaned up
46 set rent to 0
47 set TR_m3_Rent_Gorne_EmeraldHaven to 0
48 set setup to 0
49 set rentDay to 0
50 set rentMonth to 0
51 set cleanup to 0
52 "TR_m3_Gor4_DoorRoom1"->lock 50
53 endif
54 endif
55
56endif
57
58
59end TR_m3_A8_Dralin_Belvayn_S