Scripts

TR_m3_Pub_RD_Lodge

TR_Mainland.esm
Variables 10
Local Variables
TR_Map
control
controlQ
rent
rentDay
rentMonth
setup
cleanup
T_Local_NPC
NoLore
Source
1begin TR_m3_Pub_RD_Lodge 2 3short TR_Map 4short control 5short controlQ 6 7;This version includes no door lock/unlock and allows free access to Temple/Indoril players 8 9;Cell: Roa Dyr, Lodge 10;Publican: Rels Vedas (TR_m3_Rels_Vedas) 11;Flag: TR_m3_Rent_RD_Lodge 12 13;all rooms get rented for one day 14;This guy must be in the map where the room is if you use the locked door cell loading cleanup 15;rename the script for the guy and make a specific door to unlock or flag to set 16;NO actual key is given to player, a global flag is set that removes the ownership on the beds. 17 18;this script fires off when RENT is set true. Rent is set true throuhg the BEDS topic in dialogue, which all Publicans have. 19;Each publican will also have a separate response to buying the bed, so they can give simple directions. There is also a default one. 20 21short rent ;if room is rented, set through dialogue on this NPC 22short rentDay ;the day of the rental 23short rentMonth ;the month of the rental 24short setup ;if setup has been done 25short cleanup ;true if you want to cleanup all the flags, rental is over and can be reset 26short T_Local_NPC 27short NoLore 28;this script also uses a global variable (TR_m3_Rent_RD_Lodge). Make a new one for each rental. You can have as many 29;beds as you want use that variable, it is used through the ownership data on the object reference 30 31if ( CellChanged == 1 ) 32 if ( GetPCRank "Temple" >= 0 ) 33 set "TR_m3_Rent_RD_Lodge" to 1 34 set rent to 0 35 endif 36 if ( GetPCRank "T_Mw_HouseIndoril" >= 0 ) 37 set "TR_m3_Rent_RD_Lodge" to 1 38 set rent to 0 39 endif 40endif 41 42if ( rent == 1 ) 43 44 if ( setup == 0 ) 45 set rentDay to Day 46 set rentMonth to Month 47 set setup to 1 48 set TR_m3_Rent_RD_Lodge to 1 ;this is the flag for the ownership on the bed 49 50 else ;setup is done so check to see if the day is over 51 52 if ( Day != rentDay ) 53 set cleanup to 1 54 55 elseif ( Month != rentMonth ) 56 set cleanup to 1 57 58 endif 59 60 endif 61 62 if ( cleanup == 1 ) ;this gets called when the rental is over and everything can be cleaned up 63 set rent to 0 64 set TR_m3_Rent_RD_Lodge to 0 65 set setup to 0 66 set rentDay to 0 67 set rentMonth to 0 68 set cleanup to 0 69 endif 70 71endif 72 73if ( TR_Map == 3 ) 74 return 75endif 76 77set TR_Map to 3 78 79end