示例#1
0
def onTextInput(player, item, inputid, text):
	# Check if the vendor the item is in is owned by us
	vendor = item.getoutmostchar()

	if not vendor or not vendor.hasscript('npc.playervendor'):
		return

	if not player.gm and vendor.owner != player:
		player.socket.sysmessage(tr('You cannot set the properties of items in a player vendor not owned by you.'))
		return

	parts = text.split(' ', 1)
	description = ''

	try:
		price = int(parts[0])
	except:
		price = 0

	if price < 0:
		price = 0

	if len(parts) == 2:
		description = parts[1]
	else:
		description = ''

	setSellInfo(item, price, description)
示例#2
0
文件: item.py 项目: thooge/Wolfpack
def onTextInput(player, item, inputid, text):
    # Check if the vendor the item is in is owned by us
    vendor = item.getoutmostchar()

    if not vendor or not vendor.hasscript('npc.playervendor'):
        return

    if not player.gm and vendor.owner != player:
        player.socket.sysmessage(
            tr('You cannot set the properties of items in a player vendor not owned by you.'
               ))
        return

    parts = text.split(' ', 1)
    description = ''

    try:
        price = int(parts[0])
    except:
        price = 0

    if price < 0:
        price = 0

    if len(parts) == 2:
        description = parts[1]
    else:
        description = ''

    setSellInfo(item, price, description)
示例#3
0
def onTextInputCancel(player, item, inputid):
	# Check if the vendor the item is in is owned by us
	vendor = item.getoutmostchar()

	if not vendor or not vendor.hasscript('npc.playervendor'):
		return

	if not player.gm and vendor.owner != player:
		player.socket.sysmessage(tr('You cannot set the properties of items in a player vendor not owned by you.'))
		return

	setSellInfo(item, 0, '')
示例#4
0
文件: item.py 项目: thooge/Wolfpack
def onTextInputCancel(player, item, inputid):
    # Check if the vendor the item is in is owned by us
    vendor = item.getoutmostchar()

    if not vendor or not vendor.hasscript('npc.playervendor'):
        return

    if not player.gm and vendor.owner != player:
        player.socket.sysmessage(
            tr('You cannot set the properties of items in a player vendor not owned by you.'
               ))
        return

    setSellInfo(item, 0, '')