TR_m2_Pub_Necrom_Hostel
TR_Mainland.esm
Variables
10
Local Variables
rent
rentDay
rentMonth
setup
cleanup
TR_Map
control
controlQ
T_Local_NPC
NoLore
Source
1begin TR_m2_Pub_Necrom_Hostel
2
3;Cell: Necrom, Temple Hostel
4;Publican: Duldres Herendal
5;Flag: TR_m2_Rent_Necrom_Hostel
6
7;all rooms get rented for one day
8;This guy must be in the map where the room is if you use the locked door cell loading cleanup
9;rename the script for the guy and make a specific door to unlock or flag to set
10;NO actual key is given to player, a global flag is set that removes the ownership on the beds.
11
12;this script fires off when RENT is set true. Rent is set true throuhg the BEDS topic in dialogue, which all Publicans have.
13;Each publican will also have a separate response to buying the bed, so they can give simple directions. There is also a default one.
14
15short rent ;if room is rented, set through dialogue on this NPC
16short rentDay ;the day of the rental
17short rentMonth ;the month of the rental
18short setup ;if setup has been done
19short cleanup ;true if you want to cleanup all the flags, rental is over and can be reset
20short TR_Map
21short control
22short controlQ
23short T_Local_NPC
24short NoLore
25;this script also uses a global variable (Rent_Bed_Pelagiad). 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
27
28
29if ( TR_Map == 0 )
30 set TR_Map to 2
31endif
32
33if ( rent == 1 )
34
35 if ( setup == 0 )
36 set rentDay to Day
37 set rentMonth to Month
38 set setup to 1
39 set TR_m2_Rent_Necrom_Hostel to 1 ;this is the flag for the ownership on the bed
40 TR_m2_rent_nec_hostel_door->unlock
41
42 else ;setup is done so check to see if the day is over
43
44 if ( Day != rentDay )
45 set cleanup to 1
46
47 elseif ( Month != rentMonth )
48 set cleanup to 1
49
50 endif
51
52 endif
53
54 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
55 if ( cleanup == 1 ) ;this gets called when the rental is over and everything can be cleaned up
56 set rent to 0
57 set TR_m2_Rent_Necrom_Hostel to 0
58 "TR_m2_rent_nec_hostel_door"->lock 20
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
69end