Change employee dialog. Part of patch #333: Attitude change to IPO employees, by Kevin Zheng.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@18741 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
533b711d5a
commit
f6e102ee42
|
@ -1,4 +1,4 @@
|
||||||
# Script for say event of IPO employees
|
# say.py -- script for say event of IPO employees
|
||||||
#
|
#
|
||||||
# Copyright (C) 2002 Joris Bontje
|
# Copyright (C) 2002 Joris Bontje
|
||||||
#
|
#
|
||||||
|
@ -19,74 +19,79 @@
|
||||||
# The author can be reached via e-mail at jbontje@suespammers.org
|
# The author can be reached via e-mail at jbontje@suespammers.org
|
||||||
#
|
#
|
||||||
# Updated to use new path functions in CFPython - Todd Mitchell
|
# Updated to use new path functions in CFPython - Todd Mitchell
|
||||||
#
|
|
||||||
# help - gives information about usage
|
|
||||||
# pen - drops IPO Writing Pen on the floor
|
|
||||||
# literacy - drops IPO Scroll of Literacy on the floor
|
|
||||||
# mailscroll <friend> - drops mailscroll to <friend> on the floor
|
|
||||||
# mailwarning <foo> - drops mailwarning to <foo> on the floor
|
|
||||||
|
|
||||||
# Constant price values (all prices in platinum coins)
|
#### Constants ####
|
||||||
|
|
||||||
|
# Price values in platinum coins.
|
||||||
priceWritingPen = 100
|
priceWritingPen = 100
|
||||||
priceScrollOfLiteracy = 5000
|
priceScrollOfLiteracy = 5000
|
||||||
priceMailScroll = 2
|
priceMailScroll = 2
|
||||||
priceFactor = 50 # platinum to silver conversion
|
priceFactor = 50 # platinum to silver conversion
|
||||||
|
|
||||||
# package information
|
# Define several different types of packages on sale.
|
||||||
# The format is: <name to display to player> : [ price (in plat), max weight, archetype, name ]
|
# The format is: <name to display to player> : [ price (in plat), max weight, archetype, name ]
|
||||||
packages = { 'bag' : [ 5, 5000, 'bag', 'IPO-bag'], 'package' : [ 50, 50000, 'package', 'IPO-package' ], 'carton' : [ 200, 100000, 'carton_box_1', 'IPO-carton' ] }
|
packages = {'bag' : [ 5, 5000, 'bag', 'IPO-bag'],
|
||||||
#priceBag = 5
|
'package' : [ 45, 50000, 'package', 'IPO-package' ],
|
||||||
#pricePackage = 50
|
'carton' : [ 90, 100000, 'carton_box_1', 'IPO-carton' ] }
|
||||||
#priceCarton = 200
|
|
||||||
|
|
||||||
# Map storage for packages
|
# Map storage for packages
|
||||||
storage_map = '/planes/IPO_storage'
|
storage_map = '/planes/IPO_storage'
|
||||||
storage_x = 2
|
storage_x = 2
|
||||||
storage_y = 2
|
storage_y = 2
|
||||||
|
|
||||||
# Post office sack name (one word without space)
|
import CFLog
|
||||||
#sackNames = [ 'IPO-bag', 'IPO-package', 'IPO-carton' ]
|
|
||||||
|
|
||||||
import Crossfire
|
import Crossfire
|
||||||
import string
|
import string
|
||||||
import CFLog
|
|
||||||
|
|
||||||
activator = Crossfire.WhoIsActivator()
|
activator = Crossfire.WhoIsActivator()
|
||||||
activatorname = activator.Name
|
activatorname = activator.Name
|
||||||
whoami = Crossfire.WhoAmI()
|
whoami = Crossfire.WhoAmI()
|
||||||
|
|
||||||
x = activator.X
|
x = activator.X
|
||||||
y = activator.Y
|
y = activator.Y
|
||||||
|
|
||||||
log = CFLog.CFLog()
|
log = CFLog.CFLog()
|
||||||
text = Crossfire.WhatIsMessage().split()
|
text = Crossfire.WhatIsMessage().split()
|
||||||
|
|
||||||
if text[0] == 'help' or text[0] == 'yes':
|
# Have a conversation with the player about what's on sale.
|
||||||
# split the help message in two parts to prevent the server from truncating it.
|
if Crossfire.MatchString("buy", text[0]):
|
||||||
help = 'How can I help you?\nWe are proud to sell some interesting services.\n\nYou can buy:\n- pen (%s platinum)\n- literacy scroll (%s platinum)\n\n'%(priceWritingPen,priceScrollOfLiteracy)
|
whoami.Say("Well, we have a few items for sale. You can also send out letters and packages to your friends. What can I interest you in?")
|
||||||
help = help + 'You can send letters to friends:\n'
|
Crossfire.AddReply("items", "What items do you sell?")
|
||||||
help = help + '- mailscroll <friend> (%s platinum)\n\n'%(priceMailScroll)
|
Crossfire.AddReply("letter", "I'd like to send a letter.")
|
||||||
help = help + 'You can also send items, here are our fees:\n'
|
Crossfire.AddReply("mail", "I want to send a package.")
|
||||||
for pack in packages.keys():
|
|
||||||
# weight is in grams, so need to convert.
|
|
||||||
help = help + '- %s (max weight: %d kg, price: %d platinum)\n'%(pack, packages[pack][1] / 1000, packages[pack][0])
|
|
||||||
|
|
||||||
whoami.Say(help)
|
elif Crossfire.MatchString("items", text[0]):
|
||||||
whoami.Say('To send a package to a friend, say \'send <friend\'s name>\'.')
|
whoami.Say("Here are the items on sale:\n" +
|
||||||
whoami.Say('To receive your packages, say \'receive\'.')
|
" - pen (%i platinum)\n" % priceWritingPen +
|
||||||
|
" - literacy scroll (%i platinum)\n" % priceScrollOfLiteracy +
|
||||||
|
"Please tell me what you'd like to buy.")
|
||||||
|
|
||||||
if activator.DungeonMaster:
|
if activator.DungeonMaster:
|
||||||
whoami.Say('As a DungeonMaster, you can also order:\n- mailwarning <player>')
|
whoami.Say("Oh, and as a dungeon master, you can also order:\n" +
|
||||||
|
" - mailwarning <player name> (free)")
|
||||||
|
|
||||||
|
elif Crossfire.MatchString("letter", text[0]):
|
||||||
|
whoami.Say("For %i platinum you can send a letter to your friend. Just say 'mailscroll <friend name>'." % priceMailScroll)
|
||||||
|
|
||||||
|
elif Crossfire.MatchString("mail", text[0]):
|
||||||
|
reply = "To send items, buy one of our following containers:\n"
|
||||||
|
|
||||||
|
for pack in packages.keys():
|
||||||
|
# weight is in grams, so need to convert.
|
||||||
|
reply += " - %s (limit %d kg, %d platinum)\n" % (pack, packages[pack][1] / 1000, packages[pack][0])
|
||||||
|
|
||||||
|
reply += "When you're ready to send it, say 'send <friend name>'."
|
||||||
|
whoami.Say(reply)
|
||||||
|
|
||||||
|
# Sell items to the player if he/she asks for them.
|
||||||
elif text[0] == 'pen':
|
elif text[0] == 'pen':
|
||||||
if activator.PayAmount(priceWritingPen*priceFactor):
|
if activator.PayAmount(priceWritingPen*priceFactor):
|
||||||
whoami.Say('Here is your IPO Writing Pen')
|
whoami.Say("Here is your pen, enjoy!")
|
||||||
id = activator.Map.CreateObject('writing pen', x, y)
|
id = activator.Map.CreateObject('writing pen', x, y)
|
||||||
id.Name = 'IPO Writing Pen'
|
id.Name = 'IPO writing pen'
|
||||||
id.Value = 0
|
id.Value = 0
|
||||||
else:
|
else:
|
||||||
whoami.Say('You need %s platinum for an IPO Writing Pen'%priceWritingPen)
|
whoami.Say("I'm sorry, you need %d platinum to buy a pen." % priceWritingPen)
|
||||||
|
|
||||||
|
|
||||||
elif text[0] == 'literacy':
|
elif text[0] == 'literacy':
|
||||||
if activator.PayAmount(priceScrollOfLiteracy*priceFactor):
|
if activator.PayAmount(priceScrollOfLiteracy*priceFactor):
|
||||||
|
@ -208,9 +213,12 @@ elif text[0] == 'receive':
|
||||||
else:
|
else:
|
||||||
whoami.Say('Here you go.')
|
whoami.Say('Here you go.')
|
||||||
else:
|
else:
|
||||||
whoami.Say('Sorry, our package delivery service is currently in strike. Please come back later.')
|
whoami.Say("I'm sorry, our package delivery service is currently on strike. Please come back later.")
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
whoami.Say('Do you need help?')
|
whoami.Say("Welcome to the IPO! How can I help you?")
|
||||||
|
Crossfire.AddReply("buy", "What can I buy here?")
|
||||||
|
Crossfire.AddReply("receive", "Do I have any packages?")
|
||||||
|
|
||||||
Crossfire.SetReturnValue(1)
|
Crossfire.SetReturnValue(1)
|
||||||
|
|
Loading…
Reference in New Issue