Scripts

TR_m1_Pub_Avenue

TR_Mainland.esm
Variables 8
Local Variables
TR_Map
control
rent
rentDay
rentMonth
state
T_Local_NPC
NoLore
Source
1Begin TR_m1_Pub_Avenue 2 3;This is a script on "TR_m1_Fedura_Drenim" in Port Telvannis, The Avenue: Subterranean Balconies 4;It handles the renting of a room. "TR_m1_Rent_Avenue" is a global flag for this room renting. 5 6short TR_Map 7short control 8short rent 9short rentDay 10short rentMonth 11short state 12short T_Local_NPC 13short NoLore 14 15if ( rent == 1 ) ;if room is rented (set through dialogue on NPC) 16 if ( state == 0 ) ;initially 17 set rentDay to Day ;record day 18 set rentMonth to Month ;and record month 19 set TR_m1_Rent_Avenue to 1 ;this is the flag for the ownership on the bed 20 "TR_m1_rd_Avenue"->unlock ;unlocks the room door 21 set state to 1 ;toggle to check for day changing. 22 elseif ( state == 1 ) ;waiting for day to change 23 if ( Day != rentDay ) ;if day changes 24 Set state to 2 ;toggle to un-rent the room 25 elseif ( Month != rentMonth ) ;if month changes 26 Set state to 2 ;toggle to un-rent the room 27 endif 28 elseif ( CellChanged ) ;if rent has run out and player has left cell (don't want to lock them in) 29 Set rent to 0 ;mark room as not rented 30 Set TR_m1_Rent_Avenue to 0 ;return ownership of bed to publican 31 Set state to 0 ;reset 32 Set rentDay to 0 ;reset 33 Set rentMonth to 0 ;reset 34 "TR_m1_rd_Avenue"->lock 45 ;re-lock the door 35 endif 36endif 37 38;standard TR NPC stuff for map 1 39if ( TR_Map == 1 ) 40 return 41endif 42 43set TR_Map to 1 44 45End