Scripts

TR_m3_Pub_Innside_Out

TR_Mainland.esm
Variables 10
Local Variables
T_Local_NPC
TR_Map
control
controlQ
NoLore
rent
rentDay
rentMonth
setup
cleanup
Source
1begin TR_m3_Pub_Innside_Out 2 3short T_Local_NPC 4short TR_Map 5short control 6short controlQ 7short NoLore 8 9;Cell: Darvonis, Innside Out 10;Publican: Norvel Dilmdar (TR_m3_Norvel_Dilmdar) 11;Flag: TR_m3_Rent_INNSIDEOUT 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 through 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 26;this script also uses a global variable (TR_m3_Rent_Aimrah_Inn). Make a new one for each rental. You can have as many 27;beds as you want use that variable, it is used through the ownership data on the object reference 28 29if ( rent == 1 ) 30 if ( setup == 0 ) 31 set rentDay to Day 32 set rentMonth to Month 33 set setup to 1 34 set TR_m3_Rent_INNSIDEOUT to 1 ;this is the flag for the ownership on the bed 35 "TR_m3_rd_Innsideout"->unlock ;also needed if you have locked the room, use a specific objectRef 36 else ;setup is done so check to see if the day is over 37 if ( Day != rentDay ) 38 set cleanup to 1 39 elseif ( Month != rentMonth ) 40 set cleanup to 1 41 endif 42 endif 43 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 44 if ( cleanup == 1 ) ;this gets called when the rental is over and everything can be cleaned up 45 set rent to 0 46 set TR_m3_Rent_INNSIDEOUT to 0 47 "TR_m3_rd_Innsideout"->lock 30 48 set setup to 0 49 set rentDay to 0 50 set rentMonth to 0 51 set cleanup to 0 52 endif 53 endif 54endif 55 56if ( TR_Map == 3 ) 57 return 58endif 59set TR_Map to 3 60 61end