TR_m4_Pub_Omaynis_Nalvos
TR_Mainland.esm
Variables
13
Local Variables
CL1
CL2
TR_Map
control
controlQ
rent
rentDay
rentMonth
setup
cleanup
OnPCHitMe
T_Local_NPC
NoLore
Source
1begin TR_m4_Pub_Omaynis_Nalvos
2
3;Cell: Omaynis, The Kwama's Scuttle
4;Publican: Either Nalvos Omayn or Olvys Omayn
5;Flag: TR_m4_Rent_Omaynis
6;Room Doors: TR_m4_rd_Omaynis (inside), TR_act_m4_Inn_11_rent (outside)
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
16; combined publican and MT writ script.
17
18short CL1
19short CL2
20short TR_Map
21short control
22short controlQ
23short rent ;if room is rented, set through dialogue on this NPC
24short rentDay ;the day of the rental
25short rentMonth ;the month of the rental
26short setup ;if setup has been done
27short cleanup ;true if you want to cleanup all the flags, rental is over and can be reset
28short OnPCHitMe
29short T_Local_NPC
30short NoLore
31;this script also uses a global variable (TR_m1_Rent_Dancing_Cup). Make a new one for each rental. You can have as many
32;beds as you want use that variable, it is used through the ownership data on the object reference
33
34if ( rent == 1 )
35
36 if ( setup == 0 )
37 set rentDay to Day
38 set rentMonth to Month
39 set setup to 1
40 set TR_m4_Rent_Omaynis to 1 ;this is the flag for the ownership on the bed
41 TR_m4_rd_Omaynis->unlock ;opens the door
42 TR_act_m4_Inn_11_rent->Unlock
43 TR_m4_rd_Omaynis->PlaySound3D "Open Lock"
44
45 else ;setup is done so check to see if the day is over
46
47 if ( Day != rentDay )
48 set cleanup to 1
49
50 elseif ( Month != rentMonth )
51 set cleanup to 1
52
53 endif
54
55 endif
56
57 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
58 if ( cleanup == 1 ) ;this gets called when the rental is over and everything can be cleaned up
59 set rent to 0
60 set TR_m4_Rent_Omaynis to 0
61 TR_m4_rd_Omaynis->lock 30 ;locks the door
62 TR_act_m4_Inn_11_rent->Lock 40
63 TR_m4_rd_Omaynis->PlaySound3D "LockedDoor"
64 set setup to 0
65 set rentDay to 0
66 set rentMonth to 0
67 set cleanup to 0
68 endif
69 endif
70
71endif
72
73if ( MenuMode == 1 )
74 return
75endif
76
77if ( CellChanged == 1 )
78 set CL1 to GetPCCrimeLevel
79endif
80
81if ( OnDeath == 1 )
82 ; when we are killed...
83
84 if ( GetJournalIndex TR_m4_MT_Omayn > 0 )
85 ; ... and if the player has a writ for us...
86
87 set CL2 to GetPCCrimeLevel
88 if ( CL2 > CL1 )
89 ; ... append a journal entry if the execution is seen ...
90 Player->Journal TR_m4_MT_Omayn 80
91 else
92 ; ... append a journal entry if the execution is NOT seen ...
93 Player->Journal TR_m4_MT_Omayn 90
94 endif
95 endif
96endif
97
98; This short script is there to allow dialogue to be filtered on the TR_Map local variable,
99; allowing for regional topics such as "Morrowind Lore" or "Geographic Regions" to be
100; appropriate to the location the NPC is.
101
102if ( TR_Map == 4 )
103 return
104endif
105
106set TR_Map to 4
107
108End