mirror of
https://github.com/afritz1/OpenTESArena.git
synced 2026-09-11 12:56:41 +02:00
Page:
Services
Pages
Character Generation
Chasms
City Generation
Combat
Dialogue
Diseases
Dungeon Generation
Home
Interiors
Items
Light levels
Loot
Movement
NPCs
Name generation
Player stats
Resting
Save File Formats
Services
Shops
Sky behavior
Skybox
Spellmaker
Spells
Thieving
Time and Calendar
Timing
Travel
User interface
Weather
Wilderness
No results
5
Services
Allofich edited this page 2024-05-06 03:13:39 +09:00
Table of contents
The venueSeed below is a 4-byte value formed as XX YY mm nn, where X and Y are the door block coordinates, and m and n are the indices of the name components. (TODO: example)
Tavern services
Drinks
Each drink bought increases the counter, and when it passes a certain limit, a drunkenness effect is applied. It seems the counter should have decreased by 1 every hour, but probably due to a bug, it happens every minute. The strength of the effect depend on the drink price.
srand(venueSeed)
list <- []
entries <- []
for i <- 0, 9
do
r <- rnd(16) # 0..15, apparently another bug and 0x15 was meant
while r in list
list.append(r)
name <- drinks[r]
price <- adjustHoliday(drinkPrice[r], 1) # service
listEntry <- sprintf(priceFmt, price, name)
entries.append(listEntry)
if pc.race == BRETON then X <- 12 else X <- 25
limit <- pc.stat[END]/X
if drinksConsumed > limit then
applyDrunkenness(pc, drinkPrice[id])
pc.recalcStats()
endif
applyDrunkenness(npc, magn) <-
magnitude <- magn * 5
if npc.race == BRETON then duration <- 120 else duration <- 60
npc.addEffect(<DRUNK with +magnitude to STR, WIL, END, LUC and -magnitude to INT, AGI, SPD, PER>)
drinks is a szlist @4153E. drinkPrice is a byte array @41614. priceFmt is a string @46797, "\t200%u gp\n%s"
Temple services
Blessing
cost <- adjustHoliday((pc.level + 1) * 5, 4)
if donate >= pc.gold then
pc.gold <- pc.gold - donate
magnitude <- donate / cost
globalBlessing <- globalBlessing + hexPercent(magnitude)
endif
globalBlessing is set to 0 each new week.
Healing
if pc.curHP == pc.maxHP then
response <- sprintf(healNoNeed, pc.name)
return
endif
price <- adjustHoliday((pc.level + 1) * 15, 1)
templeConfirmation <- sprinf(templeConf, price)
if askYesNo(templeConfirmation) then
# remove price gold etc
response <- sprintf(healOK, pc.name)
showMessage(response)
pc.curHP <- pc.maxHP
endif
templeConf is a string @46A2D. healOK is @46942. healNoNeed is @46959.