Tavern script

Old and generally outdated discussions, with the rare hidden gem. Enter at your own risk.

Moderators: Haplo, Lead Developers

Locked
User avatar
Rodan
Developer Emeritus
Posts: 1783
Joined: Thu Aug 21, 2003 10:20 am
Location: City of Black Light
Contact:

Tavern script

Post by Rodan »

Script used to rent rooms in taverns (modified slightly from the official script)

begin MYS_Pub_BlackLight_Howling (begins script)

short rent (beginning of variables)
short rentDay
short rentMonth
short setup
short cleanup (end of variables)

if ( rent == 1 )
if ( setup == 0 )
set rentDay to Day
set rentMonth to Month
set setup to 1
set Rent_Howling_BlackLight to 1
"blacklight_howling_room"->unlock
else
if ( Day != rentDay )
set cleanup to 1
elseif ( Month != rentMonth )
set cleanup to 1
endif
endif
if ( CellChanged == 1 )
if ( cleanup == 1)
set rent to 0
set Rent_Howling_BlackLight to 0
set setup to 0
set rentDay to 0
set rentMonth to 0
set cleanup to 0
"blacklight_howling_room"->lock 50
endif
endif
endif

end MYS_Pub_BlackLight_Howling (end of script)

The script is attached to the innkeeper. Since the script also has a door involved (the 'blacklight_howling_room' global variable) the door (which should be locked on creation) has to have the innkeeper assigned as owner and 'Rent_Howling_BlackLight' as a Global Variable. The bed will have the innkeeper assigned as owner and 'Rent_Howling_BlackLight' assigned to it as well.

On the Global Variables you don't use the one above, use a unique name as 'Rent_'CityName'_'TavernName' an example

(The script should be tabbed out per if else endif (the forum wouldn't allow me to measure it out as I liked))
Last edited by Rodan on Sun Dec 21, 2003 2:40 am, edited 1 time in total.
"Never take life too seriously, you'll never get out of it alive!"
- Bugs Bunny

Yes, that is a Dusty (my cat)

Projects done:
Black Light (5-1)
Released - v.1 (done)
Claim 2-34
Lots of interiors for Black Light

Current Projects:
None
User avatar
bas
Developer
Posts: 146
Joined: Thu Dec 30, 2004 10:15 pm
Location: The Netherlands

Post by bas »

add week too...
If it bleeds, it can be killed..
Assassinace
Developer
Posts: 811
Joined: Thu Aug 21, 2003 10:56 am
Location: Dreamland

Post by Assassinace »

Very clean and simple the way I like it. However aren't dates day/month in morrowind I don't remember a week? Therefore I don't see why a "week" is needed.
Locked