TR_m7_Pub_Narsis_GoldDragon
TR_Mainland.esm
Variables
11
Local Variables
TR_Map
control
controlQ
rent
rentDay
rentMonth
setup
cleanup
T_Local_NPC
NoLore
timer
Source
1begin TR_m7_Pub_Narsis_GoldDragon
2
3;Cell: Narsis, Gold Dragon Inn
4;Publican: TR_m7_Asius Tarlo
5;Flag: TR_m7_Rent_Narsis_Dragon
6;Room Door: TR_m7_rd_Narsis_GoldDragon
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 control
18short controlQ
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
26float timer
27;this script also uses a global variable (TR_m7_Rent_Narsis_Dragon). Make a new one for each rental. You can have as many
28;beds as you want use that variable, it is used through the ownership data on the object reference
29
30if ( rent == 1 )
31
32 if ( setup == 0 )
33 set rentDay to Day
34 set rentMonth to Month
35 set setup to 1
36 set TR_m7_Rent_Narsis_Dragon to 1 ;this is the flag for the ownership on the bed
37 TR_m7_rd_Narsis_GoldDragon->unlock ;opens the door
38 TR_m7_rd_Narsis_GoldDragon->PlaySound3D "Open Lock"
39
40 else ;setup is done so check to see if the day is over
41
42 if ( Day != rentDay )
43 set cleanup to 1
44
45 elseif ( Month != rentMonth )
46 set cleanup to 1
47
48 endif
49
50 endif
51
52 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
53 if ( cleanup == 1 ) ;this gets called when the rental is over and everything can be cleaned up
54 set rent to 0
55 set TR_m7_Rent_Narsis_Dragon to 0
56 TR_m7_rd_Narsis_GoldDragon->lock 50 ;locks the door
57 TR_m7_rd_Narsis_GoldDragon->PlaySound3D "LockedDoor"
58 set setup to 0
59 set rentDay to 0
60 set rentMonth to 0
61 set cleanup to 0
62 endif
63 endif
64
65endif
66
67; Script for Narsis Imperial Cult Quest 1, to force greeting if player casts blessing on publican
68if ( controlQ == 0 )
69 if ( GetSpellEffects TR_m7_q_Ns_IC1_BlessingZen == 1 )
70 set controlQ to 1
71 endif
72elseif ( controlQ == 1 )
73 if ( MenuMode == 0 )
74 set timer to ( timer + GetSecondsPassed )
75 if ( timer > 1 )
76 ForceGreeting
77 endif
78 endif
79endif
80
81; This short script is there to allow dialogue to be filtered on the TR_Map local variable,
82; allowing for regional topics such as "Morrowind Lore" or "Geographic Regions" to be
83; appropriate to the location the NPC is.
84
85if ( TR_Map == 7 )
86 return
87endif
88
89set TR_Map to 7
90
91End