示例#1
0
def rename_key(char, key):
    # Build the lock gump
    gump = cGump(x=100, y=100, callback=gump_response)
    gump.setArgs([key.serial])

    if not char.gm:
        width = 325
    else:
        width = 425

    # Renaming, blanking and modification of keys allowed for gms
    gump.addBackground(id=0x2436, width=width, height=220)

    if char.gm:
        text = tr(
            '<basefont color="#FECECE"><h3>Manage Key</h3><br><basefont color="#FEFEFE">This dialog will help you to manage or rename this key.'
        )
    else:
        text = tr(
            '<basefont color="#FECECE"><h3>Manage Key</h3><br><basefont color="#FEFEFE">This dialog will help you to rename this key.'
        )

    gump.addHtmlGump(x=20, y=20, width=410, height=90, html=text)

    gump.addText(x=20, y=65, text=tr('The name of this key:'), hue=0x835)
    gump.addResizeGump(x=20, y=88, id=0xBB8, width=200, height=25)
    gump.addInputField(x=25,
                       y=90,
                       width=190,
                       height=20,
                       hue=0x834,
                       id=1,
                       starttext=key.name)

    # InputField for the key id
    if char.gm:
        lock = ''
        if key.hastag('lock'):
            lock = str(key.gettag('lock'))

        gump.addText(x=235,
                     y=65,
                     text=tr('The lock id of this key:'),
                     hue=0x835)
        gump.addResizeGump(x=235, y=88, id=0xBB8, width=160, height=25)
        gump.addInputField(x=240,
                           y=90,
                           width=150,
                           height=20,
                           hue=0x834,
                           id=2,
                           starttext=lock)

    gump.addText(x=50, y=130, text=tr('Modify key'), hue=0x835)
    gump.addButton(x=20, y=130, up=0x26af, down=0x26b1, returncode=1)

    gump.addText(x=50, y=170, text=tr('Cancel'), hue=0x835)
    gump.addButton(x=20, y=170, up=0x26af, down=0x26b1, returncode=0)

    gump.send(char)
示例#2
0
def onWorldSave():
    if ENABLEDFANCYSTATUS:
        # Creating Dialog
        dialog = cGump(nomove=1, nodispose=1, x=150, y=150)

        dialog.setType(
            0x98FA2C10
        )  # NEVER change this Type or Gump will not be closed in the end of save

        dialog.addResizeGump(0, 0, 9200, 291, 90)
        dialog.addCheckerTrans(0, 0, 291, 90)
        dialog.addText(47, 19, tr("WORLDSAVE IN PROGRESS"), 2122)
        dialog.addText(47, 37,
                       tr("Saving %i items.") % (wolfpack.itemcount()), 2100)
        dialog.addText(47, 55,
                       tr("Saving %i characters.") % (wolfpack.charcount()),
                       2100)
        dialog.addTilePic(3, 25, 4167)

        # Sending to players

        worldsocket = wolfpack.sockets.first()
        while worldsocket:
            dialog.send(worldsocket)
            worldsocket = wolfpack.sockets.next()
示例#3
0
def onUse( char, item ):
	# We only can rename marked runes
	if item.gettag( 'marked' ) != 1:
		char.socket.sysmessage( tr("This rune is not marked.") )
		return True

	# We are only handling runes
	if not isrune( item ):
		return 0

	# It needs to be on our body
	if item.getoutmostchar() != char:
		char.socket.sysmessage( tr("The rune needs to be in your posession to rename it.") )
		return True

	gump = cGump( 0, 0, 0, 50, 50 )
	# Header
	gump.addBackground( 0x24a4, 300, 200 )
	gump.addTilePic( 80, 33, 0x1F14 )
	gump.addHtmlGump( 10, 30, 300, 20, tr('<basefont size="7" color="#336699"><center>Rename rune</center></basefont>') )

	# Rename Field
	gump.addHtmlGump( 40, 60, 300, 20, tr('How do you like to name the rune?') )
	gump.addResizeGump( 40, 80, 0x2486, 206, 26 )
	gump.addInputField( 43, 83, 200, 20, 0x539, 1, item.name )

	gump.addButton( 43, 125, 2128, 2129, 1000 ) # Ok
	gump.addButton( 110, 125, 2119, 2120, 0 ) # Cancel

	gump.setCallback( rename_callback )
	gump.setArgs( [ item ] )
	gump.send( char )

	return True
示例#4
0
    def __init__(self, header, headerColor, content, contentColor, width,
                 height, callback, state):
        self.callback = callback
        self.state = state

        self.gump = cGump(1, 0, 0, (640 - width) / 2, (480 - height) / 2)
        self.gump.startPage(0)
        self.gump.addBackground(5054, width, height)
        self.gump.addTiledGump(10, 10, width - 20, 20, 2624)
        self.gump.addCheckerTrans(10, 10, width - 20, 20)
        self.gump.addXmfHtmlGump(10, 10, width - 20, 20, header, 0, 0,
                                 headerColor)
        self.gump.addTiledGump(10, 40, width - 20, height - 80, 2624)
        self.gump.addCheckerTrans(10, 40, width - 20, height - 80)
        if type(content) is IntType:
            self.gump.addXmfHtmlGump(10, 40, width - 20, height - 80, content,
                                     0, 1, contentColor)
        else:
            self.gump.addHtmlGump(
                10, 40, width - 20, height - 80,
                "<BASEFONT COLOR=#%x>%s</BASEFONT>" % (contentColor, content),
                0, 1)

        self.gump.addTiledGump(10, height - 30, width - 20, 20, 2624)
        self.gump.addCheckerTrans(10, height - 30, width - 20, 20)
        self.gump.addButton(10, height - 30, 4005, 4007, 0)
        self.gump.addXmfHtmlGump(40, height - 30, 170, 20, 1011036, 0, 0,
                                 32767)
    def generate(self, arguments):
        gump = cGump()
        gump.callback = "system.craftmenu.CraftMenuResponse"
        gump.setArgs([self.id] + arguments)
        gump.setType(self.gumptype)
        gump.startPage(0)
        gump.addBackground(0x13BE, 530, 437)
        gump.addTiledGump(10, 10, 510, 22, 0xA40)
        gump.addTiledGump(10, 292, 150, 45, 0xA40)
        gump.addTiledGump(165, 292, 355, 45, 0xA40)
        gump.addTiledGump(10, 342, 510, 85, 0xA40)
        gump.addTiledGump(10, 37, 200, 250, 0xA40)
        gump.addTiledGump(215, 37, 305, 250, 0xA40)
        gump.addCheckerTrans(10, 10, 510, 417)

        if self.titleid > 0:
            gump.addXmfHtmlGump(10, 12, 510, 20, self.titleid, color=0x7FFF)
        else:
            gump.addHtmlGump(10, 12, 510, 20, self.title)
        gump.addXmfHtmlGump(10, 37, 200, 22, 1044010, color=0x7FFF)
        gump.addXmfHtmlGump(215, 37, 305, 22, 1044011, color=0x7FFF)
        gump.addXmfHtmlGump(10, 302, 150, 25, 1044012, color=0x7FFF)

        if self.noticeid > 0:
            gump.addXmfHtmlGump(170, 295, 350, 40, self.noticeid, color=0x7FFF, canScroll=1)
        elif len(self.noticestr) > 0:
            gump.addHtmlGump(170, 295, 350, 40, whitehtml % self.noticestr, canScroll=1)

        return gump
示例#6
0
def showWhoGump(player, page):
	current_page = page

	# Collect the current list of sockets first
	wholist = []

	worldsocket = wolfpack.sockets.first()
	while worldsocket:
		char = worldsocket.player
		if char.invisible and char.rank > player.rank:
			worldsocket = wolfpack.sockets.next()
			continue
		if not char.account:
			wolfpack.sockets.next()
			continue	
		wholist.append(char)
		worldsocket = wolfpack.sockets.next()
		
	count = len(wholist)
		
	# Skip page * 10 users
	newwholist = wholist[page * 10:]

	while len(newwholist) == 0 and page > 0:
		page -= 1
		newwholist = wholist[page * 10:]

	wholist = newwholist
	
	# Player list increases by 22 pixels
	pages = (count + 9) / 10 # 10 per page
		
	gump = cGump( 0, 0, 0, 50, 50 )
	gump.addBackground( 0xE10, 380, 360 )
	gump.addCheckerTrans( 15, 15, 350, 330 );
	gump.addGump( 130, 18, 0xFA8 )
	gump.addText( 165, 20, tr("Who Menu"), 0x530 )
	gump.addButton( 30, 320, 0xFB1, 0xFB3, 0 ) 	# Close Button
	gump.addText( 70, 320, tr("Close"), 0x834 )
	gump.addText( 145, 320, tr("Players: %u") % count, 0x834 )

	gump.addText( 280, 320, tr( "Page %i of %i" % ( page + 1, pages ) ), 0x834 )

	if page + 1 < pages:
		gump.addButton( 260, 320, 0x0FA, 0x0FA, 1 ) # Next Page
		
	if page > 0:
		gump.addButton( 240, 320, 0x0FC, 0x0FC, 2 ) # Previous Page
		
	offset = 22
	wholist = wholist[:10]
	for char in wholist:
		gump.addButton( 20, 40 + offset, 0xFA5, 0xFA7, 2 + char.serial )
		gump.addText( 54, 40 + offset, tr("%s [%s]") % ( char.name, char.account.name ), 0x834 )
		gump.addText( 257, 40 + offset, unicode(char.socket.address), 0x834 )
		offset += 24
	
	gump.setArgs( [ current_page ] )
	gump.setCallback( "commands.who.callbackWho" )
	gump.send( player.socket )
示例#7
0
def import_command(socket, command, arguments):
    char = socket.player

    gump = cGump(x=100, y=100, callback="commands.import.callback")

    gump.addBackground(id=0x2436, width=350, height=300)

    text = '<basefont color="#FEFEFE"><h3>Import - <basefont color="#ff0000">Items Only</basefont></h3><br />Enter the name of the worldfile you want to import below. But before clicking Import, choose the correct file format from the list.</basefont>'
    gump.addHtmlGump(x=20, y=20, width=310, height=200, html=text)

    # Radiobuttons
    gump.startGroup(0)
    gump.addRadioButton(x=20, y=160, off=0x25F8, on=0x25FB, id=1)
    gump.addText(x=55, y=165, text="Multi Txt", hue=0x835)

    gump.addRadioButton(x=150, y=160, off=0x25F8, on=0x25FB, id=2, selected=1)
    gump.addText(x=185, y=165, text="WSC", hue=0x835)

    gump.addRadioButton(x=250, y=160, off=0x25F8, on=0x25FB, id=3)
    gump.addText(x=285, y=165, text="Text", hue=0x835)

    gump.addRadioButton(x=20, y=120, off=0x25F8, on=0x25FB, id=4)
    gump.addText(x=55, y=125, text="Sphere 51a", hue=0x835)

    # gump.addRadioButton( x=150, y=120, off=0x25f8, on=0x25fb, id=5 )
    # gump.addText( x=185, y=125, text='Sphere 55i', hue=0x835 )

    # InputField
    gump.addResizeGump(x=20, y=210, id=0xBB8, width=310, height=25)
    gump.addInputField(x=25, y=212, width=295, height=20, hue=0x834, id=1, starttext="export.wsc")

    gump.addText(x=265, y=250, text="Import", hue=0x835)
    gump.addButton(x=310, y=250, up=0x26AF, down=0x26B1, returncode=1)

    gump.send(char)
示例#8
0
def gump11(char, callback, item):
    # security remove a co owner
    gump_params = ["a house", "sign"]

    mygump = cGump()
    mygump.addRawLayout("{page 0}")
    mygump.addRawLayout("{resizepic 0 0 5054 420 440}")
    mygump.addRawLayout("{gumppictiled 10 10 400 100 2624}")
    mygump.addRawLayout("{checkertrans 10 10 400 100}")
    mygump.addRawLayout("{gumppictiled 10 120 400 260 2624}")
    mygump.addRawLayout("{checkertrans 10 120 400 260}")
    mygump.addRawLayout("{gumppictiled 10 390 400 40 2624}")
    mygump.addRawLayout("{checkertrans 10 390 400 40}")
    mygump.addRawLayout("{button 250 410 4005 4007 1 0 0}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 285 410 240 20 1060675 0 0 32767}")
    mygump.addRawLayout("{gumppic 10 10 100}")
    mygump.addRawLayout("{text 62 43 0 0}")
    mygump.addRawLayout("{text 74 57 0 1}")
    # remove button cause change of callback
    # ~ mygump.addRawLayout( "{button 10 390 4005 4007 1 0 31}" )
    mygump.addRawLayout("{xmfhtmlgumpcolor 45 390 240 20 1060676 0 0 32767}")
    # ~ mygump.addRawLayout( "{button 10 410 4005 4007 1 0 46}" )
    mygump.addRawLayout("{xmfhtmlgumpcolor 45 410 240 20 1060677 0 0 32767}")
    # ~ mygump.addRawLayout( "{button 150 10 4005 4007 1 0 2}" )
    mygump.addRawLayout("{xmfhtmlgumpcolor 195 10 200 20 1060668 0 0 32767}")
    # ~ mygump.addRawLayout( "{button 150 30 4006 4007 1 0 17}" )
    mygump.addRawLayout("{xmfhtmlgumpcolor 195 30 200 20 1060669 0 0 16927}")
    # ~ mygump.addRawLayout( "{button 150 50 4005 4007 1 0 32}" )
    mygump.addRawLayout("{xmfhtmlgumpcolor 195 50 200 20 1060670 0 0 32767}")
    # ~ mygump.addRawLayout( "{button 150 70 4005 4007 1 0 47}" )
    mygump.addRawLayout("{xmfhtmlgumpcolor 195 70 200 20 1060671 0 0 32767}")
    # ~ mygump.addRawLayout( "{button 150 90 4005 4007 1 0 62}" )
    mygump.addRawLayout("{xmfhtmlgumpcolor 195 90 200 20 1060672 0 0 32767}")  # end of common part with gump0
    # mygump.addRawLayout( "{button 10 130 4005 4007 1 0 4}" ) # button see title next line
    mygump.addRawLayout("{xmfhtmlgumpcolor 45 130 240 20 1011274 0 0 32767}")  # View Remove a co-owner from the house
    # ~ mygump.addRawLayout( "{text 45 170 1152 2}" )#~ mygump.addRawLayout( "{text 45 150 1152 2}" ) #ecrit le parametre 2 en blanc

    offsetx = 0
    offsety = 0
    members = getCoOwners(item.multi)
    # ~ char.socket.sysmessage('liste %s'%members)
    for memberserial in members:
        try:
            member = wolfpack.findchar(int(memberserial))
            mygump.addButton(15 + offsety, 150 + offsetx, 0xFA5, 0xFA7, member.serial)
            # ~ mygump.addText( 15 +offsety, 150+offsetx, unicode(' *'), 1152)
            mygump.addText(49 + offsety, 150 + offsetx, unicode(member.name), 1152)
            if offsetx == 192:
                offsetx = 0
                offsety += 200
            else:
                offsetx += 24
        except:
            pass
    mygump.setCallback(callbackremovecoowner)
    mygump.setArgs([item])
    # Add params
    for line in gump_params:
        mygump.addRawText(line)
    mygump.send(char)
示例#9
0
def TrackWhatGump(char):
    gump = cGump(x=20, y=30, callback=trackWhatResponse, type=0x87651592)

    gump.startPage(0)
    gump.addBackground(5054, 440, 135)
    gump.addResizeGump(10, 10, 2620, 420, 75)
    gump.addResizeGump(10, 85, 3000, 420, 25)

    gump.addTilePic(20, 20, 9682)
    gump.addButton(20, 110, 4005, 4007, 1)
    gump.addXmfHtmlGump(20, 90, 100, 20, 1018087)  # Animals

    gump.addTilePic(120, 20, 9607)
    gump.addButton(120, 110, 4005, 4007, 2)
    gump.addXmfHtmlGump(120, 90, 100, 20, 1018088)  # Monsters

    gump.addTilePic(220, 20, 8454)
    gump.addButton(220, 110, 4005, 4007, 3)
    gump.addXmfHtmlGump(220, 90, 100, 20, 1018089)  # Human NPCs

    gump.addTilePic(320, 20, 8455)
    gump.addButton(320, 110, 4005, 4007, 4)
    gump.addXmfHtmlGump(320, 90, 100, 20, 1018090)  # Players

    gump.send(char)

    char.socket.settag('skill_delay',
                       int(wolfpack.time.currenttime() + TRACKING_DELAY))

    if skills.skilltable[TRACKING][skills.UNHIDE] and char.hidden:
        char.reveal()
    return True
示例#10
0
def TrackWhatGump( char ):
	gump = cGump( x=20, y=30, callback=trackWhatResponse, type=0x87651592 )

	gump.startPage( 0 )
	gump.addBackground( 5054, 440, 135 )
	gump.addResizeGump( 10, 10, 2620, 420, 75 )
	gump.addResizeGump( 10, 85, 3000, 420, 25 )

	gump.addTilePic( 20, 20, 9682 )
	gump.addButton( 20, 110, 4005, 4007, 1 )
	gump.addXmfHtmlGump( 20, 90, 100, 20, 1018087 ) # Animals

	gump.addTilePic( 120, 20, 9607 )
	gump.addButton( 120, 110, 4005, 4007, 2 )
	gump.addXmfHtmlGump( 120, 90, 100, 20, 1018088 ) # Monsters

	gump.addTilePic( 220, 20, 8454 )
	gump.addButton( 220, 110, 4005, 4007, 3 )
	gump.addXmfHtmlGump( 220, 90, 100, 20, 1018089 ) # Human NPCs

	gump.addTilePic( 320, 20, 8455 )
	gump.addButton( 320, 110, 4005, 4007, 4 )
	gump.addXmfHtmlGump( 320, 90, 100, 20, 1018090 ) # Players

	gump.send( char )

	char.socket.settag( 'skill_delay', int( wolfpack.time.currenttime() + TRACKING_DELAY ) )

	if skills.skilltable[ TRACKING ][ skills.UNHIDE ] and char.hidden:
		char.reveal()
	return True
示例#11
0
def statictileinfo( socket, model, pos, tile ):
	gump = cGump( 0, 0, 0, 0, 40 )

	gump.addResizeGump( 0, 40, 0xA28, 450, 300 ) # Background
	gump.addGump( 105, 18, 0x58B ) # Fancy top-bar
	gump.addGump( 182, 0, 0x589 ) # "Button" like gump
	gump.addTilePic( 202, 23, 0x14EF ) # Display our tile

	gump.addText( 175, 90, "Static Info", 0x530 )

	# Give information about the tile
	gump.addText( 50, 120, "Name: "+tile['name'], 0x834 )
	gump.addText( 50, 140, "ID: "+hex( model ), 0x834 )
	gump.addText( 50, 160, "Position: "+unicode( pos.x )+","+unicode( pos.y )+","+unicode( pos.z ), 0x834 )
	gump.addText( 50, 180, "Weight: "+unicode( tile['weight'] ), 0x834 )
	gump.addText( 50, 200, "Height: "+unicode( tile['height'] ), 0x834 )

	# Wet ? Impassable ? At least these are the most interesting
	gump.addCroppedText( 50, 220, 230, 40, "Properties: "+ tile['flagnames'], 0x834 )

	# OK button
	gump.addButton( 50, 275, 0xF9, 0xF8, 0 ) # Only Exit possible

	# Item Preview
	gump.addResizeGump( 300, 120, 0xBB8, 110, 150 )
	gump.addTilePic( 340, 160 - ( tile['height'] / 2 ), model )

	gump.send( socket )
	return
示例#12
0
def gump12( char, callback, item ):
	#security view friends list
	gump_params = [
	"a house",
	"sign"]

	mygump = cGump()
	mygump.addRawLayout( "{page 0}" )
	mygump.addRawLayout( "{resizepic 0 0 5054 420 440}" )
	mygump.addRawLayout( "{gumppictiled 10 10 400 100 2624}" )
	mygump.addRawLayout( "{checkertrans 10 10 400 100}" )
	mygump.addRawLayout( "{gumppictiled 10 120 400 260 2624}" )
	mygump.addRawLayout( "{checkertrans 10 120 400 260}" )
	mygump.addRawLayout( "{gumppictiled 10 390 400 40 2624}" )
	mygump.addRawLayout( "{checkertrans 10 390 400 40}" )
	mygump.addRawLayout( "{button 250 410 4005 4007 1 0 0}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 285 410 240 20 1060675 0 0 32767}" )
	mygump.addRawLayout( "{gumppic 10 10 100}" )
	mygump.addRawLayout( "{text 62 43 0 0}" )
	mygump.addRawLayout( "{text 74 57 0 1}" )
	mygump.addRawLayout( "{button 10 390 4005 4007 1 0 31}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 390 240 20 1060676 0 0 32767}" )
	mygump.addRawLayout( "{button 10 410 4005 4007 1 0 46}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 410 240 20 1060677 0 0 32767}" )
	mygump.addRawLayout( "{button 150 10 4005 4007 1 0 2}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 10 200 20 1060668 0 0 32767}" )
	mygump.addRawLayout( "{button 150 30 4006 4007 1 0 17}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 30 200 20 1060669 0 0 16927}" )
	mygump.addRawLayout( "{button 150 50 4005 4007 1 0 32}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 50 200 20 1060670 0 0 32767}" )
	mygump.addRawLayout( "{button 150 70 4005 4007 1 0 47}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 70 200 20 1060671 0 0 32767}" )
	mygump.addRawLayout( "{button 150 90 4005 4007 1 0 62}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 90 200 20 1060672 0 0 32767}" ) #end of common part with gump0
	#mygump.addRawLayout( "{button 10 130 4005 4007 1 0 4}" ) # button see title next line
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 130 240 20 1011243 0 0 32767}" ) #View friend List
	
	offsetx = 0
	offsety= 0
	members = getFriends(item.multi)
	for memberserial in members:
		try :
			member = wolfpack.findchar(int(memberserial))
			#~ mygump.addButton( 15 +offsety, 150+offsetx, 0xFA5, 0xFA7, member.serial )
			mygump.addText( 15 +offsety, 150+offsetx, unicode(' *'), 1152)
			mygump.addText(49 +offsety, 150+offsetx, unicode(member.name), 1152)
			if offsetx == 192:
				offsetx = 0
				offsety += 200
			else:
				offsetx += 24			
		except:
			pass
	mygump.setCallback( callback )
	mygump.setArgs( [item] )
	#Add params
	for line in gump_params:
		mygump.addRawText( line )
	mygump.send( char )
示例#13
0
def gump0( char, callback, item ):
	gump_params = [
	"a house",
	"sign",
	"admin",
	"2003-05-22 17:57:40",
	"",
	"30500",
	"0"]

	mygump = cGump()
	mygump.addRawLayout( "{page 0}" )
	mygump.addRawLayout( "{resizepic 0 0 5054 420 440}" )
	mygump.addRawLayout( "{gumppictiled 10 10 400 100 2624}" )
	mygump.addRawLayout( "{checkertrans 10 10 400 100}" )
	mygump.addRawLayout( "{gumppictiled 10 120 400 260 2624}" )
	mygump.addRawLayout( "{checkertrans 10 120 400 260}" )
	mygump.addRawLayout( "{gumppictiled 10 390 400 40 2624}" )
	mygump.addRawLayout( "{checkertrans 10 390 400 40}" )
	mygump.addRawLayout( "{button 250 410 4005 4007 1 0 0}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 285 410 240 20 1060675 0 0 32767}" )
	mygump.addRawLayout( "{gumppic 10 10 100}" )
	mygump.addRawLayout( "{text 62 43 0 0}" )
	mygump.addRawLayout( "{text 74 57 0 1}" )
	mygump.addRawLayout( "{button 10 390 4005 4007 1 0 31}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 390 240 20 1060676 0 0 32767}" )
	mygump.addRawLayout( "{button 10 410 4005 4007 1 0 46}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 410 240 20 1060677 0 0 32767}" )
	mygump.addRawLayout( "{button 150 10 4006 4007 1 0 2}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 10 200 20 1060668 0 0 16927}" )
	mygump.addRawLayout( "{button 150 30 4005 4007 1 0 17}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 30 200 20 1060669 0 0 32767}" )
	mygump.addRawLayout( "{button 150 50 4005 4007 1 0 32}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 50 200 20 1060670 0 0 32767}" )
	mygump.addRawLayout( "{button 150 70 4005 4007 1 0 47}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 70 200 20 1060671 0 0 32767}" )
	mygump.addRawLayout( "{button 150 90 4005 4007 1 0 62}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 90 200 20 1060672 0 0 32767}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 20 130 200 20 1011242 0 0 32767}" )
	mygump.addRawLayout( "{text 210 130 1152 2}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 20 170 380 20 1018032 0 0 16927}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 20 190 380 20 1018035 0 0 16927}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 20 210 380 20 1060681 0 0 16927}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 20 230 380 20 1060679 0 0 16927}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 20 250 380 20 1062209 0 0 16927}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 20 290 200 20 1060692 0 0 16927}" )
	mygump.addRawLayout( "{text 250 290 1152 3}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 20 310 200 20 1060693 0 0 16927}" )
	mygump.addRawLayout( "{text 250 310 1152 4}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 20 330 200 20 1061793 0 0 16927}" )
	mygump.addRawLayout( "{text 250 330 1152 5}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 20 360 300 20 1011241 0 0 16927}" )
	mygump.addRawLayout( "{text 350 360 1152 6}" )
	mygump.setCallback( callback )
	mygump.setArgs( [item] )
	#Add params
	for line in gump_params:
		mygump.addRawText( line )
	mygump.send( char )
示例#14
0
def details(char, player):
	if not player.socket:
		char.socket.sysmessage('The player is currently offline.')
		return
	
	pos = player.pos
	account = player.account
	# Socket Information
	gump = cGump( 0, 0, 0, 50, 50 )
	gump.addBackground( 0xE10, 440, 340 )
	gump.addResizeGump( 195, 260, 0xBB8, 205, 20 )
	gump.addCheckerTrans( 15, 15, 410, 310 )
	gump.addGump( 160, 18, 0xFA2 )
	gump.addText( 195, 20, unicode( "Socket Menu" ), 0x530 )
	gump.addText( 70, 300, unicode("Close"), 0x834 )
	gump.addButton( 30, 300, 0xFB1, 0xFB3, 0 )
	gump.startPage( 1 )
	gump.addText( 50, 60, unicode( "Char name:" ), 0x834 )
	gump.addText( 250, 60, unicode( "%s" % player.name ), 0x834 )
	gump.addText( 50, 80, unicode( "IP:" ), 0x834 )
	gump.addText( 250, 80, unicode( "%s" % player.socket.address ), 0x834 )
	gump.addText( 50, 100, unicode( "Position:" ), 0x834 )
	gump.addText( 250, 100, unicode( "%i,%i,%i,%i" % ( pos.x, pos.y, pos.z, pos.map ) ), 0x834 )
	gump.addText( 50, 120, unicode( "Region:" ), 0x834 )
	if player.region:
		gump.addText( 250, 120, unicode( "%s" % unicode(player.region.name) ), 0x834 )
	else:
		gump.addText( 250, 120, "Unknown", 0x834 )
	gump.addText( 50, 140, unicode( "Account / ACL:" ), 0x834 )
	gump.addText( 250, 140, unicode( "%s / %s" % ( account.name, account.acl) ), 0x834 )
	# Actions
	# Go To Char
	gump.addButton( 20, 180, 0xFA5, 0xFA7, 1 )
	gump.addText( 50, 180, unicode( "Go to position" ), 0x834 )
	# Bring Char
	gump.addButton( 20, 200, 0xFA5, 0xFA7, 2 )
	gump.addText( 50, 200, unicode( "Bring char" ), 0x834 )
	# Jail Char
	gump.addButton( 20, 220, 0xFA5, 0xFA7, 3 )
	gump.addText( 50, 220, unicode( "Jail char" ), 0x834 )
	# Forgive Char
	gump.addButton( 220, 220, 0xFA5, 0xFA7, 4 )
	gump.addText( 250, 220, unicode( "Forgive char" ), 0x834 )
	# Show Char Info Gump
	gump.addButton( 220, 180, 0xFAB, 0xFAD, 5 )
	gump.addText( 250, 180, unicode( "Show char info gump" ), 0x834 )
	# Send Message
	gump.addButton( 20, 260, 0xFBD, 0xFBF, 6 )
	gump.addText( 50, 260, unicode( "Send message:" ), 0x834 )
	gump.addInputField( 200, 260, 190, 16, 0x834, 1, unicode( "<msg>" ) )
	# Disconnect
	gump.addButton( 220, 200, 0xFA5, 0xFA7, 7 )
	gump.addText( 250, 200, unicode( "Disconnect" ), 0x834 )
	# Stuff and Send
	gump.setCallback( "commands.who.callbackSocket" )
	gump.setArgs( [ player.serial ] )
	gump.send( char.socket )
示例#15
0
def gump3( char, callback, item ):
	gump_params = [
	str(item.multi.name),
	"sign"]

	mygump = cGump()
	mygump.addRawLayout( "{page 0}" )
	mygump.addRawLayout( "{resizepic 0 0 5054 420 440}" )
	mygump.addRawLayout( "{gumppictiled 10 10 400 100 2624}" )
	mygump.addRawLayout( "{checkertrans 10 10 400 100}" )
	mygump.addRawLayout( "{gumppictiled 10 120 400 260 2624}" )
	mygump.addRawLayout( "{checkertrans 10 120 400 260}" )
	mygump.addRawLayout( "{gumppictiled 10 390 400 40 2624}" )
	mygump.addRawLayout( "{checkertrans 10 390 400 40}" )
	mygump.addRawLayout( "{button 250 410 4005 4007 1 0 0}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 285 410 240 20 1060675 0 0 32767}" )
	mygump.addRawLayout( "{gumppic 10 10 100}" )
	mygump.addRawLayout( "{text 62 43 0 0}" )
	mygump.addRawLayout( "{text 74 57 0 1}" )
	mygump.addRawLayout( "{button 10 390 4005 4007 1 0 31}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 390 240 20 1060676 0 0 32767}" )
	mygump.addRawLayout( "{button 10 410 4005 4007 1 0 46}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 410 240 20 1060677 0 0 32767}" )
	mygump.addRawLayout( "{button 150 10 4005 4007 1 0 2}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 10 200 20 1060668 0 0 32767}" )
	mygump.addRawLayout( "{button 150 30 4005 4007 1 0 17}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 30 200 20 1060669 0 0 32767}" )
	mygump.addRawLayout( "{button 150 50 4005 4007 1 0 32}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 50 200 20 1060670 0 0 32767}" )
	mygump.addRawLayout( "{button 150 70 4006 4007 1 0 47}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 70 200 20 1060671 0 0 16927}" )
	mygump.addRawLayout( "{button 150 90 4005 4007 1 0 62}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 90 200 20 1060672 0 0 32767}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 120 240 20 1060759 0 0 16912}" )
	# Customize this House - Just to Custom Houses (Checked by wich script sign has)
	if item.hasscript( 'signpost' ):
		mygump.addRawLayout( "{button 10 160 4005 4007 1 0 21}" )
		mygump.addRawLayout( "{xmfhtmlgumpcolor 45 160 240 20 1060765 0 0 32767}" )
	else:
		mygump.addRawLayout( "{xmfhtmlgumpcolor 45 160 240 20 1060765 0 0 16912}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 180 240 20 1060760 0 0 16912}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 210 240 20 1060761 0 0 16912}" )
	mygump.addRawLayout( "{button 10 230 4005 4007 1 0 66}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 230 240 20 1060762 0 0 32767}" )
	mygump.addRawLayout( "{button 10 250 4005 4007 1 0 81}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 250 240 20 1060763 0 0 32767}" )
	mygump.addRawLayout( "{button 10 280 4005 4007 1 0 96}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 280 240 20 1062004 0 0 32767}" )
	mygump.addRawLayout( "{button 10 310 4005 4007 1 0 111}" ) #rename house
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 310 240 20 1060764 0 0 32767}" )
	mygump.setCallback( callback )
	mygump.setArgs( [item] )
	#Add params
	for line in gump_params:
		mygump.addRawText( line )

	mygump.send( char )
示例#16
0
def gump12(char, callback, item):
    # security view friends list
    gump_params = ["a house", "sign"]

    mygump = cGump()
    mygump.addRawLayout("{page 0}")
    mygump.addRawLayout("{resizepic 0 0 5054 420 440}")
    mygump.addRawLayout("{gumppictiled 10 10 400 100 2624}")
    mygump.addRawLayout("{checkertrans 10 10 400 100}")
    mygump.addRawLayout("{gumppictiled 10 120 400 260 2624}")
    mygump.addRawLayout("{checkertrans 10 120 400 260}")
    mygump.addRawLayout("{gumppictiled 10 390 400 40 2624}")
    mygump.addRawLayout("{checkertrans 10 390 400 40}")
    mygump.addRawLayout("{button 250 410 4005 4007 1 0 0}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 285 410 240 20 1060675 0 0 32767}")
    mygump.addRawLayout("{gumppic 10 10 100}")
    mygump.addRawLayout("{text 62 43 0 0}")
    mygump.addRawLayout("{text 74 57 0 1}")
    mygump.addRawLayout("{button 10 390 4005 4007 1 0 31}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 45 390 240 20 1060676 0 0 32767}")
    mygump.addRawLayout("{button 10 410 4005 4007 1 0 46}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 45 410 240 20 1060677 0 0 32767}")
    mygump.addRawLayout("{button 150 10 4005 4007 1 0 2}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 195 10 200 20 1060668 0 0 32767}")
    mygump.addRawLayout("{button 150 30 4006 4007 1 0 17}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 195 30 200 20 1060669 0 0 16927}")
    mygump.addRawLayout("{button 150 50 4005 4007 1 0 32}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 195 50 200 20 1060670 0 0 32767}")
    mygump.addRawLayout("{button 150 70 4005 4007 1 0 47}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 195 70 200 20 1060671 0 0 32767}")
    mygump.addRawLayout("{button 150 90 4005 4007 1 0 62}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 195 90 200 20 1060672 0 0 32767}")  # end of common part with gump0
    # mygump.addRawLayout( "{button 10 130 4005 4007 1 0 4}" ) # button see title next line
    mygump.addRawLayout("{xmfhtmlgumpcolor 45 130 240 20 1011243 0 0 32767}")  # View friend List

    offsetx = 0
    offsety = 0
    members = getFriends(item.multi)
    for memberserial in members:
        try:
            member = wolfpack.findchar(int(memberserial))
            # ~ mygump.addButton( 15 +offsety, 150+offsetx, 0xFA5, 0xFA7, member.serial )
            mygump.addText(15 + offsety, 150 + offsetx, unicode(" *"), 1152)
            mygump.addText(49 + offsety, 150 + offsetx, unicode(member.name), 1152)
            if offsetx == 192:
                offsetx = 0
                offsety += 200
            else:
                offsetx += 24
        except:
            pass
    mygump.setCallback(callback)
    mygump.setArgs([item])
    # Add params
    for line in gump_params:
        mygump.addRawText(line)
    mygump.send(char)
示例#17
0
def gump( listener, speaker ):
	gump = cGump( 0, 0, 0, 50, 50 )
	gump.addBackground( 0x24a4, 425, 400 )
	gump.startPage( 0 )
	gump.addHtmlGump( 10, 30, 450, 20, '<basefont size="7" color="#336699"><center>Barber shop</center></basefont>' )
	gump.addTilePic( 155, 31, 0xDFD )

	gump.addPageButton( 40, 61, 0x4B9, 0x4BA, 0x11 )
	gump.addHtmlGump( 60, 60, 100, 20, '<basefont color="#333333"><u>Hair</u></basefont>' )

	gump.addPageButton( 40, 81, 0x4B9, 0x4BA, 0x31 )
	gump.addHtmlGump( 60, 80, 100, 20, u'<basefont color="#333333"><u>Hair dye</u></basefont>' )

	# Page Switches (only for men)
	if speaker.id == 0x190:
		gump.addPageButton( 190, 61, 0x4B9, 0x4BA, 0x21 )
		gump.addHtmlGump( 210, 60, 100, 20, '<basefont color="#333333"><u>Beard</u></basefont>' )

	# Hair
	addHairfarbePage( speaker, gump, 0x31, 0x0E27 ) # hair dye

	# Hair
	addHairPage( speaker, gump, 0x11, 0x203B ) # Short Hair
	addHairPage( speaker, gump, 0x12, 0x203C ) # Long Hair
	addHairPage( speaker, gump, 0x13, 0x203D ) # Ponytail
	addHairPage( speaker, gump, 0x14, 0x2044 ) # Mohawk
	addHairPage( speaker, gump, 0x15, 0x2045 ) # Pageboy
	addHairPage( speaker, gump, 0x16, 0x2046 ) # Buns hair
	addHairPage( speaker, gump, 0x17, 0x2047 ) # Afro
	addHairPage( speaker, gump, 0x18, 0x2048 ) # Receding hair
	addHairPage( speaker, gump, 0x19, 0x2049 ) # 2 pig-tails
	addHairPage( speaker, gump, 0x1A, 0x204a ) # Krisna Hair
	addHairPage( speaker, gump, 0x1B, 0x0000 ) # None

	if speaker.id == 0x190:
		# Beard
		gump.startPage( 0x21 )

		# BEARDS
		addBeardPage( speaker, gump, 0x21, 0x203E ) # Long Beard
		addBeardPage( speaker, gump, 0x22, 0x203F ) # Short Beard
		addBeardPage( speaker, gump, 0x23, 0x2040 ) # Goatee
		addBeardPage( speaker, gump, 0x24, 0x2041 ) # Mustache
		addBeardPage( speaker, gump, 0x25, 0x204B ) # Med Short Beard
		addBeardPage( speaker, gump, 0x26, 0x204C ) # Med Long Beard
		addBeardPage( speaker, gump, 0x27, 0x204D ) # Vandyke
		addBeardPage( speaker, gump, 0x28, 0x0000 ) # None

	gump.startPage( 0 )
	gump.addButton( 350, 335, 2119, 2120, 0 ) # Cancel

	gump.setCallback( "speech.barber.gump_callback" )
	gump.setArgs( [ listener.serial ] )
	gump.send( speaker )

	return 1
示例#18
0
文件: npcs.py 项目: thooge/Wolfpack
def npcquestmenu(npc, player, questamount):
    if player.socket:
        player.socket.closegump(TYPE_QUEST_GUMP)

    dialog = cGump(x=100, y=30, type=TYPE_QUEST_GUMP)

    dialog.addResizeGump(37, 14, 9260, 445, 422)
    dialog.addTiledGump(81, 35, 358, 386, 5124, 0)
    dialog.addTiledGump(55, 32, 30, 391, 10460, 0)
    dialog.addTiledGump(439, 32, 30, 391, 10460, 0)
    dialog.addGump(-12, 290, 10402, 0)
    dialog.addGump(53, 137, 10411, 0)
    dialog.addGump(95, 39, 9005, 0)
    dialog.addTiledGump(40, 421, 440, 17, 10100, 0)
    dialog.addTiledGump(39, 15, 440, 17, 10100, 0)
    dialog.addGump(4, 16, 10421, 0)
    dialog.addGump(21, 4, 10420, 0)
    dialog.addGump(449, 162, 10411, 0)
    dialog.addGump(449, 323, 10412, 0)
    dialog.addGump(394, 52, 1417, 0)
    dialog.addGump(449, 3, 10410, 0)
    dialog.addGump(402, 61, 9012, 0)
    dialog.addText(135, 49, "Quest List", 1149)
    if npc.region:
        dialog.addText(136, 79, npc.name + ", from: " + npc.region.name, 1149)
    else:
        dialog.addText(136, 79, npc.name, 1149)
    dialog.addTiledGump(139, 69, 161, 2, 2432, 0)
    dialog.addButton(338, 394, 12012, 12013, 0)

    # Temporary storage
    tempy = 142

    # Loop for Quests
    quests = returnquestlist(npc)

    for i in range(0, questamount):

        id = str(quests[i])

        if checkquestrequirements(player, id):

            if not checkifquestcompleted(player, id):
                dialog.addText(106, int(tempy), givequestname(id), 1149)
                dialog.addButton(391, int(tempy), 9904, 9905, i + 1)
            else:
                dialog.addText(106, int(tempy), givequestname(id), 908)
                dialog.addGump(391, int(tempy), 9903, 0)

            tempy += 21

    dialog.setArgs([quests, npc])
    dialog.setCallback(questlistresponse)

    dialog.send(player)
示例#19
0
def onUse(player, item):
	if player.gm:
		if not item.hastag( 'target' ):
			item.settag( 'target', "0,0,0,0" )

		if item.hastag( 'target' ):
			target = item.gettag('target').split(',')

			pos = player.pos
			x = target[0]
			y = target[1]
			z = target[2]
			map = target[3]

		# create gump
		gump = cGump( 0, 0, 0, 50, 50 )
		# Header
		gump.addBackground( 0x24a4, 300, 280 )
		gump.addHtmlGump( 10, 30, 300, 20, tr('<basefont size="7" color="#336699"><center>Set target for teleportaion</center></basefont>') )
		# Input Fields
		gump.addHtmlGump( 40, 60, 300, 20, 'x-Pos:' )
		gump.addResizeGump( 90, 60, 0x2486, 156, 26 )
		gump.addInputField( 93, 63, 150, 20, 0x539, 1, x )

		gump.addHtmlGump( 40, 80, 300, 20, 'y-Pos:' )
		gump.addResizeGump( 90, 80, 0x2486, 156, 26 )
		gump.addInputField( 93, 83, 150, 20, 0x539, 2, y )

		gump.addHtmlGump( 40, 100, 300, 20, 'z-Pos:' )
		gump.addResizeGump( 90, 100, 0x2486, 156, 26 )
		gump.addInputField( 93, 103, 150, 20, 0x539, 3, z )

		gump.addHtmlGump( 40, 120, 300, 20, 'Map:' )
		gump.addResizeGump( 90, 120, 0x2486, 156, 26 )
		gump.addInputField( 93, 123, 150, 20, 0x539, 4, map )

		playersonly = item.hastag('playersonly')
		gump.addCheckbox(40, 160, 0xd2, 0xd3, 1, playersonly )
		gump.addHtmlGump( 70, 160, 300, 20, 'Players only' )
		
		silent = item.hastag('silent')
		gump.addCheckbox(40, 190, 0xd2, 0xd3, 2, silent )
		gump.addHtmlGump( 70, 190, 300, 20, 'Silent' )


		gump.addButton( 83, 225, 2128, 2129, 1000 ) # Ok
		gump.addButton( 150, 225, 2119, 2120, 0 ) # Cancel

		gump.setCallback( gate_callback )
		gump.setArgs( [ item ] )
		gump.send( player )
		return True

	else:
		return True
示例#20
0
def npcquestmenu(npc, player, questamount):
	if player.socket:
		player.socket.closegump( TYPE_QUEST_GUMP )

	dialog = cGump( x=100, y=30, type=TYPE_QUEST_GUMP )

	dialog.addResizeGump(37, 14, 9260, 445, 422)
	dialog.addTiledGump(81, 35, 358, 386, 5124, 0)
	dialog.addTiledGump(55, 32, 30, 391, 10460, 0)
	dialog.addTiledGump(439, 32, 30, 391, 10460, 0)
	dialog.addGump(-12, 290, 10402, 0)
	dialog.addGump(53, 137, 10411, 0)
	dialog.addGump(95, 39, 9005, 0)
	dialog.addTiledGump(40, 421, 440, 17, 10100, 0)
	dialog.addTiledGump(39, 15, 440, 17, 10100, 0)
	dialog.addGump(4, 16, 10421, 0)
	dialog.addGump(21, 4, 10420, 0)
	dialog.addGump(449, 162, 10411, 0)
	dialog.addGump(449, 323, 10412, 0)
	dialog.addGump(394, 52, 1417, 0)
	dialog.addGump(449, 3, 10410, 0)
	dialog.addGump(402, 61, 9012, 0)
	dialog.addText(135, 49, "Quest List", 1149)
	if npc.region:
		dialog.addText(136, 79, npc.name + ", from: " + npc.region.name, 1149)
	else:
		dialog.addText(136, 79, npc.name, 1149)
	dialog.addTiledGump(139, 69, 161, 2, 2432, 0)
	dialog.addButton(338, 394, 12012, 12013, 0)

	# Temporary storage
	tempy = 142

	# Loop for Quests
	quests = returnquestlist(npc)

	for i in range( 0, questamount ):

		id = str( quests[i] )

		if checkquestrequirements(player, id):

			if not checkifquestcompleted(player, id):
				dialog.addText(106, int(tempy), givequestname( id ), 1149)
				dialog.addButton(391, int(tempy), 9904, 9905, i + 1)
			else:
				dialog.addText(106, int(tempy), givequestname( id ), 908)
				dialog.addGump(391, int(tempy), 9903, 0)

			tempy += 21

	dialog.setArgs( [quests, npc] )
	dialog.setCallback( questlistresponse )

	dialog.send( player )
示例#21
0
def gump3(char, callback, item):
    gump_params = [str(item.multi.name), "sign"]

    mygump = cGump()
    mygump.addRawLayout("{page 0}")
    mygump.addRawLayout("{resizepic 0 0 5054 420 440}")
    mygump.addRawLayout("{gumppictiled 10 10 400 100 2624}")
    mygump.addRawLayout("{checkertrans 10 10 400 100}")
    mygump.addRawLayout("{gumppictiled 10 120 400 260 2624}")
    mygump.addRawLayout("{checkertrans 10 120 400 260}")
    mygump.addRawLayout("{gumppictiled 10 390 400 40 2624}")
    mygump.addRawLayout("{checkertrans 10 390 400 40}")
    mygump.addRawLayout("{button 250 410 4005 4007 1 0 0}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 285 410 240 20 1060675 0 0 32767}")
    mygump.addRawLayout("{gumppic 10 10 100}")
    mygump.addRawLayout("{text 62 43 0 0}")
    mygump.addRawLayout("{text 74 57 0 1}")
    mygump.addRawLayout("{button 10 390 4005 4007 1 0 31}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 45 390 240 20 1060676 0 0 32767}")
    mygump.addRawLayout("{button 10 410 4005 4007 1 0 46}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 45 410 240 20 1060677 0 0 32767}")
    mygump.addRawLayout("{button 150 10 4005 4007 1 0 2}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 195 10 200 20 1060668 0 0 32767}")
    mygump.addRawLayout("{button 150 30 4005 4007 1 0 17}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 195 30 200 20 1060669 0 0 32767}")
    mygump.addRawLayout("{button 150 50 4005 4007 1 0 32}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 195 50 200 20 1060670 0 0 32767}")
    mygump.addRawLayout("{button 150 70 4006 4007 1 0 47}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 195 70 200 20 1060671 0 0 16927}")
    mygump.addRawLayout("{button 150 90 4005 4007 1 0 62}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 195 90 200 20 1060672 0 0 32767}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 45 120 240 20 1060759 0 0 16912}")
    # Customize this House - Just to Custom Houses (Checked by wich script sign has)
    if item.hasscript("signpost"):
        mygump.addRawLayout("{button 10 160 4005 4007 1 0 21}")
        mygump.addRawLayout("{xmfhtmlgumpcolor 45 160 240 20 1060765 0 0 32767}")
    else:
        mygump.addRawLayout("{xmfhtmlgumpcolor 45 160 240 20 1060765 0 0 16912}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 45 180 240 20 1060760 0 0 16912}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 45 210 240 20 1060761 0 0 16912}")
    mygump.addRawLayout("{button 10 230 4005 4007 1 0 66}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 45 230 240 20 1060762 0 0 32767}")
    mygump.addRawLayout("{button 10 250 4005 4007 1 0 81}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 45 250 240 20 1060763 0 0 32767}")
    mygump.addRawLayout("{button 10 280 4005 4007 1 0 96}")
    mygump.addRawLayout("{xmfhtmlgumpcolor 45 280 240 20 1062004 0 0 32767}")
    mygump.addRawLayout("{button 10 310 4005 4007 1 0 111}")  # rename house
    mygump.addRawLayout("{xmfhtmlgumpcolor 45 310 240 20 1060764 0 0 32767}")
    mygump.setCallback(callback)
    mygump.setArgs([item])
    # Add params
    for line in gump_params:
        mygump.addRawText(line)

    mygump.send(char)
示例#22
0
def callback(char, args, target):
    socket = char.socket

    # Upper left Corner
    if len(args) == 0:
        if target.item and target.item.container:
            socket.sysmessage("This is an invalid target.")
            return

        socket.sysmessage("Target the lower right corner of the area you want to export.")
        socket.attachtarget("commands.export.callback", [target.pos.x, target.pos.y])

        # Lower Right Corner
    elif len(args) == 2:
        if target.item and target.item.container:
            socket.sysmessage("This is an invalid target.")
            return

            # Create a gump to enter the output filename
        x1 = min(args[0], target.pos.x)
        x2 = max(args[0], target.pos.x)
        y1 = min(args[1], target.pos.y)
        y2 = max(args[1], target.pos.y)

        gump = cGump(x=100, y=100, callback="commands.export.export", args=[x1, y1, x2, y2])

        gump.addBackground(id=0x2436, width=350, height=300)
        # gump.addCheckerTrans( 15, 15, 320, 270 )

        text = (
            '<basefont color="#FEFEFE"><h3>Export</h3><br><basefont color="#FEFEFE"><u>X1</u>,<u>Y1</u>: %u,%u<br><u>X2</u>,<u>Y2</u>: %u,%u<br><br>Enter the filename for your exported items below. Use the radio buttons to choose the export format.'
            % (x1, y1, x2, y2)
        )
        gump.addHtmlGump(x=20, y=20, width=310, height=200, html=text)

        # Radiobuttons
        gump.startGroup(0)
        gump.addRadioButton(x=20, y=160, off=0x25F8, on=0x25FB, id=1)
        gump.addText(x=55, y=165, text="Sphere 51a", hue=0x835)

        gump.addRadioButton(x=150, y=160, off=0x25F8, on=0x25FB, id=2, selected=1)
        gump.addText(x=185, y=165, text="WSC", hue=0x835)

        gump.addRadioButton(x=250, y=160, off=0x25F8, on=0x25FB, id=3)
        gump.addText(x=285, y=165, text="Text", hue=0x835)

        # InputField
        gump.addResizeGump(x=20, y=210, id=0xBB8, width=310, height=25)
        gump.addInputField(x=25, y=212, width=295, height=20, hue=0x834, id=1, starttext="export.wsc")

        gump.addText(x=265, y=250, text="Export", hue=0x835)
        gump.addButton(x=310, y=250, up=0x26AF, down=0x26B1, returncode=1)

        gump.send(char)
示例#23
0
def gump3( char, callback, item ):
	gump_params = [
	"a house",
	"sign"]

	mygump = cGump()
	mygump.addRawLayout( "{page 0}" )
	mygump.addRawLayout( "{resizepic 0 0 5054 420 440}" )
	mygump.addRawLayout( "{gumppictiled 10 10 400 100 2624}" )
	mygump.addRawLayout( "{checkertrans 10 10 400 100}" )
	mygump.addRawLayout( "{gumppictiled 10 120 400 260 2624}" )
	mygump.addRawLayout( "{checkertrans 10 120 400 260}" )
	mygump.addRawLayout( "{gumppictiled 10 390 400 40 2624}" )
	mygump.addRawLayout( "{checkertrans 10 390 400 40}" )
	mygump.addRawLayout( "{button 250 410 4005 4007 1 0 0}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 285 410 240 20 1060675 0 0 32767}" )
	mygump.addRawLayout( "{gumppic 10 10 100}" )
	mygump.addRawLayout( "{text 62 43 0 0}" )
	mygump.addRawLayout( "{text 74 57 0 1}" )
	mygump.addRawLayout( "{button 10 390 4005 4007 1 0 31}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 390 240 20 1060676 0 0 32767}" )
	mygump.addRawLayout( "{button 10 410 4005 4007 1 0 46}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 410 240 20 1060677 0 0 32767}" )
	mygump.addRawLayout( "{button 150 10 4005 4007 1 0 2}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 10 200 20 1060668 0 0 32767}" )
	mygump.addRawLayout( "{button 150 30 4005 4007 1 0 17}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 30 200 20 1060669 0 0 32767}" )
	mygump.addRawLayout( "{button 150 50 4005 4007 1 0 32}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 50 200 20 1060670 0 0 32767}" )
	mygump.addRawLayout( "{button 150 70 4006 4007 1 0 47}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 70 200 20 1060671 0 0 16927}" )
	mygump.addRawLayout( "{button 150 90 4005 4007 1 0 62}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 90 200 20 1060672 0 0 32767}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 120 240 20 1060759 0 0 16912}" )
	mygump.addRawLayout( "{button 10 160 4005 4007 1 0 21}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 160 240 20 1060765 0 0 32767}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 180 240 20 1060760 0 0 16912}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 210 240 20 1060761 0 0 16912}" )
	mygump.addRawLayout( "{button 10 230 4005 4007 1 0 66}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 230 240 20 1060762 0 0 32767}" )
	mygump.addRawLayout( "{button 10 250 4005 4007 1 0 81}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 250 240 20 1060763 0 0 32767}" )
	mygump.addRawLayout( "{button 10 280 4005 4007 1 0 96}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 280 240 20 1062004 0 0 32767}" )
	mygump.addRawLayout( "{button 10 310 4005 4007 1 0 111}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 310 240 20 1060764 0 0 32767}" )
	mygump.setCallback( callback )
	mygump.setArgs( [item] )
	#Add params
	for line in gump_params:
		mygump.addRawText( line )

	mygump.send( char )
示例#24
0
def selectBaseRace( char ):
	mysock = char.socket
	if char.hastag( 'race' ):
		if char.gettag( 'race' ) == 'Human':
			mysock.sysmessage("You're already Human!")
			return False
		elif char.gettag( 'race' ) == 'Elven':
			mysock.sysmessage("You're already Elven!")
			return False
		elif char.gettag( 'race' ) == 'Undead':
			mysock.sysmessage("You're already Undead!")
			return False
		elif char.gettag( 'race' ) == 'Drow':
			mysock.sysmessage("You're already Drow!")
			return False
	else:
		mysock.sysmessage("You need to select your race!")
		# Race Gump
		gump = cGump( x=40, y=40, noclose=1, callback=evolution )
		# Default Background
		gump.startPage( 0 )
		gump.startPage( 1 )
		gump.addResizeGump( 0, 0, 0x2436, 300, 285 ) # Background
		text = '<basefont color="#FFFF00"><center><h3>Race Slection</h3></center><p><basefont color="#FEFEFE">%s, Welcome to Rayonnant.<br>To continue your journey select a race.<br><br>Race Information:' % (char.name)
		gump.addHtmlGump( 20, 20, 260, 145, text )
		gump.addText( 55, 150, 'Human Information', 0x835 )
		gump.addPageButton( 180, 150, 0x26af, 0x26b1, 2 )
		gump.addText( 55, 180, 'Elf Information', 0x835 )
		gump.addPageButton( 180, 180, 0x26af, 0x26b1, 3 )
		gump.startGroup( 0 )
		# Human Button
		gump.addRadioButton( 20, 235, 0x25f8, 0x25fb, selected=1, id=1 )
		gump.addText( 55, 240, 'Human', 0x835 )
		# Elf Button
		gump.addRadioButton( 110, 235, 0x25f8, 0x25fb, id=2 )
		gump.addText( 145, 240, 'Elf', 0x835 )
		# Evolve!
		gump.addButton( 220, 240, 0xf9, 0xf8, returncode=1 ) # Okay Button
		# Human Information Page
		gump.startPage( 2 )
		gump.addResizeGump( 0, 0, 0x2436, 380, 445 ) # Background
		text = '<basefont color="#FFFF00"><center><h3>Basic Human Information</h3></center><p><basefont color="#FEFEFE">Humans are.... Blah blah blah blah blah....'
		gump.addHtmlGump( 20, 20, 340, 405, text )
		gump.addPageButton( 300, 405, 0xf9, 0xf8, 1 ) # Okay Button
		# Elf Information Page
		gump.startPage( 3 )
		gump.addResizeGump( 0, 0, 0x2436, 380, 445 ) # Background
		text = '<basefont color="#FFFF00"><center><h3>Basic Elf Information</h3></center><p><basefont color="#FEFEFE">Elves are.... Blah blah blah blah blah....'
		gump.addHtmlGump( 20, 20, 340, 405, text )
		gump.addPageButton( 300, 405, 0xf9, 0xf8, 1 ) # Okay Button
		# Send Gump!
		gump.send( char )
		return
示例#25
0
def cmdWho( socket, command, argstring ):
	wholist = []
	worldsocketcount = wolfpack.sockets.count()
	worldsocket = wolfpack.sockets.first()
	while worldsocket:
		wholist += [ worldsocket.player.serial ]
		worldsocket = wolfpack.sockets.next()

	if len(wholist) == 0:
		return False

	gump = cGump( 0, 0, 0, 50, 50 )
	gump.addBackground( 0xE10, 380, 360 )
	gump.addCheckerTrans( 15, 15, 350, 330 );
	gump.addGump( 130, 18, 0xFA8 )
	gump.addText( 165, 20, unicode("Who Menu"), 0x530 )
	# Close Button
	gump.addButton( 30, 320, 0xFB1, 0xFB3, 0 )
	gump.addText( 70, 320, unicode("Close"), 0x834 )
	# Start The First Page
	# Notes, 10 per page
	# Pages to create, (( socketcount / 10) + 1 )
	# Player list increases by 22 pixels
	maxpages = ((worldsocketcount / 10) + 1)
	page = 0
	serialcount = 0
	while page <= maxpages:
		page += 1
		gump.startPage( page )
		gump.addText( 280, 320, unicode( "Page %i of %i" % ( page, maxpages ) ), 0x834 )
		if page < maxpages:
			gump.addPageButton( 260, 320, 0x0FA, 0x0FA, page + 1 )
		if page > 1:
			gump.addPageButton( 240, 320, 0x0FC, 0x0FC, page - 1 )
		upby = 22
		for serial in wholist:
			if not serial:
				break
			player = wolfpack.findchar( serial )
			# serialcount + 10 for callback, we will -10 there and look at wholist.
			gump.addButton( 20, 40 + upby, 0xFA5, 0xFA7, ( serialcount + 10 ) )
			gump.addText( 50, 40 + upby, unicode( "%s [%s]" % ( player.name, player.account.name ) ), 0x834 )
			gump.addText( 240, 40 + upby, unicode( "%s" % player.socket.address ), 0x834 )
			upby += 22
			serialcount += 1
			if serialcount == ((page * 10) - 1):
				break

	gump.setArgs( [ wholist ] )
	gump.setCallback( "commands.who.callbackWho" )
	gump.send( socket )
	return
示例#26
0
文件: npcs.py 项目: thooge/Wolfpack
def npcreportlist(npc, player):
    if player.socket:
        player.socket.closegump(TYPE_QUEST_GUMP)
    dialog = cGump(x=100, y=30, type=TYPE_QUEST_GUMP)

    dialog.addResizeGump(37, 14, 9260, 445, 422)
    dialog.addTiledGump(81, 35, 358, 386, 5124, 0)
    dialog.addTiledGump(55, 32, 30, 391, 10460, 0)
    dialog.addTiledGump(439, 32, 30, 391, 10460, 0)
    dialog.addGump(-12, 290, 10402, 0)
    dialog.addGump(53, 137, 10411, 0)
    dialog.addGump(95, 39, 9005, 0)
    dialog.addTiledGump(40, 421, 440, 17, 10100, 0)
    dialog.addTiledGump(39, 15, 440, 17, 10100, 0)
    dialog.addGump(4, 16, 10421, 0)
    dialog.addGump(21, 4, 10420, 0)
    dialog.addGump(449, 162, 10411, 0)
    dialog.addGump(449, 323, 10412, 0)
    dialog.addGump(394, 52, 1417, 0)
    dialog.addGump(449, 3, 10410, 0)
    dialog.addGump(402, 61, 9012, 0)
    dialog.addText(135, 49, "Quest Report", 1149)
    if npc.region:
        dialog.addText(136, 79, npc.name + ", from: " + npc.region.name, 1149)
    else:
        dialog.addText(136, 79, npc.name, 1149)
    dialog.addTiledGump(139, 69, 161, 2, 2432, 0)
    dialog.addButton(338, 394, 12012, 12013, 0)

    # Temporary storage
    tempy = 142

    # Loop for Quests
    for i in range(1, 11):

        if player.hastag('Quest.' + str(i) + '.NPCDest'):

            serialdest = player.gettag('Quest.' + str(i) + '.NPCDest')

            if str(npc.serial) == str(serialdest):

                id = player.gettag('Quest.' + str(i) + '.ID')

                dialog.addButton(391, int(tempy), 9904, 9905, i)
                dialog.addText(106, int(tempy), givequestname(id), 1149)

        tempy += 21

    dialog.setArgs([npc])
    dialog.setCallback(npcreportresponse)

    dialog.send(player)
示例#27
0
def npcreportlist(npc, player):
	if player.socket:
		player.socket.closegump( TYPE_QUEST_GUMP )
	dialog = cGump( x=100, y=30, type=TYPE_QUEST_GUMP )

	dialog.addResizeGump(37, 14, 9260, 445, 422)
	dialog.addTiledGump(81, 35, 358, 386, 5124, 0)
	dialog.addTiledGump(55, 32, 30, 391, 10460, 0)
	dialog.addTiledGump(439, 32, 30, 391, 10460, 0)
	dialog.addGump(-12, 290, 10402, 0)
	dialog.addGump(53, 137, 10411, 0)
	dialog.addGump(95, 39, 9005, 0)
	dialog.addTiledGump(40, 421, 440, 17, 10100, 0)
	dialog.addTiledGump(39, 15, 440, 17, 10100, 0)
	dialog.addGump(4, 16, 10421, 0)
	dialog.addGump(21, 4, 10420, 0)
	dialog.addGump(449, 162, 10411, 0)
	dialog.addGump(449, 323, 10412, 0)
	dialog.addGump(394, 52, 1417, 0)
	dialog.addGump(449, 3, 10410, 0)
	dialog.addGump(402, 61, 9012, 0)
	dialog.addText(135, 49, "Quest Report", 1149)
	if npc.region:
		dialog.addText(136, 79, npc.name + ", from: " + npc.region.name, 1149)
	else:
		dialog.addText(136, 79, npc.name, 1149)
	dialog.addTiledGump(139, 69, 161, 2, 2432, 0)
	dialog.addButton(338, 394, 12012, 12013, 0)

	# Temporary storage
	tempy = 142

	# Loop for Quests
	for i in range(1, 11):

		if player.hastag('Quest.'+ str(i) +'.NPCDest'):

			serialdest = player.gettag('Quest.'+ str(i) +'.NPCDest')

			if str(npc.serial) == str(serialdest):

				id = player.gettag('Quest.'+ str(i) +'.ID')
	
				dialog.addButton(391, int(tempy), 9904, 9905, i)
				dialog.addText(106, int(tempy), givequestname( id ), 1149)

		tempy += 21

	dialog.setArgs( [npc] )
	dialog.setCallback( npcreportresponse )

	dialog.send( player )
示例#28
0
def gump2( char, callback, item ):
	gump_params = [
	"a house",
	"sign",
	"0",
	"425",
	"212"]

	mygump = cGump()
	mygump.addRawLayout( "{page 0}" )
	mygump.addRawLayout( "{resizepic 0 0 5054 420 440}" )
	mygump.addRawLayout( "{gumppictiled 10 10 400 100 2624}" )
	mygump.addRawLayout( "{checkertrans 10 10 400 100}" )
	mygump.addRawLayout( "{gumppictiled 10 120 400 260 2624}" )
	mygump.addRawLayout( "{checkertrans 10 120 400 260}" )
	mygump.addRawLayout( "{gumppictiled 10 390 400 40 2624}" )
	mygump.addRawLayout( "{checkertrans 10 390 400 40}" )
	mygump.addRawLayout( "{button 250 410 4005 4007 1 0 0}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 285 410 240 20 1060675 0 0 32767}" )
	mygump.addRawLayout( "{gumppic 10 10 100}" )
	mygump.addRawLayout( "{text 62 43 0 0}" )
	mygump.addRawLayout( "{text 74 57 0 1}" )
	mygump.addRawLayout( "{button 10 390 4005 4007 1 0 31}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 390 240 20 1060676 0 0 32767}" )
	mygump.addRawLayout( "{button 10 410 4005 4007 1 0 46}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 410 240 20 1060677 0 0 32767}" )
	mygump.addRawLayout( "{button 150 10 4005 4007 1 0 2}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 10 200 20 1060668 0 0 32767}" )
	mygump.addRawLayout( "{button 150 30 4005 4007 1 0 17}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 30 200 20 1060669 0 0 32767}" )
	mygump.addRawLayout( "{button 150 50 4006 4007 1 0 32}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 50 200 20 1060670 0 0 16927}" )
	mygump.addRawLayout( "{button 150 70 4005 4007 1 0 47}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 70 200 20 1060671 0 0 32767}" )
	mygump.addRawLayout( "{button 150 90 4005 4007 1 0 62}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 90 200 20 1060672 0 0 32767}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 10 130 400 20 1060682 0 0 32767}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 10 170 275 20 1011237 0 0 32767}" )
	mygump.addRawLayout( "{text 310 170 1152 2}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 10 190 275 20 1011238 0 0 32767}" )
	mygump.addRawLayout( "{text 310 190 1152 3}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 10 210 275 20 1011239 0 0 32767}" )
	mygump.addRawLayout( "{text 310 210 1152 2}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 10 230 275 20 1011240 0 0 32767}" )
	mygump.addRawLayout( "{text 310 230 1152 4}" )
	mygump.setCallback( callback )
	mygump.setArgs( [item] )
	#Add params
	for line in gump_params:
		mygump.addRawText( line )
	mygump.send( char )
示例#29
0
def gump2( char, callback, item ):
	gump_params = [
	"a house",
	"sign",
	"0",
	"425",
	"212"]

	mygump = cGump()
	mygump.addRawLayout( "{page 0}" )
	mygump.addRawLayout( "{resizepic 0 0 5054 420 440}" )
	mygump.addRawLayout( "{gumppictiled 10 10 400 100 2624}" )
	mygump.addRawLayout( "{checkertrans 10 10 400 100}" )
	mygump.addRawLayout( "{gumppictiled 10 120 400 260 2624}" )
	mygump.addRawLayout( "{checkertrans 10 120 400 260}" )
	mygump.addRawLayout( "{gumppictiled 10 390 400 40 2624}" )
	mygump.addRawLayout( "{checkertrans 10 390 400 40}" )
	mygump.addRawLayout( "{button 250 410 4005 4007 1 0 0}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 285 410 240 20 1060675 0 0 32767}" )
	mygump.addRawLayout( "{gumppic 10 10 100}" )
	mygump.addRawLayout( "{text 62 43 0 0}" )
	mygump.addRawLayout( "{text 74 57 0 1}" )
	mygump.addRawLayout( "{button 10 390 4005 4007 1 0 31}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 390 240 20 1060676 0 0 32767}" )
	mygump.addRawLayout( "{button 10 410 4005 4007 1 0 46}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 410 240 20 1060677 0 0 32767}" )
	mygump.addRawLayout( "{button 150 10 4005 4007 1 0 2}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 10 200 20 1060668 0 0 32767}" )
	mygump.addRawLayout( "{button 150 30 4005 4007 1 0 17}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 30 200 20 1060669 0 0 32767}" )
	mygump.addRawLayout( "{button 150 50 4006 4007 1 0 32}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 50 200 20 1060670 0 0 16927}" )
	mygump.addRawLayout( "{button 150 70 4005 4007 1 0 47}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 70 200 20 1060671 0 0 32767}" )
	mygump.addRawLayout( "{button 150 90 4005 4007 1 0 62}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 90 200 20 1060672 0 0 32767}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 10 130 400 20 1060682 0 0 32767}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 10 170 275 20 1011237 0 0 32767}" )
	mygump.addRawLayout( "{text 310 170 1152 2}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 10 190 275 20 1011238 0 0 32767}" )
	mygump.addRawLayout( "{text 310 190 1152 3}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 10 210 275 20 1011239 0 0 32767}" )
	mygump.addRawLayout( "{text 310 210 1152 2}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 10 230 275 20 1011240 0 0 32767}" )
	mygump.addRawLayout( "{text 310 230 1152 4}" )
	mygump.setCallback( callback )
	mygump.setArgs( [item] )
	#Add params
	for line in gump_params:
		mygump.addRawText( line )
	mygump.send( char )
示例#30
0
def export(char, args, choice):
    if choice.button != 1 or len(args) != 4:
        return False

    filename = choice.text[1]

    if len(filename) == 0:
        char.socket.sysmessage("Error: You need to provide a valid filename.")
        return False

    # Open the output file
    output = open(
        filename, "wb"
    )  # Note that we *force* the output to have lines terminated with \n\r

    if os.name == 'posix':
        newline = "\n"
    else:
        newline = "\r\n"
    warnings = ''

    i = 0

    # There is no iterator for static items, so we have to check each coord
    for x in range(args[0], args[2] + 1):
        for y in range(args[1], args[3] + 1):
            # Check for static items
            statics = wolfpack.statics(x, y, char.pos.map, True)
            for item in statics:
                output.write(
                    "0x%x %i %i %i 0x%x%s" %
                    (item[0], item[1], item[2], item[3], item[4], newline))
                i = i + 1

    output.close()

    # Show a Report gump
    gump = cGump(x=100, y=100)

    gump.addBackground(id=0x2436, width=350, height=300)

    text = '<basefont color="#FEFEFE"><h3>Export</h3><br><basefont color="#FEFEFE">%d items have been exported to "%s".<br><br><basefont color="#ff0000"><u>Warnings:</u><br><basefont color="#FEFEFE">%s' % (
        i, filename, warnings)
    gump.addHtmlGump(x=20, y=20, width=310, height=200, html=text, canScroll=1)

    gump.addText(x=265, y=250, text='Close', hue=0x835)
    gump.addButton(x=310, y=250, up=0x26af, down=0x26b1, returncode=0)

    gump.send(char)
    return True
示例#31
0
def showTitheGump(player, ankh, amount = 0):
	if not ankh or not player.canreach(ankh, 2):
		return
	
	dialog = cGump(x=100, y=100)
	
	# Count Gold in Backpack
	backpack = player.getbackpack()
	gold = backpack.countitems(['eed'])
	
	# Normalize the amount of gold to tithe
	amount = max(0, min(gold, amount))
	
	# Gump Header
	dialog.startPage(0)
	dialog.addGump(30, 30, 102)
	dialog.addXmfHtmlGump(95, 100, 120, 100, 1060198, False, False)
	
	# Remaining Gold
	dialog.addText(57, 274, tr("Gold:"))
	dialog.addText(87, 274, str(gold - amount), 53)

	# Current Offering
	dialog.addText(137, 274, tr("Tithe:"))
	dialog.addText(172, 274, str(amount), 53)

	# Decrease Offering
	dialog.addButton(105, 230, 5220, 5220, 2)
	dialog.addButton(113, 230, 5222, 5222, 2)
	dialog.addText(108, 228, "<")
	dialog.addText(112, 228, "<")
	
	dialog.addButton(127, 230, 5223, 5223, 1)
	dialog.addText(131, 228, "<")

	# Increase Offering
	dialog.addButton(147, 230, 5224, 5224, 3)
	dialog.addText(153, 228, ">")

	dialog.addButton(168, 230, 5220, 5220, 4)
	dialog.addButton(176, 230, 5222, 5222, 4)
	dialog.addText(172, 228, ">")
	dialog.addText(176, 228, ">")

	dialog.addButton(217, 272, 4023, 4024, 5) # Make Offering

	dialog.setArgs([amount, ankh.serial])
	dialog.setCallback(titheGoldCallback)
	dialog.send(player)
示例#32
0
def callback(char, args, target):
    socket = char.socket

    # Upper left Corner
    if len(args) == 0:
        if target.item and target.item.container:
            socket.sysmessage("This is an invalid target.")
            return

        socket.sysmessage(
            "Target the lower right corner of the area you want to export.")
        socket.attachtarget("commands.exportstatics.callback",
                            [target.pos.x, target.pos.y])

    # Lower Right Corner
    elif len(args) == 2:
        if target.item and target.item.container:
            socket.sysmessage("This is an invalid target.")
            return

        # Create a gump to enter the output filename
        x1 = min(args[0], target.pos.x)
        x2 = max(args[0], target.pos.x)
        y1 = min(args[1], target.pos.y)
        y2 = max(args[1], target.pos.y)

        gump = cGump(x=100, y=100, callback=export, args=[x1, y1, x2, y2])

        gump.addBackground(id=0x2436, width=350, height=300)

        text = '<basefont color="#FEFEFE"><h3>Export</h3><br><basefont color="#FEFEFE"><u>X1</u>,<u>Y1</u>: %u,%u<br><u>X2</u>,<u>Y2</u>: %u,%u' % (
            x1, y1, x2, y2)
        gump.addHtmlGump(x=20, y=20, width=310, height=200, html=text)

        # InputField
        gump.addResizeGump(x=20, y=210, id=0xBB8, width=310, height=25)
        gump.addInputField(x=25,
                           y=212,
                           width=295,
                           height=20,
                           hue=0x834,
                           id=1,
                           starttext="export.txt")

        gump.addText(x=265, y=250, text='Export', hue=0x835)
        gump.addButton(x=310, y=250, up=0x26af, down=0x26b1, returncode=1)

        gump.send(char)
示例#33
0
def openquestplayer(player):
	if player.socket:
		player.socket.closegump( TYPE_QUEST_GUMP )

	dialog = cGump( x=100, y=30, type=TYPE_QUEST_GUMP )

	dialog.addResizeGump(37, 14, 9260, 445, 422)
	dialog.addTiledGump(81, 35, 358, 386, 5124, 0)
	dialog.addTiledGump(55, 32, 30, 391, 10460, 0)
	dialog.addTiledGump(439, 32, 30, 391, 10460, 0)
	dialog.addGump(-12, 290, 10402, 0)
	dialog.addGump(53, 137, 10411, 0)
	dialog.addGump(95, 39, 9005, 0)
	dialog.addTiledGump(40, 421, 440, 17, 10100, 0)
	dialog.addTiledGump(39, 15, 440, 17, 10100, 0)
	dialog.addGump(4, 16, 10421, 0)
	dialog.addGump(21, 4, 10420, 0)
	dialog.addGump(449, 162, 10411, 0)
	dialog.addGump(449, 323, 10412, 0)
	dialog.addGump(394, 52, 1417, 0)
	dialog.addGump(449, 3, 10410, 0)
	dialog.addGump(402, 61, 9012, 0)
	dialog.addText(135, 49, "Quest Log", 1149)
	dialog.addTiledGump(139, 69, 161, 2, 2432, 0)
	dialog.addButton(338, 394, 12012, 12013, 0)

	# Temporary Y
	tempy = 142
	
	# Loop for Quests
	for i in range(1, 11):

		# Player has this tag?
		if player.hastag('Quest.'+ str(i) +'.ID'):
			
			questid = player.gettag('Quest.'+ str(i) +'.ID')

			# The Dialog
			dialog.addButton(391, tempy, 9904, 9905, i)
			dialog.addText(106, tempy, givequestname( questid ), 1149)

			# Increase y
			tempy += 21

	dialog.setArgs( [] )
	dialog.setCallback( questplayerresponse )

	dialog.send( player.socket )
示例#34
0
def tracking( char, skill ):
	socket = char.socket

	if skill != TRACKING or not char.socket:
		return False

	if char.socket.hastag( 'skill_delay' ):
		if wolfpack.time.currenttime() < socket.gettag( 'skill_delay' ):
			socket.clilocmessage( 500118, "", 0x3b2, 3 )
			return True
		else:
			socket.deltag( 'skill_delay' )

	socket.clilocmessage( 1011350 ) # What do you wish to track?
	socket.closegump( 0x87651592 ) # What to track
	gump = cGump( x=20, y=30, callback="skills.tracking.trackWhatResponse", type=0x87651592 )

	gump.startPage( 0 )
	gump.addBackground( 5054, 440, 135 )
	gump.addResizeGump( 10, 10, 2620, 420, 75 )
	gump.addResizeGump( 10, 85, 3000, 420, 25 )

	gump.addTilePic( 20, 20, 9682 )
	gump.addButton( 20, 110, 4005, 4007, 1 )
	gump.addXmfHtmlGump( 20, 90, 100, 20, 1018087 ) # Animals

	gump.addTilePic( 120, 20, 9607 )
	gump.addButton( 120, 110, 4005, 4007, 2 )
	gump.addXmfHtmlGump( 120, 90, 100, 20, 1018088 ) # Monsters

	gump.addTilePic( 220, 20, 8454 )
	gump.addButton( 220, 110, 4005, 4007, 3 )
	gump.addXmfHtmlGump( 220, 90, 100, 20, 1018089 ) # Human NPCs

	gump.addTilePic( 320, 20, 8455 )
	gump.addButton( 320, 110, 4005, 4007, 4 )
	gump.addXmfHtmlGump( 320, 90, 100, 20, 1018090 ) # Players

	gump.send( char )

	socket.settag( 'skill_delay', int( wolfpack.time.currenttime() + STEALTH_DELAY ) )

	if skills.skilltable[ TRACKING ][ skills.UNHIDE ] and char.hidden:
		char.removefromview()
		char.hidden = False
		char.update()

	return True
示例#35
0
def openquestplayer(player):
    if player.socket:
        player.socket.closegump(TYPE_QUEST_GUMP)

    dialog = cGump(x=100, y=30, type=TYPE_QUEST_GUMP)

    dialog.addResizeGump(37, 14, 9260, 445, 422)
    dialog.addTiledGump(81, 35, 358, 386, 5124, 0)
    dialog.addTiledGump(55, 32, 30, 391, 10460, 0)
    dialog.addTiledGump(439, 32, 30, 391, 10460, 0)
    dialog.addGump(-12, 290, 10402, 0)
    dialog.addGump(53, 137, 10411, 0)
    dialog.addGump(95, 39, 9005, 0)
    dialog.addTiledGump(40, 421, 440, 17, 10100, 0)
    dialog.addTiledGump(39, 15, 440, 17, 10100, 0)
    dialog.addGump(4, 16, 10421, 0)
    dialog.addGump(21, 4, 10420, 0)
    dialog.addGump(449, 162, 10411, 0)
    dialog.addGump(449, 323, 10412, 0)
    dialog.addGump(394, 52, 1417, 0)
    dialog.addGump(449, 3, 10410, 0)
    dialog.addGump(402, 61, 9012, 0)
    dialog.addText(135, 49, "Quest Log", 1149)
    dialog.addTiledGump(139, 69, 161, 2, 2432, 0)
    dialog.addButton(338, 394, 12012, 12013, 0)

    # Temporary Y
    tempy = 142

    # Loop for Quests
    for i in range(1, 11):

        # Player has this tag?
        if player.hastag('Quest.' + str(i) + '.ID'):

            questid = player.gettag('Quest.' + str(i) + '.ID')

            # The Dialog
            dialog.addButton(391, tempy, 9904, 9905, i)
            dialog.addText(106, tempy, givequestname(questid), 1149)

            # Increase y
            tempy += 21

    dialog.setArgs([])
    dialog.setCallback(questplayerresponse)

    dialog.send(player.socket)
示例#36
0
def TrackWhoGump(char, liste, startpoint, ran):

	socket = char.socket

	socket.closegump( 0x87651592 ) # TrackWhatGump/TrackWhoGump
	gump = cGump( x=20, y=30, callback=trackWhoResponse, type=0x87651592 )

	gump.startPage( 0 )
	gump.addBackground( 5054, 440, 135 )
	gump.addResizeGump( 10, 10, 2620, 420, 75 )
	gump.addResizeGump( 10, 85, 3000, 420, 25 )


	pages = ceil(len(liste) / 4)
	
	for page in range(1, pages + 1):
		gump.startPage(page)
		
		if page > 1:
			gump.addPageButton(5, 115, 5223, 5223, page - 1)
		
		if page < pages:
			gump.addPageButton(415, 115, 5224, 5224, page + 1)
		
		xoffset = 0
		for i in range(0, 4):
			if (page - 1) * 4 + i >= len(liste):
				break
			
			npc = liste[(page - 1) * 4 + i]
			
			bodyinfo = wolfpack.bodyinfo(npc.id)
			showid = bodyinfo['figurine']	
			
			gump.addTilePic( 20 + xoffset, 20, showid )
			gump.addButton( 25 + xoffset, 110, 4005, 4007, npc.serial )
			gump.addText(24 + xoffset, 90, npc.name, 0)
			
			xoffset += 100

	gump.setArgs( [liste, ran] )

	gump.send( char )

	if skills.skilltable[ TRACKING ][ skills.UNHIDE ] and char.hidden:
		char.reveal()
	return True
示例#37
0
def openchoicequestmenu(char, player):
	if player.socket:
		player.socket.closegump( TYPE_QUEST_CHOICE )

	dialog = cGump( x=100, y=100, type=TYPE_QUEST_CHOICE )

	dialog.addResizeGump(7, 6, 9400, 253, 122)
	dialog.addText(81, 17, "Quest System", 1149)
	dialog.addButton(30, 55, 1209, 1210, 1)
	dialog.addButton(30, 90, 1209, 1210, 2)
	dialog.addText(56, 50, "List Quests", 1149)
	dialog.addText(56, 85, "Report Completed Quest", 1149)

	dialog.setArgs( [char] )
	dialog.setCallback( questchoiceresponse )

	dialog.send( player )
示例#38
0
def TrackWhoGump(char, liste, startpoint, ran):

    socket = char.socket

    socket.closegump(0x87651592)  # TrackWhatGump/TrackWhoGump
    gump = cGump(x=20, y=30, callback=trackWhoResponse, type=0x87651592)

    gump.startPage(0)
    gump.addBackground(5054, 440, 135)
    gump.addResizeGump(10, 10, 2620, 420, 75)
    gump.addResizeGump(10, 85, 3000, 420, 25)

    pages = ceil(len(liste) / 4)

    for page in range(1, pages + 1):
        gump.startPage(page)

        if page > 1:
            gump.addPageButton(5, 115, 5223, 5223, page - 1)

        if page < pages:
            gump.addPageButton(415, 115, 5224, 5224, page + 1)

        xoffset = 0
        for i in range(0, 4):
            if (page - 1) * 4 + i >= len(liste):
                break

            npc = liste[(page - 1) * 4 + i]

            bodyinfo = wolfpack.bodyinfo(npc.id)
            showid = bodyinfo['figurine']

            gump.addTilePic(20 + xoffset, 20, showid)
            gump.addButton(25 + xoffset, 110, 4005, 4007, npc.serial)
            gump.addText(24 + xoffset, 90, npc.name, 0)

            xoffset += 100

    gump.setArgs([liste, ran])

    gump.send(char)

    if skills.skilltable[TRACKING][skills.UNHIDE] and char.hidden:
        char.reveal()
    return True
示例#39
0
def gump4( char, callback, item ):
	gump_params = [
	"a house",
	"sign"]
	mygump = cGump()

	mygump.addRawLayout( "{page 0}" )
	mygump.addRawLayout( "{resizepic 0 0 5054 420 440}" )
	mygump.addRawLayout( "{gumppictiled 10 10 400 100 2624}" )
	mygump.addRawLayout( "{checkertrans 10 10 400 100}" )
	mygump.addRawLayout( "{gumppictiled 10 120 400 260 2624}" )
	mygump.addRawLayout( "{checkertrans 10 120 400 260}" )
	mygump.addRawLayout( "{gumppictiled 10 390 400 40 2624}" )
	mygump.addRawLayout( "{checkertrans 10 390 400 40}" )
	mygump.addRawLayout( "{button 250 410 4005 4007 1 0 0}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 285 410 240 20 1060675 0 0 32767}" )
	mygump.addRawLayout( "{gumppic 10 10 100}" )
	mygump.addRawLayout( "{text 62 43 0 0}" )
	mygump.addRawLayout( "{text 74 57 0 1}" )
	mygump.addRawLayout( "{button 10 390 4005 4007 1 0 31}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 390 240 20 1060676 0 0 32767}" )
	mygump.addRawLayout( "{button 10 410 4005 4007 1 0 46}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 410 240 20 1060677 0 0 32767}" )
	mygump.addRawLayout( "{button 150 10 4005 4007 1 0 2}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 10 200 20 1060668 0 0 32767}" )
	mygump.addRawLayout( "{button 150 30 4005 4007 1 0 17}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 30 200 20 1060669 0 0 32767}" )
	mygump.addRawLayout( "{button 150 50 4005 4007 1 0 32}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 50 200 20 1060670 0 0 32767}" )
	mygump.addRawLayout( "{button 150 70 4005 4007 1 0 47}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 70 200 20 1060671 0 0 32767}" )
	mygump.addRawLayout( "{button 150 90 4006 4007 1 0 62}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 195 90 200 20 1060672 0 0 16927}" )
	if checkAccess(char, item.multi, ACCESS_OWNER):
		mygump.addRawLayout( "{button 10 130 4005 4007 1 0 7}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 130 240 20 1061794 0 0 32767}" )
	if checkAccess(char, item.multi, ACCESS_OWNER):
		mygump.addRawLayout( "{button 10 150 4005 4007 1 0 22}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 150 240 20 1061797 0 0 32767}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 190 240 20 1061798 0 0 16912}" )
	mygump.setCallback( callback )
	mygump.setArgs( [item] )
	#Add params
	for line in gump_params:
		mygump.addRawText( line )
	mygump.send( char )
示例#40
0
def sureGump( char, item, callback ):

	okGump = cGump( 1, 1, 0 )
	okGump.startPage( 1 )
	okGump.addGump( LeftGumpX, TopGumpY, 2070 )
	okGump.addText( LeftGumpX+GumpLength/4, TopGumpY+GumpHeight/3, "Are you sure ?", 12 )
	# cancel button
	okGump.addButton( LeftGumpX+GumpLength/5.4, TopGumpY+GumpHeight/1.5, 0x817, 0x818, 1 )
	# ok button
	okGump.addButton( LeftGumpX+GumpLength/1.8, TopGumpY+GumpHeight/1.5 , 0x81A, 0x81B, 2 )
	# set callback function and its arguments
	okGump.setCallback( callback )
	# send it
	okGump.setArgs( [ char, item ] )
	okGump.send( char )

	return 1
示例#41
0
def sureGump( char, item, callback ):

	okGump = cGump( 1, 1, 0 )
	okGump.startPage( 1 )
	okGump.addGump( LeftGumpX, TopGumpY, 2070 )
	okGump.addText( LeftGumpX+GumpLength/4, TopGumpY+GumpHeight/3, "Are you sure ?", 12 )
	# cancel button
	okGump.addButton( LeftGumpX+GumpLength/5.4, TopGumpY+GumpHeight/1.5, 0x817, 0x818, 1 )
	# ok button
	okGump.addButton( LeftGumpX+GumpLength/1.8, TopGumpY+GumpHeight/1.5 , 0x81A, 0x81B, 2 )
	# set callback function and its arguments
	okGump.setCallback( callback )
	# send it
	okGump.setArgs( [ char, item ] )
	okGump.send( char )

	return 1
def onSpeech(listener, speaker, text, keywords):
    if not char.socket:
        return 0

        # Check if our name is in the beginning of the string
    if not text.lower().startswith("vendor") or not text.lower().startswith(listener.name.lower()):
        return 0

    speaker.char.socket.sysmessage("May I help thee?")
    gump = cGump(0, 0, 0, 50, 50)
    gump.addBackground(0x24A4, 425, 400)

    gump.startPage(0)
    gump.addHtmlGump(
        10, 30, 450, 20, '<basefont size="7" color="#336699"><center>Stablemaster shop</center></basefont>'
    )
    gump.addTilePic(140, 31, 0xFB6)

    addStablePage(speaker, gump, 0x1, 0x2101)
    addStablePage(speaker, gump, 0x2, 0x2103)
    addStablePage(speaker, gump, 0x3, 0x20F6)
    addStablePage(speaker, gump, 0x4, 0x20E6)
    addStablePage(speaker, gump, 0x5, 0x211B)
    addStablePage(speaker, gump, 0x6, 0x211C)
    addStablePage(speaker, gump, 0x7, 0x211F)
    addStablePage(speaker, gump, 0x8, 0x2120)
    addStablePage(speaker, gump, 0x9, 0x2121)
    addStablePage(speaker, gump, 0xA, 0x2124)
    addStablePage(speaker, gump, 0xB, 0x2126)
    addStablePage(speaker, gump, 0xC, 0x2127)
    addStablePage(speaker, gump, 0xD, 0x20EB)

    gump.startPage(0)

    gump.addRadioButton(158, 252, 0xD2, 0xD3, 0x0000, 1)  # shrink
    gump.addHtmlGump(183, 252, 150, 20, '<basefont color="#333333">Shrinked: + %s gold</basefont>' % prices_shrinks)
    gump.addRadioButton(158, 272, 0xD2, 0xD3, 0x0001)  # tamed
    gump.addHtmlGump(183, 272, 150, 20, '<basefont color="#333333">Tamed</basefont>')
    gump.addRadioButton(158, 292, 0xD2, 0xD3, 0x0002)  # rideable
    gump.addHtmlGump(183, 292, 150, 20, '<basefont color="#333333">Rideable</basefont>')

    gump.setCallback("speech.stablemaster.gump_callback")
    gump.setArgs([listener.serial])
    gump.send(speaker)

    return 1
示例#43
0
    def details(self, player, arguments):
        if self.parent.gumptype != 0:
            player.socket.closegump(self.parent.gumptype, 0xFFFF)

        gump = cGump()
        gump.setType(self.parent.gumptype)
        gump.setArgs(["%s:%u" % (self.parent.id, self.parent.subactions.index(self))] + arguments)
        gump.setCallback("system.makemenus.MakeActionResponse")

        gump.addResizeGump(0, 0, 5054, 530, 417)
        gump.addTiledGump(10, 10, 510, 22, 2624)
        gump.addTiledGump(165, 37, 355, 88, 2624)
        gump.addTiledGump(165, 130, 355, 80, 2624)
        gump.addTiledGump(165, 215, 355, 80, 2624)
        gump.addTiledGump(165, 300, 355, 80, 2624)
        gump.addTiledGump(10, 37, 150, 88, 2624)
        gump.addTiledGump(10, 130, 150, 22, 2624)
        gump.addTiledGump(10, 215, 150, 22, 2624)
        gump.addTiledGump(10, 300, 150, 22, 2624)
        gump.addCheckerTrans(10, 10, 510, 397)

        gump.addHtmlGump(10, 12, 510, 20, centerhtml % self.title)
        if self.itemid != 0:
            gump.addTilePic(15, 42, self.itemid)
        gump.addHtmlGump(10, 132, 150, 20, centerhtml % "SKILLS")
        gump.addHtmlGump(10, 217, 150, 20, centerhtml % "MATERIALS")
        gump.addHtmlGump(10, 302, 150, 20, centerhtml % "OTHER")
        gump.addHtmlGump(170, 39, 70, 20, whitehtml % "ITEM")
        gump.addButton(15, 387, 0xFAE, 0xFB0, 0)  # Back to the parent menu of this node
        gump.addText(50, 389, "Back", 0x480)
        gump.addButton(375, 387, 4005, 4007, 1)  # Make the item
        gump.addText(410, 389, "Make Now", 0x480)

        # Item Name
        gump.addText(245, 39, self.title, 0x480)

        # Scrollable Skill List
        gump.addHtmlGump(170, 132, 345, 76, whitehtml % self.skillshtml, 0, self.skillshtml.count("<br>") > 4)

        # Scrollable Material List
        gump.addHtmlGump(170, 217, 345, 76, whitehtml % self.materialshtml, 0, self.materialshtml.count("<br>") > 4)

        # Description
        gump.addHtmlGump(170, 302, 345, 76, whitehtml % self.otherhtml, 0, 1)

        gump.send(player)
示例#44
0
文件: npcs.py 项目: thooge/Wolfpack
def openchoicequestmenu(char, player):
    if player.socket:
        player.socket.closegump(TYPE_QUEST_CHOICE)

    dialog = cGump(x=100, y=100, type=TYPE_QUEST_CHOICE)

    dialog.addResizeGump(7, 6, 9400, 253, 122)
    dialog.addText(81, 17, "Quest System", 1149)
    dialog.addButton(30, 55, 1209, 1210, 1)
    dialog.addButton(30, 90, 1209, 1210, 2)
    dialog.addText(56, 50, "List Quests", 1149)
    dialog.addText(56, 85, "Report Completed Quest", 1149)

    dialog.setArgs([char])
    dialog.setCallback(questchoiceresponse)

    dialog.send(player)
示例#45
0
def gump0( char, callback ):
	mygump = cGump()
	mygump.addRawLayout( "{page 0}" )
	mygump.addRawLayout( "{resizepic 0 0 5054 270 145}" )
	mygump.addRawLayout( "{gumppictiled 10 10 250 125 2624}" )
	mygump.addRawLayout( "{checkertrans 10 10 250 125}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 10 10 250 20 1060239 0 0 32767}" )
	mygump.addRawLayout( "{button 10 110 4017 4019 1 0 0}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 110 150 20 3000363 0 0 32767}" )
	mygump.addRawLayout( "{button 10 40 4005 4007 1 0 1}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 40 200 20 1060390 0 0 32767}" )
	mygump.addRawLayout( "{button 10 60 4005 4007 1 0 2}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 60 200 20 1060391 0 0 32767}" )
	mygump.addRawLayout( "{button 10 80 4005 4007 1 0 3}" )
	mygump.addRawLayout( "{xmfhtmlgumpcolor 45 80 200 20 1060392 0 0 32767}" )
	mygump.setCallback( callback )
	mygump.send( char )
示例#46
0
    def generate(self, arguments):
        gump = cGump()
        gump.callback = "system.makemenus.MakeMenuResponse"
        gump.setArgs([self.id] + arguments)
        gump.setType(self.gumptype)
        gump.startPage(0)
        gump.addBackground(0x13BE, 530, 388)
        gump.addTiledGump(10, 10, 510, 22, 0xA40)
        gump.addTiledGump(10, 37, 200, 250, 0xA40)
        gump.addTiledGump(215, 37, 305, 250, 0xA40)
        gump.addCheckerTrans(10, 10, 510, 368)

        gump.addHtmlGump(10, 12, 510, 20, centerhtml % self.title)
        gump.addHtmlGump(10, 39, 200, 20, centerhtml % "CATEGORIES")
        gump.addHtmlGump(215, 39, 305, 20, centerhtml % "SELECTIONS")

        return gump
def onSpeech( listener, speaker, text, keywords ):
	if not speaker.socket:
		return False

	# Check if our name is in the beginning of the string
	if not text.lower().startswith( "vendor" ) and not text.lower().startswith( listener.name.lower() ):
		return False

	listener.say("May I help thee?")
	gump = cGump( 0, 0, 0, 50, 50 )
	gump.addBackground( 0x24a4, 425, 400 )

	gump.startPage( 0 )
	gump.addHtmlGump( 10, 30, 450, 20, '<basefont size="7" color="#336699"><center>Stablemaster shop</center></basefont>' )
	gump.addTilePic( 140, 31, 0xFB6 )

	addStablePage( speaker, gump, 0x1, 0x2101 )
	addStablePage( speaker, gump, 0x2, 0x2103 )
	addStablePage( speaker, gump, 0x3, 0x20f6 )
	addStablePage( speaker, gump, 0x4, 0x20e6 )
	addStablePage( speaker, gump, 0x5, 0x211b )
	addStablePage( speaker, gump, 0x6, 0x211c )
	addStablePage( speaker, gump, 0x7, 0x211f )
	addStablePage( speaker, gump, 0x8, 0x2120 )
	addStablePage( speaker, gump, 0x9, 0x2121 )
	addStablePage( speaker, gump, 0xa, 0x2124 )
	addStablePage( speaker, gump, 0xb, 0x2126 )
	addStablePage( speaker, gump, 0xc, 0x2127 )
	addStablePage( speaker, gump, 0xd, 0x20eb )

	gump.startPage( 0 )

	gump.addRadioButton(158, 252, 0xd2, 0xd3, 0x0000, 1) #shrink
	gump.addHtmlGump( 183, 252, 150, 20, '<basefont color="#333333">Shrinked: + %s gold</basefont>' % prices_shrinks )
	gump.addRadioButton(158, 272, 0xd2, 0xd3, 0x0001 ) #tamed
	gump.addHtmlGump( 183, 272, 150, 20, '<basefont color="#333333">Tamed</basefont>' )
	gump.addRadioButton(158, 292, 0xd2, 0xd3, 0x0002 ) #rideable
	gump.addHtmlGump( 183, 292, 150, 20, '<basefont color="#333333">Rideable</basefont>' )


	gump.setCallback( gump_callback )
	gump.setArgs( [ listener.serial ] )
	gump.send( speaker )

	return True
示例#48
0
def onSpeech( listener, speaker, text, keywords ):
	if not speaker.socket:
		return False

	# Check if our name is in the beginning of the string
	if not text.lower().startswith( "vendor" ) and not text.lower().startswith( listener.name.lower() ):
		return False

	listener.say(tr("May I help thee?"))
	gump = cGump( 0, 0, 0, 50, 50 )
	gump.addBackground( 0x24a4, 425, 400 )

	gump.startPage( 0 )
	gump.addHtmlGump( 10, 30, 450, 20, tr('<basefont size="7" color="#336699"><center>Stablemaster shop</center></basefont>') )
	gump.addTilePic( 140, 31, 0xFB6 )

	addStablePage( speaker, gump, 0x1, 0x2101 )
	addStablePage( speaker, gump, 0x2, 0x2103 )
	addStablePage( speaker, gump, 0x3, 0x20f6 )
	addStablePage( speaker, gump, 0x4, 0x20e6 )
	addStablePage( speaker, gump, 0x5, 0x211b )
	addStablePage( speaker, gump, 0x6, 0x211c )
	addStablePage( speaker, gump, 0x7, 0x211f )
	addStablePage( speaker, gump, 0x8, 0x2120 )
	addStablePage( speaker, gump, 0x9, 0x2121 )
	addStablePage( speaker, gump, 0xa, 0x2124 )
	addStablePage( speaker, gump, 0xb, 0x2126 )
	addStablePage( speaker, gump, 0xc, 0x2127 )
	addStablePage( speaker, gump, 0xd, 0x20eb )

	gump.startPage( 0 )

	gump.addRadioButton(158, 252, 0xd2, 0xd3, 0x0000, 1) #shrink
	gump.addHtmlGump( 183, 252, 150, 20, '<basefont color="#333333">Shrinked: + %s gold</basefont>' % prices_shrinks )
	gump.addRadioButton(158, 272, 0xd2, 0xd3, 0x0001 ) #tamed
	gump.addHtmlGump( 183, 272, 150, 20, '<basefont color="#333333">Tamed</basefont>' )
	gump.addRadioButton(158, 292, 0xd2, 0xd3, 0x0002 ) #rideable
	gump.addHtmlGump( 183, 292, 150, 20, '<basefont color="#333333">Rideable</basefont>' )


	gump.setCallback( gump_callback )
	gump.setArgs( [ listener.serial ] )
	gump.send( speaker )

	return True
示例#49
0
def ConfirmReleaseGump(char, pet):
	dialog = cGump( 0, 0, 0, 0, 40 )
	dialog.setCallback(response)
	dialog.startPage(0)

	dialog.addBackground(5054, 270, 120)
	dialog.addResizeGump(10, 10, 3000,250, 100)

	dialog.addXmfHtmlGump(20, 15, 230, 60, 1046257, 1, 1 ) # Are you sure you want to release your pet?

	dialog.addButton( 20, 80, 4005, 4007, 1 )
	dialog.addXmfHtmlGump(55, 80, 75, 20, 1011011, 0,0 ) # CONTINUE

	dialog.addButton(135, 80, 4005, 4007, 0)
	dialog.addXmfHtmlGump(170, 80, 75, 20, 1011012, 0,0 ) # CANCEL

	dialog.setArgs([pet.serial])
	dialog.send(char.socket)
示例#50
0
def hairdye( char, item ):
	if item.container != char.getbackpack():
		char.message( 1042001 ) # That must be in your pack for you to use it.
		return 1

	gump = cGump( x=50, y=50, callback=hairdye_callback )

	# First Page (visible everywhere)
	gump.startPage( 0 )

	gump.addBackground( 0xa28, 350, 355 )
	gump.addResizeGump( 10, 44, 0x13EC, 110, 270 )

	gump.addXmfHtmlGump( 0, 16, 350, 35, 0xF6D45 ) # Gump Title (Hair Color Selection...)

	# Ok Button
	gump.addButton( 50, 318, 0xFA5, 0xFA7, 1 )
	gump.addXmfHtmlGump( 95, 319, 250, 35, 0xF6D46 )

	# Add Hairdye Groups (visible on every page)
	i = 0

	for dye_group in hairdye_groups:
		gump.addPageButton( 87, 50 + ( i * 22 ), 0x1468, 0x1468, i + 1 )
		gump.addText( 20, 49 + ( i * 22 ), '*****', dye_group[0] )
		i += 1

	i = 0

	for dye_group in hairdye_groups:
		gump.startPage( i + 1 )

		for j in range( 0, dye_group[1] ):
			gump.addText( 178 + ( floor( j / 16 ) * 80 ), 42 + ( ( j % 16 ) * 17 ), '*****', dye_group[0] + j )
			gump.addRadioButton( 156 + ( floor( j / 16 ) * 80 ), 42 + ( ( j % 16 ) * 17 ), 0xD2, 0xD3, dye_group[0] + j )

		i += 1

	gump.setArgs( [ item.serial ] )

	gump.send( char )

	return 1
def callback(char, args, target):
    socket = char.socket

    # Upper left Corner
    if len(args) == 0:
        if target.item and target.item.container:
            socket.sysmessage("This is an invalid target.")
            return

        socket.sysmessage(
            "Target the lower right corner of the area you want to wipe.")
        socket.attachtarget("shardscripts.commands.safe_wipe.callback",
                            [target.pos.x, target.pos.y])

    # Lower Right Corner
    elif len(args) == 2:
        if target.item and target.item.container:
            socket.sysmessage("This is an invalid target.")
            return

        # Create a gump to confirm the wipe.
        x1 = min(args[0], target.pos.x)
        x2 = max(args[0], target.pos.x)
        y1 = min(args[1], target.pos.y)
        y2 = max(args[1], target.pos.y)

        gump = cGump(0, 0, 0, 100, 100)
        gump.addBackground(id=0x2436, width=350, height=165)
        text = '<basefont color="#00FF00"><h3>Wipe Selected Area</h3><br><basefont color="#FEFEFE"><u>X1</u>, <u>Y1</u>: %u, %u<br><u>X2</u>, <u>Y2</u>: %u, %u<br><br>Please confirm the wipe of the selected area.' % (
            x1, y1, x2, y2)
        gump.addHtmlGump(x=20, y=20, width=310, height=150, html=text)
        # Confirm Button
        gump.startGroup(0)
        gump.addRadioButton(x=20, y=115, off=0x25f8, on=0x25fb, id=1)
        gump.addText(x=55, y=120, text='Confirm', hue=0x835)
        # Wipe Button
        gump.addText(x=240, y=120, text='Wipe Area', hue=0x835)
        gump.addButton(x=310, y=120, up=0x26af, down=0x26b1, returncode=1)
        gump.setCallback("shardscripts.commands.safe_wipe.wipe")
        gump.setArgs([x1, y1, x2, y2])
        gump.send(char)
        return True
示例#52
0
def virtueDisplay( socket, command, arguments ):
	char = socket.player
	# Race Gump
	gump = cGump( x=10, y=50, callback=virtueInfo )
	gump.addBackground( id=0x53, width=180, height=240 )
	#text = '<basefont color="#FFFF00"><h3>Race Selection</h3><br><basefont color="#FEFEFE">%s, Welcome to Rayonnant.<br> To continue you must select a race.' % ( char.name )
	#gump.addHtmlGump( x=20, y=20, width=310, height=150, html=text )
	gump.addText( x=20, y=15, text='Your Virtue Skill Levels', hue=0x488 )
	# Race Selection
	gump.startGroup( 0 )
	# Virtue List
	gump.addText( x=35, y=35, text='Compassion', hue=0x846 )
	gump.addText( x=35, y=55, text='Honesty', hue=0x84d )
	gump.addText( x=35, y=75, text='Honor', hue=0x42f )
	gump.addText( x=35, y=95, text='Humility', hue=0x561 )
	gump.addText( x=35, y=115, text='Justice', hue=0x24b )
	gump.addText( x=35, y=135, text='Sacrifice', hue=0x84a )
	gump.addText( x=35, y=155, text='Spirituality', hue=0x84c )
	gump.addText( x=35, y=175, text='Valor', hue=0x555 )
	gump.addText( x=35, y=195, text='Chaos', hue=0x845 )
	# Virtue Values
	gump.addText( x=135, y=35, text="%s" % char.gettag( VIRTUES[COMPASSION][0] ), hue=0x846 )
	gump.addText( x=135, y=55, text="%s" % char.gettag( VIRTUES[HONESTY][0] ), hue=0x84d )
	gump.addText( x=135, y=75, text="%s" % char.gettag( VIRTUES[HONOR][0] ), hue=0x42f )
	gump.addText( x=135, y=95, text="%s" % char.gettag( VIRTUES[HUMILITY][0] ), hue=0x561 )
	gump.addText( x=135, y=115, text="%s" % char.gettag( VIRTUES[JUSTICE][0] ), hue=0x24b )
	gump.addText( x=135, y=135, text="%s" % char.gettag( VIRTUES[SACRIFICE][0] ), hue=0x84a )
	gump.addText( x=135, y=155, text="%s" % char.gettag( VIRTUES[SPIRITUALITY][0] ), hue=0x84c )
	gump.addText( x=135, y=175, text="%s" % char.gettag( VIRTUES[VALOR][0] ), hue=0x555 )
	gump.addText( x=135, y=195, text="%s" % char.gettag( VIRTUES[CHAOS][0] ), hue=0x845 )
	# Buttons
	gump.addButton( x=15, y=37, up=0x4ba, down=0x4b9, returncode=0 )
	gump.addButton( x=15, y=57, up=0x4ba, down=0x4b9, returncode=1 )
	gump.addButton( x=15, y=77, up=0x4ba, down=0x4b9, returncode=2 )
	gump.addButton( x=15, y=97, up=0x4ba, down=0x4b9, returncode=3 )
	gump.addButton( x=15, y=117, up=0x4ba, down=0x4b9, returncode=4 )
	gump.addButton( x=15, y=137, up=0x4ba, down=0x4b9, returncode=5 )
	gump.addButton( x=15, y=157, up=0x4ba, down=0x4b9, returncode=6 )
	gump.addButton( x=15, y=177, up=0x4ba, down=0x4b9, returncode=7 )
	gump.addButton( x=15, y=197, up=0x4ba, down=0x4b9, returncode=8 )
	gump.send( char )
	return True
示例#53
0
文件: npcs.py 项目: thooge/Wolfpack
def showmenuquest(player, id, npc):
    if player.socket:
        player.socket.closegump(TYPE_QUEST_GUMP)

    dialog = cGump(x=100, y=30, type=TYPE_QUEST_GUMP)

    dialog.addResizeGump(37, 14, 9260, 445, 422)
    dialog.addTiledGump(81, 35, 358, 386, 5124, 0)
    dialog.addTiledGump(55, 32, 30, 391, 10460, 0)
    dialog.addTiledGump(439, 32, 30, 391, 10460, 0)
    dialog.addGump(-12, 290, 10402, 0)
    dialog.addGump(53, 137, 10411, 0)
    dialog.addGump(95, 39, 9005, 0)
    dialog.addTiledGump(40, 421, 440, 17, 10100, 0)
    dialog.addTiledGump(39, 15, 440, 17, 10100, 0)
    dialog.addGump(4, 16, 10421, 0)
    dialog.addGump(21, 4, 10420, 0)
    dialog.addGump(449, 162, 10411, 0)
    dialog.addGump(449, 323, 10412, 0)
    dialog.addGump(394, 52, 1417, 0)
    dialog.addGump(449, 3, 10410, 0)
    dialog.addGump(402, 61, 9012, 0)
    dialog.addText(135, 49, "Quest Offer", 1149)
    dialog.addTiledGump(139, 69, 161, 2, 2432, 0)

    dialog.addText(167, 105, givequestname(id), 175)
    dialog.addText(103, 139, "Description (quest chain)", 175)

    dialog.addButton(340, 395, 12018, 12019, 0)  # Refuse
    dialog.addButton(105, 395, 12000, 12001, 1)  # Accept
    dialog.addButton(302, 365, 12009, 12010, 2)  # Continue

    dialog.addHtmlGump(104, 165, 329, 173,
                       '<basefont color="#C7D32C">' + givequestdescription(id),
                       0, 1)

    dialog.setArgs([npc, id])
    dialog.setCallback(questshowresponse)

    dialog.send(player)
示例#54
0
def DryDock( item, player ):

	boat = wolfpack.finditem(item.gettag('boat_serial'))

	socket = player.socket

	dialog = cGump( nomove=1, x=100, y=150 )

	dialog.addResizeGump(0, 0, 9200, 240, 159)
	dialog.addText(60, 10, "DryDock System", 0)
	dialog.addResizeGump(18, 39, 9350, 200, 70)
	dialog.addText(35, 50, "Do you really want to dock", 0)
	dialog.addText(35, 75, "your ship?", 0)
	dialog.addButton(40, 120, 247, 248, 1)
	dialog.addButton(130, 120, 241, 242, 0)

	dialog.setArgs( [boat] )
	dialog.setCallback( drydockresponse )

	dialog.send( player.socket )

	return True
示例#55
0
def BoatRename( item, player ):

	boat = wolfpack.finditem(item.gettag('boat_serial'))

	socket = player.socket

	dialog = cGump( nomove=1, x=100, y=150 )

	dialog.addResizeGump(0, 0, 9200, 240, 159)
	dialog.addText(60, 10, "Rename your Boat", 0)
	dialog.addResizeGump(18, 39, 9350, 200, 70)
	dialog.addText(25, 45, "New Boat name:", 0)
	dialog.addInputField(28, 75, 176, 20, 0, 1, boat.name)
	dialog.addButton(40, 120, 247, 248, 1)
	dialog.addButton(130, 120, 241, 242, 0)

	dialog.setArgs( [boat, item] )
	dialog.setCallback( renameresponse )

	dialog.send( player.socket )

	return True
示例#56
0
文件: rune.py 项目: thooge/Wolfpack
def onUse(char, item):
    # We only can rename marked runes
    if item.gettag('marked') != 1:
        char.socket.sysmessage(tr("This rune is not marked."))
        return True

    # We are only handling runes
    if not isrune(item):
        return 0

    # It needs to be on our body
    if item.getoutmostchar() != char:
        char.socket.sysmessage(
            tr("The rune needs to be in your posession to rename it."))
        return True

    gump = cGump(0, 0, 0, 50, 50)
    # Header
    gump.addBackground(0x24a4, 300, 200)
    gump.addTilePic(80, 33, 0x1F14)
    gump.addHtmlGump(
        10, 30, 300, 20,
        tr('<basefont size="7" color="#336699"><center>Rename rune</center></basefont>'
           ))

    # Rename Field
    gump.addHtmlGump(40, 60, 300, 20, tr('How do you like to name the rune?'))
    gump.addResizeGump(40, 80, 0x2486, 206, 26)
    gump.addInputField(43, 83, 200, 20, 0x539, 1, item.name)

    gump.addButton(43, 125, 2128, 2129, 1000)  # Ok
    gump.addButton(110, 125, 2119, 2120, 0)  # Cancel

    gump.setCallback(rename_callback)
    gump.setArgs([item])
    gump.send(char)

    return True
示例#57
0
文件: who.py 项目: thooge/Wolfpack
def details(char, player):
	if not player.socket:
		char.socket.sysmessage('The player is currently offline.')
		return

	pos = player.pos
	account = player.account
	# Socket Information
	gump = cGump( 0, 0, 0, 50, 50 )
	gump.addBackground( 0xE10, 440, 360 )
	gump.addResizeGump( 195, 280, 0xBB8, 205, 20 )
	gump.addCheckerTrans( 15, 15, 410, 330 )
	gump.addGump( 160, 18, 0xFA2 )
	gump.addText( 195, 20, unicode( "Socket Menu" ), 0x530 )
	gump.addText( 70, 320, unicode("Close"), 0x834 )
	gump.addButton( 30, 320, 0xFB1, 0xFB3, 0 )
	gump.startPage( 1 )
	gump.addText( 50, 60, unicode( "Char name:" ), 0x834 )
	gump.addText( 250, 60, unicode( "%s" % player.name ), 0x834 )
	gump.addText( 50, 80, unicode( "IP:" ), 0x834 )
	gump.addText( 250, 80, unicode( "%s" % player.socket.address ), 0x834 )
	gump.addText( 50, 100, unicode( "Position:" ), 0x834 )
	gump.addText( 250, 100, unicode( "%i,%i,%i,%i" % ( pos.x, pos.y, pos.z, pos.map ) ), 0x834 )
	gump.addText( 50, 120, unicode( "Region:" ), 0x834 )
	if player.region:
		gump.addText( 250, 120, unicode( "%s" % unicode(player.region.name) ), 0x834 )
	else:
		gump.addText( 250, 120, "Unknown", 0x834 )
	gump.addText( 50, 140, unicode( "Account / ACL:" ), 0x834 )
	gump.addText( 250, 140, unicode( "%s / %s" % ( account.name, account.acl) ), 0x834 )
	# Actions
	# Go To Char
	gump.addButton( 20, 180, 0xFA5, 0xFA7, 1 )
	gump.addText( 50, 180, unicode( "Go to position" ), 0x834 )
	# Bring Char
	gump.addButton( 20, 200, 0xFA5, 0xFA7, 2 )
	gump.addText( 50, 200, unicode( "Bring char" ), 0x834 )

	if not player.jailed:
		# Jail Char
		gump.addButton( 20, 220, 0xFA5, 0xFA7, 3 )
		gump.addText( 50, 220, unicode( "Jail char" ), 0x834 )
	else:
		# Forgive Char
		gump.addButton( 20, 220, 0xFA5, 0xFA7, 4 )
		gump.addText( 50, 220, unicode( "Forgive char" ), 0x834 )
	# Kill/resurrect Char
	if not player.dead:
		gump.addButton( 20, 240, 0xFA5, 0xFA7, 9 )
		gump.addText( 50, 240, unicode( "Kill char" ), 0x834 )
	else:
		gump.addButton( 20, 240, 0xFA5, 0xFA7, 10 )
		gump.addText( 50, 240, unicode( "Resurrect char" ), 0x834 )
	# Show Char Info Gump
	gump.addButton( 220, 180, 0xFAB, 0xFAD, 5 )
	gump.addText( 250, 180, unicode( "Show char info gump" ), 0x834 )
	# Send Message
	gump.addButton( 20, 280, 0xFBD, 0xFBF, 6 )
	gump.addText( 50, 280, unicode( "Send message:" ), 0x834 )
	gump.addInputField( 200, 280, 190, 16, 0x834, 1, unicode( "<msg>" ) )
	# Disconnect
	gump.addButton( 220, 200, 0xFA5, 0xFA7, 7 )
	gump.addText( 250, 200, unicode( "Disconnect" ), 0x834 )
	# Follow
	gump.addButton( 220, 220, 0xFA5, 0xFA7, 8 )
	gump.addText( 250, 220, unicode( "Follow char" ), 0x834 )

	# Get the installation from the client flags
	flags = player.socket.flags
	if flags & 0x10:
		installation = 'Samurai Empire'
	elif flags & 0x08:
		installation = 'Age of Shadows'
	elif flags & 0x04:
		installation = 'Blackthornes Revenge'
	elif flags & 0x02:
		installation = 'Third Dawn'
	elif flags & 0x01:
		installation = 'Renaissance'
	else:
		installation = 'The Second Age'

	# Client Version and Installation
	gump.addText( 150, 320, unicode( "Client: %s (%s)" % (player.socket.version, installation) ), 0x834 )

	# Stuff and Send
	gump.setCallback( callbackSocket )
	gump.setArgs( [ player.serial ] )
	gump.send( char.socket )
	return
示例#58
0
def selectAdvancedRace( char ):
	mysock = char.socket
	if char.gettag( 'race' ) == 'Human':
		# Race Gump
		gump = cGump( x=40, y=40, noclose=1, callback=evolution )
		# Default Background
		gump.startPage( 0 )
		gump.startPage( 1 )
		gump.addResizeGump( 0, 0, 0x2436, 300, 285 ) # Background
		text = '<basefont color="#FFFF00"><center><h3>Advanced Race Evolution</h3>'
		text += '</center><br/><basefont color="#FEFEFE">You\'ve been given a chance'
		text += ' to evolve.<br/><br/>You have two options:<br/>    '
		text += '1. Remain Human<br/>    2. Turn Undead.<br/><br/>    '
		text += 'Make this decision wisely...'
		gump.addHtmlGump( 20, 20, 260, 245, text )
		gump.addText( 85, 195, 'Undead Information', 0x835 )
		gump.addPageButton( 210, 195, 0x26af, 0x26b1, 2 )
		gump.startGroup( 0 )
		# Undead Button
		gump.addRadioButton( 20, 235, 0x25f8, 0x25fb, id=3 )
		gump.addText( 55, 240, 'Undead', 0x835 )
		# Evolve!
		gump.addButton( 150, 240, 0xf3, 0xf1, returncode=0 ) # Cancel Button
		gump.addButton( 220, 240, 0xf9, 0xf8, returncode=1 ) # Okay Button
		# Undead Information Page
		gump.startPage( 2 )
		gump.addResizeGump( 0, 0, 0x2436, 380, 445 ) # Background
		text = '<basefont color="#FFFF00"><center><h3>'
		text += 'Undead Information</h3></center><p><basefont color="#FEFEFE">'
		text += 'The Undead are.... Blah blah blah blah blah....'
		gump.addHtmlGump( 20, 20, 340, 405, text )
		gump.addPageButton( 300, 405, 0xf9, 0xf8, 1 ) # Okay Button
		# Send Gump!
		gump.send( char )
		return

	elif char.gettag( 'race' ) == 'Drow':
		gump = cGump( x=40, y=40, noclose=1, callback="shardscripts.races.raceselection.evolution" )
		# Default Background
		gump.startPage( 0 )
		gump.startPage( 1 )
		gump.addResizeGump( 0, 0, 0x2436, 300, 285 ) # Background
		text = '<basefont color="#FFFF00"><center><h3>Advanced Race Evolution</h3></center><p><basefont color="#FEFEFE">%s,<br>    You have been given a chance to evolve.<br>You have two options:<br>    Remain Human or Turn Undead.<p><i>Choose wisely...</i>' % (char.name)
		gump.addHtmlGump( 20, 20, 260, 145, text )
		gump.addText( 55, 180, 'Drow Information', 0x835 )
		gump.addPageButton( 180, 180, 0x26af, 0x26b1, 2 )
		gump.startGroup( 0 )
		# Drow Button
		gump.addRadioButton( 20, 235, 0x25f8, 0x25fb, id=4 )
		gump.addText( 55, 240, 'Drow', 0x835 )
		# Evolve!
		gump.addButton( 220, 240, 0xf3, 0xf1, returncode=0 ) # Cancel Button
		gump.addButton( 220, 240, 0xf9, 0xf8, returncode=1 ) # Okay Button
		# Human Information Page
		gump.startPage( 2 )
		gump.addResizeGump( 0, 0, 0x2436, 380, 445 ) # Background
		text = '<basefont color="#FFFF00"><center><h3>Drow Information</h3></center><p><basefont color="#FEFEFE">The Drow are.... Blah blah blah blah blah....'
		gump.addHtmlGump( 20, 20, 340, 405, text )
		gump.addPageButton( 300, 405, 0xf9, 0xf8, 1 ) # Okay Button
		# Send Gump!
		gump.send( char )
		return
示例#59
0
def showquestdetails(player, id, slot, page):
    if player.socket:
        player.socket.closegump(TYPE_QUEST_GUMP)

    dialog = cGump(x=100, y=30, type=TYPE_QUEST_GUMP)

    dialog.addResizeGump(37, 14, 9260, 445, 422)
    dialog.addTiledGump(81, 35, 358, 386, 5124, 0)
    dialog.addTiledGump(55, 32, 30, 391, 10460, 0)
    dialog.addTiledGump(439, 32, 30, 391, 10460, 0)
    dialog.addGump(-12, 290, 10402, 0)
    dialog.addGump(53, 137, 10411, 0)
    dialog.addGump(95, 39, 9005, 0)
    dialog.addTiledGump(40, 421, 440, 17, 10100, 0)
    dialog.addTiledGump(39, 15, 440, 17, 10100, 0)
    dialog.addGump(4, 16, 10421, 0)
    dialog.addGump(21, 4, 10420, 0)
    dialog.addGump(449, 162, 10411, 0)
    dialog.addGump(449, 323, 10412, 0)
    dialog.addGump(394, 52, 1417, 0)
    dialog.addGump(449, 3, 10410, 0)
    dialog.addGump(402, 61, 9012, 0)
    dialog.addTiledGump(139, 69, 161, 2, 2432, 0)

    dialog.addText(135, 49, "Quest Log", 1149)
    dialog.addText(167, 105, givequestname(id), 175)
    dialog.addText(103, 140, "Objective:", 175)
    dialog.addText(103, 160, "All of the following", 175)

    # Data
    npcdest = wolfpack.findchar(
        int(player.gettag('Quest.' + str(slot) +
                          '.NPCDest')))  # NPC to report Quest Back
    npclist = givequestnpctargets(id)  # Required NPCs
    npcamount = len(npclist)  # Amount of NPCs to be killed (Different types)
    eachnpcamount = givequestnpceachamount(id)  # Amount of each Required NPC
    eachnpcregion = givequestnpcregions(id)  # Region to Kill this NPC
    killedlist = player.gettag('Quest.' + str(slot) + '.ReqNPC').split(',')

    itemlist = givequestitemtargets(id)  # Required Items
    itemamount = len(
        itemlist)  # Amount of Items to be killed (Different types)
    eachitemamount = givequestitemeachamount(
        id)  # Amount of each Required Item

    # Construct dialog
    if page < npcamount:

        dialog.addText(103, 180, "Slay", 55)
        dialog.addText(145, 180, eachnpcamount[page], 90)
        dialog.addText(180, 180, givenpcname(npclist[page]), 1149)

        dialog.addText(145, 200, "Location", 55)
        if len(eachnpcregion):
            if eachnpcregion[page]:
                dialog.addText(260, 200, eachnpcregion[page], 1149)
            else:
                dialog.addText(260, 200, " --- ", 1149)
        else:
            dialog.addText(260, 200, " --- ", 1149)

        dialog.addText(145, 220, "Total", 55)
        dialog.addText(260, 220, killedlist[page], 90)

        dialog.addText(145, 240, "Return To", 55)
        if npcdest.region:
            dialog.addText(260, 240,
                           npcdest.name + " (" + npcdest.region.name + ")", 90)
        else:
            dialog.addText(260, 240, npcdest.name, 90)

        if (page + 1) < npcamount:
            dialog.addButton(302, 365, 12009, 12010, 3)  # Continue
        elif itemamount:
            dialog.addButton(302, 365, 12009, 12010, 3)  # Continue

    elif (page - npcamount) < itemamount:
        dialog.addText(103, 180, "Get", 55)
        dialog.addText(145, 180, eachitemamount[page - npcamount], 90)
        dialog.addText(180, 180, giveitemname(itemlist[page - npcamount]),
                       1149)

        dialog.addText(145, 220, "Total", 55)
        # Trying amount
        backpack = player.getbackpack()
        itemcount = backpack.countitems([itemlist[page - npcamount]])
        dialog.addText(260, 220, str(itemcount), 90)

        dialog.addText(145, 240, "Return To", 55)
        if npcdest.region:
            dialog.addText(260, 240,
                           npcdest.name + " (" + npcdest.region.name + ")", 90)
        else:
            dialog.addText(260, 240, npcdest.name, 90)

        if ((page - npcamount) + 1) < itemamount:
            dialog.addButton(302, 365, 12009, 12010, 3)  # Continue

    dialog.addButton(340, 395, 12012, 12013, 0)  # Okay
    dialog.addButton(105, 395, 12021, 12022, 1)  # Resign
    dialog.addButton(145, 365, 12015, 12016, 2)  # Previous

    dialog.setArgs([id, slot, page])
    dialog.setCallback(questdetailsresponse)

    dialog.send(player)
示例#60
0
文件: who.py 项目: thooge/Wolfpack
def showWhoGump(player, page):
	current_page = page

	# Collect the current list of sockets first
	wholist = []

	worldsocket = wolfpack.sockets.first()
	while worldsocket:
		char = worldsocket.player
		if not char:
			worldsocket = wolfpack.sockets.next()
			continue
		if char.invisible and char.rank > player.rank:
			worldsocket = wolfpack.sockets.next()
			continue
		if not char.account:
			wolfpack.sockets.next()
			continue
		wholist.append(char)
		worldsocket = wolfpack.sockets.next()

	count = len(wholist)

	# Skip page * 10 users
	newwholist = wholist[page * 10:]

	while len(newwholist) == 0 and page > 0:
		page -= 1
		newwholist = wholist[page * 10:]

	wholist = newwholist

	# Player list increases by 22 pixels
	pages = (count + 9) / 10 # 10 per page

	gump = cGump( 0, 0, 0, 50, 50 )
	gump.addBackground( 0xE10, 380, 360 )
	gump.addCheckerTrans( 15, 15, 350, 330 );
	gump.addGump( 130, 18, 0xFA8 )
	gump.addText( 165, 20, tr("Who Menu"), 0x530 )
	gump.addButton( 30, 320, 0xFB1, 0xFB3, 0 ) 	# Close Button
	gump.addText( 70, 320, tr("Close"), 0x834 )
	gump.addText( 145, 320, tr("Players: %u") % count, 0x834 )

	gump.addText( 280, 320, tr( "Page %i of %i" % ( page + 1, pages ) ), 0x834 )

	if page + 1 < pages:
		gump.addButton( 260, 320, 0x0FA, 0x0FA, 1 ) # Next Page

	if page > 0:
		gump.addButton( 240, 320, 0x0FC, 0x0FC, 2 ) # Previous Page

	offset = 22
	wholist = wholist[:10]
	for char in wholist:
		gump.addButton( 20, 40 + offset, 0xFA5, 0xFA7, 2 + char.serial )
		gump.addText( 54, 40 + offset, tr("%s [%s]") % ( char.name, char.account.name ), 0x834 )
		gump.addText( 257, 40 + offset, unicode(char.socket.address), 0x834 )
		offset += 24

	gump.setArgs( [ current_page ] )
	gump.setCallback( callbackWho )
	gump.send( player.socket )
	return