rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
gump.addCheckerTrans(10, 10, 510, 397)
def details(self, player, arguments): if self.parent.gumptype != 0: player.socket.closegump(self.parent.gumptype, 0xFFFF)
elif response.button & 0x80000000: submenu = response.button & ~ 0x80000000
elif response.button & 0x01000000: submenu = response.button & ~ 0x01000000
def response(self, player, response, arguments): # Show a gump with the last 10 items the player made. if response.button == 1: self.makehistory(player, arguments)
gump.addButton(15, yoffset, 4005, 4007, 0x80000000 | (actions + j))
gump.addButton(15, yoffset, 4005, 4007, 0x01000000 | (actions + j))
def send(self, player, args = []): # Close gumps of the same type if self.gumptype != 0: player.socket.closegump(self.gumptype, 0xFFFF)
char.addscript('magic') char.action(self.castaction)
char.addscript('magic') if char.bodytype == BODY_HUMAN: char.action(self.castaction)
def precast(self, char, mode=0, args=[], target = None, item = None): socket = char.socket # Casting from a scroll and no scroll was passed if mode == MODE_SCROLL and not item: return # Casting from a wand and no wand was passed if mode == MODE_WAND and not item: return
return 0
return False if char.gm: return True
def checkrequirements(self, char, mode, args=[], target=None, item=None): if char.dead: return 0
socket.sysmessage('A item with the given name was not found.')
socket.sysmessage('An item with the given name was not found.')
def goitem(socket, command, arguments): if len(arguments) == 0: socket.sysmessage('Usage: goitem <name>') return items = wolfpack.itemiterator() item = items.first name = hash(arguments.lower()) found = [] while item: if hash(item.name.lower()) == name: found.append( item ) item = items.next if socket.hastag( "goi...
socket.sendcontainer(item.container)
if item.container.isitem(): socket.sendcontainer(item.container) """ \command gobaseid \usage - <code>gobaseid baseid</code> \description Go to the item found with the given baseid. \notes Use the command twice to go to the next item with the same baseid etc. """ def gobaseid(socket, command, arguments): if len(argume...
def goitem(socket, command, arguments): if len(arguments) == 0: socket.sysmessage('Usage: goitem <name>') return items = wolfpack.itemiterator() item = items.first name = hash(arguments.lower()) found = [] while item: if hash(item.name.lower()) == name: found.append( item ) item = items.next if socket.hastag( "goi...
socket.sendcontainer(item.container)
if item.container.isitem(): socket.sendcontainer(item.container)
def gouid(socket, command, arguments): try: uid = hex2dec(arguments) except: socket.symsessage('Usage: gouid <serial>') return if uid > 0x40000000: item = wolfpack.finditem(uid) if item: container = item.getoutmostitem() if container.container: container = container.container # Going to container socket.sysmessage('...
'woodenwall1': (buildWall, ('a6', 'a7', 'a8', 'a9')), 'woodenwall1small': (buildWall, ('b6', 'b8', 'b7', '13')), 'woodenwall1tiny': (buildWall, ('bd', 'be', 'bf', 'c0')),
'woodenwall2': (buildWall, ('a6', 'a7', 'a8', 'a9')), 'woodenwall2small': (buildWall, ('b6', 'b8', 'b7', '13')), 'woodenwall2tiny': (buildWall, ('bd', 'be', 'bf', 'c0')),
def buildRoofN(x1, x2, y1, y2, z, mapid, args): for x in range(x1, x2 + 1): roff = x2 - x loff = x - x1 # Which tile should we create? if roff == loff: itemid = args[2] tilez = z + loff * 3 elif loff < roff: itemid = args[0] tilez = z + loff * 3 else: itemid = args[1] tilez = z + roff * 3 for y in range(y1, y2 + 1): ...
duration = int(char.skill[MAGERY] * 200)
duration = int(300 + char.skill[MAGERY] * 100)
def cast(self, char, mode, args): if char.polymorph: if char.socket: char.socket.clilocmessage(1005559) return 0
item = wolfpack.additem(random.choice(RANDOM_MAGIC_ITEMS))
def createpack(char, killer, corpse, pack): if killer: luckChance = properties.luckchance(killer) else: luckChance = 0 # A pack is actually a list of lists for item in pack: packchance = item[ PACK_CHANCE ] packstackable = item[ PACK_STACKABLE ] packamount = item[ PACK_AMOUNT ] packitem = item[ PACK_ITEM ] spawn = Fa...
newitem.direction = 29
def target(self, char, mode, targettype, target, args, item): char.turnto(target)
potionexplosion( [ char.serial, item.serial, 4, item.amount ] )
potionexplosion( item, [ char.serial, 4] )
def onUse( char, item ): socket = char.socket # Potions need to be on your body to use them, or in arms reach. if item.getoutmostchar() != char: char.message( "This potion is out of your reach..." ) return False # Lets make sure the tag exists. if not item.hastag( 'potiontype' ): return False else: potiontype = item.g...
socket.sysmessage( 'Please select a target...', RED )
socket.sysmessage( 'You should throw this now!', RED )
def onUse( char, item ): socket = char.socket # Potions need to be on your body to use them, or in arms reach. if item.getoutmostchar() != char: char.message( "This potion is out of your reach..." ) return False # Lets make sure the tag exists. if not item.hastag( 'potiontype' ): return False else: potiontype = item.g...
throwobject(char, potion, pos, 1, 3, 5)
if potion: throwobject(char, potion, pos, 1, 3, 5)
def targetexplosionpotion(char, args, target): socket = char.socket potion = args[0] check = 10 if not potion: return 0 if target.char: if target.char.invulnerable: return 0 if target.char.dead: return 0 if not char.cansee(target.char): return 0 if char.distanceto(target.char) > check: return 0 if not char.canreach(tar...
counter = args[2] bonus = args[3]
counter = args[1] bonus = potion.amount
def potionexplosion( potion, args ): char = wolfpack.findchar(args[0]) counter = args[2] bonus = args[3] if not bonus: bonus = 1 if counter > 0: potion.addtimer( 1000, "potions.potioncountdown", [char.serial, counter, bonus] ) return else: potion.soundeffect(0x307) # Boom! potion.effect( explosions[randint( 0, 2 )], 20...
item.name = textentries[ key ]
if textentries[ key ] == '': item.name = str('') else: item.name = textentries[ key ]
def iteminfo_response( player, args, choice ): socket = player.socket item = args[0] if choice.button == 0 or not item or not socket: return True textentries = choice.text keys = textentries.keys() for key in keys: if key == 1: item.name = textentries[ key ] elif key == 2: item.id = int( hex2dec( textentries[ key ] )...
gem = createwoodgem()
gem = createwoodgem(target, pos)
def getvein( socket, pos, target ): #Check if we have wood_gems near ( range = 4) gems = wolfpack.items( pos.x, pos.y, pos.map, 4 ) for gem in gems: if wolfpack.finditem( gem.serial ): if gem.hastag('resource') and gem.gettag('resource') == 'wood' and gem.hastag('resname') and gem.id == hex2dec( 0x1ea7 ): return gem br...
if not char.checkskill( char, resource, LUMBERJACKING, 0 ):
if not char.checkskill( resource, LUMBERJACKING, 0 ):
def successlumberjacking( time, args ): char = args[0] pos = args[1] # Target POS resource = args[2] amount = args[3] tool = args[4] resname = args[5] table = args[6] socket = char.socket # Lets make sure we stayed next to the tree # Player can reach that ? if char.pos.map != pos.map or char.pos.distance( pos ) > chop...
socket.clilocmessage( 500118, "", 0x3b2, 3 )
char.socket.clilocmessage( 500118, "", 0x3b2, 3 )
def evaluatingintel( char, skill ): #Only Handle Evalint if skill != EVALUATINGINTEL: return False if char.socket.hastag( 'skill_delay' ): if wolfpack.time.currenttime() < char.socket.gettag( 'skill_delay' ): socket.clilocmessage( 500118, "", 0x3b2, 3 ) return True else: char.socket.deltag( 'skill_delay' ) char.socke...
damage = damage / char.distanceto(potion)
if char.distanceto(potion) > 1: damage = damage / char.distanceto(potion)
def potiondamage( char, target, potion, dmgbonus ): if potion.gettag('potiontype') == 11: damage = randint(POTION_LESSEREXPLOSION_RANGE[0], POTION_LESSEREXPLOSION_RANGE[1]) elif potion.gettag('potiontype') == 12: damage = randint(POTION_EXPLOSION_RANGE[0], POTION_EXPLOSION_RANGE[1]) elif potion.gettag('potiontype') == ...
char.socket.sysmessage( str(statics))
def response( char, args, target ): char.turnto(target.pos) if not char.canreach(target.pos, 4): char.socket.clilocmessage(500295) return item = wolfpack.finditem(args[0]) if not item: return if not item.hastag( 'resname' ): return False else: resname = item.gettag( 'resname' ) if target.item: targetitem = wolfpac...
if target.item.baseid in FORGEIDS:
if target.item and target.item.baseid in FORGEIDS:
def response( char, args, target ): char.turnto(target.pos) if not char.canreach(target.pos, 4): char.socket.clilocmessage(500295) return item = wolfpack.finditem(args[0]) if not item: return if not item.hastag( 'resname' ): return False else: resname = item.gettag( 'resname' ) if target.item: targetitem = wolfpac...
elif target.item.baseid in DEF_ORES:
elif target.item and target.item.baseid in DEF_ORES:
def response( char, args, target ): char.turnto(target.pos) if not char.canreach(target.pos, 4): char.socket.clilocmessage(500295) return item = wolfpack.finditem(args[0]) if not item: return if not item.hastag( 'resname' ): return False else: resname = item.gettag( 'resname' ) if target.item: targetitem = wolfpac...
damage = min(100, max(15, damage))
if damage > 75: damage = 75 elif damage < 15: damage = 15
def cast(self, char, mode, args=[], target=None, item=None): if not self.consumerequirements(char, mode, args, target, item): return targets = []
gump.addText( 250, 120, unicode( "%s" % unicode(player.region) ), 0x834 )
if player.region: gump.addText( 250, 120, unicode( "%s" % unicode(player.region.name) ), 0x834 ) else: gump.addText( 250, 120, "Unknown", 0x834 )
def callbackWho( char, args, choice ): socket = char.socket wholist = args[0] if choice.button == 0: return False elif wholist[ choice.button - 10 ]: player = wolfpack.findchar( wholist[ choice.button - 10 ] ) pos = player.pos account = player.account # Socket Information gump = cGump( 0, 0, 0, 50, 50 ) gump.addBackgro...
def cmdWho( socket, command, argstring ):
def cmdWho(socket, command, arguments): showWhoGump(socket.player, 0) def showWhoGump(player, page):
def onLoad(): wolfpack.registercommand( "who", cmdWho ) return
worldsocketcount = wolfpack.sockets.count()
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.addBackgro...
wholist += [ worldsocket.player.serial ]
char = worldsocket.player if char.invisible and char.rank > player.rank: continue if not char.account: continue wholist.append(char)
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.addBackgro...
if len(wholist) == 0: return False
count = len(wholist) newwholist = wholist[page * 10:] while len(newwholist) == 0 and page > 0: page -= 1 newwholist = wholist[page * 10:] wholist = newwholist
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.addBackgro...
gump.addText( 165, 20, unicode("Who Menu"), 0x530 ) gump.addButton( 30, 320, 0xFB1, 0xFB3, 0 ) gump.addText( 70, 320, unicode("Close"), 0x834 )
gump.addText( 165, 20, tr("Who Menu"), 0x530 ) gump.addButton( 30, 320, 0xFB1, 0xFB3, 0 ) gump.addText( 70, 320, tr("Close"), 0x834 ) gump.addText( 145, 320, tr("Players: %u") % count, 0x834 )
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.addBackgro...
maxpages = (worldsocketcount + 9) / 10 socket.sysmessage('Sockets: %u' % worldsocketcount) 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, ...
pages = (count + 9) / 10 player.socket.sysmessage(tr('Total sockets: %u') % count) gump.addText( 280, 320, tr( "Page %i of %i" % ( page + 1, pages ) ), 0x834 ) if page + 1 < pages: gump.addButton( 260, 320, 0x0FA, 0x0FA, 1 ) if page > 0: gump.addButton( 240, 320, 0x0FC, 0x0FC, 2 ) offset = 22 for item in wholist[:1...
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.addBackgro...
gump.send( socket ) return
gump.send( player.socket ) def callbackWho( char, args, choice ): page = args[0] if choice.button == 1: showWhoGump(char, page + 1) elif choice.button == 2 and page > 0: showWhoGump(char, page - 1) elif choice.button > 2: serial = choice.button - 2 player = wolfpack.findchar(serial) details(char, player)
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.addBackgro...
def callbackWho( char, args, choice ): wholist = args[0] if choice.button == 0: return False elif wholist[ choice.button - 10 ]: player = wolfpack.findchar( wholist[ choice.button - 10 ] ) details(char, player) return True else: return False
def callbackWho( char, args, choice ): wholist = args[0] if choice.button == 0: return False elif wholist[ choice.button - 10 ]: player = wolfpack.findchar( wholist[ choice.button - 10 ] ) details(char, player) return True else: return False
player.socket.clilocmessage()
player.socket.clilocmessage(500364)
def target(player, arguments, target): # Check the target if not target.item or target.item.id != 0xfab: player.socket.clilocmessage(500857) return # Needs to in our belongings if target.item.getoutmostchar() != player: player.socket.clilocmessage() return # Wear out the tools dyes = wolfpack.finditem(arguments[0]) i...
if len(arguments) > 0:
if len(args) > 0:
def adddecor( socket, command, args ): if len(arguments) > 0: args= str( args.strip() ) args = args.split( ' ' ) if len( args ) == 2: ( key, value ) = args # Tree Lists if key == 'tree': # Random Forest Trees if value == 'forest': if socket.hastag( 'last_tree_forest' ): templist = [] for choice in forestlist: if choice...
SPLASHFIRE: [2, 50, 2, False], SPLASHCOLD: [2, 50, 2, False], SPLASHPOISON: [2, 50, 2, False], SPLASHENERGY: [2, 50, 2, False],
def applyJuwelRandom(item, props, minintensity, maxintensity, luckchance): properties = JUWEL_PROPERTIES.keys() # Possible bonus skills skills = [SWORDSMANSHIP, FENCING, MACEFIGHTING, ARCHERY, WRESTLING, PARRYING, TACTICS, ANATOMY, HEALING, MAGERY, MEDITATION, EVALUATINGINTEL, MAGICRESISTANCE, TAMING, ANIMALLORE, VETE...
HITHARM: [2, 50, 2, False], HITFIREBALL: [2, 50, 2, False], HITLIGHTNING: [2, 50, 2, False], HITDISPEL: [2, 50, 2, False],
def applyJuwelRandom(item, props, minintensity, maxintensity, luckchance): properties = JUWEL_PROPERTIES.keys() # Possible bonus skills skills = [SWORDSMANSHIP, FENCING, MACEFIGHTING, ARCHERY, WRESTLING, PARRYING, TACTICS, ANATOMY, HEALING, MAGERY, MEDITATION, EVALUATINGINTEL, MAGICRESISTANCE, TAMING, ANIMALLORE, VETE...
return cmp(a.title, b.title)
return cmp(a.title.lower(), b.title.lower())
def comparetitle(a, b): return cmp(a.title, b.title)
havetamed = args[ 0 ]
havetamed = (args[ 0 ] == 1)
def callback( char, args ): if len( args ) < 2: return # animal = args[ 1 ] totame = wolfpack.findchar( args[ 1 ] ) if not totame: return if not char.socket: return # tamer dead : 502796 if char.dead: removetags( totame ) char.socket.clilocmessage( 502796, "", 0x3b2, 3, totame ) return # out of range : 502795 if no...
char.addtimer( TAMING_DURATION, callback, [ havetamed, totame.serial, num_try ] )
char.addtimer( TAMING_DURATION, callback, [ args[ 0 ], totame.serial, num_try ] )
def callback( char, args ): if len( args ) < 2: return # animal = args[ 1 ] totame = wolfpack.findchar( args[ 1 ] ) if not totame: return if not char.socket: return # tamer dead : 502796 if char.dead: removetags( totame ) char.socket.clilocmessage( 502796, "", 0x3b2, 3, totame ) return # out of range : 502795 if no...
female = ( speaker.id in PLAYER_BODIES_ALIVE_FEMALE )
female = ( char.id in PLAYER_BODIES_ALIVE_FEMALE )
def hairstyle_response(char, arguments, response): vendor = wolfpack.findchar(arguments[0]) if not vendor: return if response.button == 0 or len(response.switches) == 0 or response.switches[0] >= len(arguments[1]): vendor.say(1013009, "", "", False, vendor.saycolor, char.socket) return item = arguments[1][response.sw...
tooltip.add(1060410, str(durabilitybonus))
if durabilitybonus > 0: tooltip.add(1060410, '+' + str(durabilitybonus)) else: tooltip.add(1060410, str(durabilitybonus))
def onShowTooltip(viewer, object, tooltip): armor = properties.itemcheck(object, ITEM_ARMOR) weapon = properties.itemcheck(object, ITEM_WEAPON) shield = properties.itemcheck(object, ITEM_SHIELD) if (armor or weapon or shield) and object.amount == 1: # Reinsert the name if we need an ore prefix prefix1 = None if object...
physicaltotal -= unicode(char.gettag('dmg_fire'))
physicaltotal -= int(char.gettag('dmg_fire'))
def charinfo( socket, char ): if not char or not socket: return gump = wolfpack.gumps.cGump() gump.setCallback( "commands.info.charinfo_response" ) gump.setArgs( [char.serial] ) gump.startPage(0) gump.addResizeGump( 64, 34, 9260, 464, 462 ) #Background gump.addGump(30, 33, 10421, 0) gump.addGump(59, 22, 10420, 0) gum...
physicaltotal -= unicode(char.gettag('dmg_cold'))
physicaltotal -= int(char.gettag('dmg_cold'))
def charinfo( socket, char ): if not char or not socket: return gump = wolfpack.gumps.cGump() gump.setCallback( "commands.info.charinfo_response" ) gump.setArgs( [char.serial] ) gump.startPage(0) gump.addResizeGump( 64, 34, 9260, 464, 462 ) #Background gump.addGump(30, 33, 10421, 0) gump.addGump(59, 22, 10420, 0) gum...
physicaltotal -= unicode(char.gettag('dmg_poison'))
physicaltotal -= int(char.gettag('dmg_poison'))
def charinfo( socket, char ): if not char or not socket: return gump = wolfpack.gumps.cGump() gump.setCallback( "commands.info.charinfo_response" ) gump.setArgs( [char.serial] ) gump.startPage(0) gump.addResizeGump( 64, 34, 9260, 464, 462 ) #Background gump.addGump(30, 33, 10421, 0) gump.addGump(59, 22, 10420, 0) gum...
physicaltotal -= unicode(char.gettag('dmg_energy'))
physicaltotal -= int(char.gettag('dmg_energy'))
def charinfo( socket, char ): if not char or not socket: return gump = wolfpack.gumps.cGump() gump.setCallback( "commands.info.charinfo_response" ) gump.setArgs( [char.serial] ) gump.startPage(0) gump.addResizeGump( 64, 34, 9260, 464, 462 ) #Background gump.addGump(30, 33, 10421, 0) gump.addGump(59, 22, 10420, 0) gum...
if pet.attacktarget: pet.attacktarget = None if pet.war: pet.war = 0 pet.updateflags()
pet.attacktarget = None pet.war = 0 pet.updateflags() def startfight(pet, targetchar): pet.attacktarget = targetchar pet.war = 1 pet.updateflags()
def stopfight(pet): if pet.attacktarget: pet.attacktarget = None if pet.war: pet.war = 0 pet.updateflags()
elif pet and pet.owner == char and pet.distanceto(char) < 18:
if pet and pet.owner == char and pet.distanceto(char) < 18:
def follow_me(char, pet, all=0): if all: for follower in char.followers: follow_me(char, follower, 0) elif pet and pet.owner == char and pet.distanceto(char) < 18: stopfight(pet) pet.follow(char) pet.sound(SND_ATTACK)
if follower.distanceto(char) < 18: stopfight(follower) follower.guarding = None follower.goto(target.pos) follower.sound(SND_ATTACK)
go_target(char, [follower.serial, 0], target)
def go_target(char, arguments, target): (pet, all) = arguments if all: for follower in char.followers: if follower.distanceto(char) < 18: stopfight(follower) follower.guarding = None follower.goto(target.pos) follower.sound(SND_ATTACK) else: pet = wolfpack.findchar(pet) if pet and pet.owner == char and pet.distanceto(c...
char.socket.sysmessage('Please select a destination?')
char.socket.sysmessage('Please select a destination.')
def go(char, pet, all=0): char.socket.sysmessage('Please select a destination?') char.socket.attachtarget("speech.pets.go_target", [pet.serial, all])
char.socket.sysmessage('Your pets can''t attack that.')
char.socket.sysmessage('Your pets cannot attack that.')
def attack_target(char, arguments, target): if not target.char or target.char == char: char.socket.sysmessage('Your pets can''t attack that.') return (pet, all) = arguments if all: for follower in char.followers: follower.fight(target.char) follower.sound(SND_ATTACK) else: pet = wolfpack.findchar(pet) if pet and pet.o...
follower.fight(target.char) follower.sound(SND_ATTACK)
attack_target(char, [follower.serial, 0], target)
def attack_target(char, arguments, target): if not target.char or target.char == char: char.socket.sysmessage('Your pets can''t attack that.') return (pet, all) = arguments if all: for follower in char.followers: follower.fight(target.char) follower.sound(SND_ATTACK) else: pet = wolfpack.findchar(pet) if pet and pet.o...
if all: for follower in char.followers: if follower.distanceto(char) < 18: stopfight(follower) follower.guarding = None follower.follow(target.char) follower.sound(SND_ATTACK) else: pet = wolfpack.findchar(pet) if pet and pet.owner == char and pet.distanceto(char) < 18: stopfight(pet) pet.guarding = None pet.follow(tar...
pet = wolfpack.findchar(pet) if all: for follower in char.followers: go_target(char, [follower.serial, 0], target) elif pet and pet.owner == char and pet.distanceto(char) < 18: pet.guarding = None pet.follow(target.char) pet.sound(SND_ATTACK)
def follow_target(char, arguments, target): if not target.char: char.socket.sysmessage('Your pets can only follow characters.') return (pet, all) = arguments if all: for follower in char.followers: if follower.distanceto(char) < 18: stopfight(follower) follower.guarding = None follower.follow(target.char) follower.sou...
char.socket.sysmessage('Who do you want your pet to follow?')
if all == 1: char.socket.sysmessage('Who do you want your pets to follow?') else: char.socket.sysmessage('Who do you want your pet to follow?')
def follow(char, pet, all=0): char.socket.sysmessage('Who do you want your pet to follow?') char.socket.attachtarget("speech.pets.follow_target", [pet.serial, all])
return tile in range( 220, 231 ) + \ range( 236, 247 ) + \ range( 252, 263 ) + \ range( 268, 279 ) + \ range( 286, 297 ) + \ range( 321, 324 ) + \ range( 467, 474 ) + \ range( 476, 487 ) + \ range( 492, 495 ) + \ range( 543, 579 ) + \ range( 581, 621 ) + \ range( 700, 715 ) + \ range( 1339, 1359 ) + \ range( 1361, 1363...
return tile in range( 220, 232 ) + \ range( 236, 248 ) + \ range( 252, 264 ) + \ range( 268, 280 ) + \ range( 286, 298 ) + \ range( 321, 325 ) + \ range( 467, 475 ) + \ range( 476, 488 ) + \ range( 492, 496 ) + \ range( 543, 580 ) + \ range( 581, 614 ) + \ range( 1010, 1011 ) + \ range( 1741, 1758) + \ range( 1771, 179...
def ismountainorcave( tile ): return tile in range( 220, 231 ) + \ range( 236, 247 ) + \ range( 252, 263 ) + \ range( 268, 279 ) + \ range( 286, 297 ) + \ range( 321, 324 ) + \ range( 467, 474 ) + \ range( 476, 487 ) + \ range( 492, 495 ) + \ range( 543, 579 ) + \ range( 581, 621 ) + \ range( 700, 715 ) + \ range( 1339...
return tile in range( 22, 62 ) + \ range( 68, 75 ) + \ range( 286, 301 ) + \ range( 402, 402 ) + \ range( 424, 427 ) + \ range( 441, 465 ) + \ range( 642, 645 ) + \ range( 650, 657 ) + \ range( 821, 828 ) + \ range( 833, 836 ) + \ range( 845, 852 ) + \ range( 857, 860 ) + \ range( 951, 958...
return tile in range( 22, 63 ) + \ range( 68, 76 ) + \ range( 286, 302 ) + \ range( 402, 403 ) + \ range( 424, 428 ) + \ range( 441, 466 ) + \ range( 642, 646 ) + \ range( 650, 658 ) + \ range( 821, 829 ) + \ range( 833, 837 ) + \ range( 845, 853 ) + \ range( 857, 861 ) + \ range( 951, 959...
def issand( tile ): return tile in range( 22, 62 ) + \ range( 68, 75 ) + \ range( 286, 301 ) + \ range( 402, 402 ) + \ range( 424, 427 ) + \ range( 441, 465 ) + \ range( 642, 645 ) + \ range( 650, 657 ) + \ range( 821, 828 ) + \ range( 833, 836 ) + \ range( 845, 852 ) + \ range( 857, 860 ) +...
return tile in range( 25904, 25132 )
return tile in range( 25904, 25133 ) def istree( tile ): trees = [ 3221, 3222, 3230, 3242, 3274, 3275, 3276, 3277, 3230, 3242, 3274, 3280, 3283, 3286, 3288, 3290, 3293, 3296, 3299, 3302, 3320, 3323, 3326, 3329, 3393, 3415, 3416, 3417, 3418, 3419, 3438, 3439, 3440, 3441, 3442, 3460, 3461, 3462, 3476, 3480, 3484, 3486, ...
def iscrystal( tile ): return tile in range( 25904, 25132 )
socket.attachitemtarget( 'commands.addtree.createyewtree', yewindex, 0, 0, 0, [] )
socket.attachtarget( 'commands.addtree.createyewtree', [] )
def addtree(socket, command, arguments): if len(arguments) > 0: item = str( arguments.strip() ) if item == 'forest': if socket.hastag( 'last_foresttree' ): templist = [] for choice in forestlist: if choice != str( socket.gettag( 'last_foresttree' ) ): templist += [ choice ] item = random.choice( templist ) socket.setta...
elif item in jungletreeindex and item in jungleindex:
elif item in jungletreeindex:
def addtree(socket, command, arguments): if len(arguments) > 0: item = str( arguments.strip() ) if item == 'forest': if socket.hastag( 'last_foresttree' ): templist = [] for choice in forestlist: if choice != str( socket.gettag( 'last_foresttree' ) ): templist += [ choice ] item = random.choice( templist ) socket.setta...
i = 0 for text in self.texts: if text == data: return i else: i += 1
return self.texts.index(data)
def addRawText( self, data ): # Find the text if data in self.texts: i = 0 for text in self.texts: if text == data: return i else: i += 1 else: # Insert the text self.texts.append( data ) return len( self.texts ) - 1
if submaterial1amount == self.submaterial1:
if self.submaterial1 > 0 and submaterial1amount == self.submaterial1:
def checkmaterial(self, player, arguments, silent = 0): backpack = player.getbackpack()
player.socket.sysmessage(str(material))
def checkmaterial(self, player, arguments, silent = 0): backpack = player.getbackpack()
if target.secure:
if target.secured:
def target(self, char, mode, targettype, target, args, item): char.turnto(target)
player.socket.clilocmessage()
player.socket.clilocmessage(501661)
def onUse(player, stone): guild = None if stone.hastag('guild'): guild = wolfpack.findguild(int(stone.gettag('guild'))) if not guild: player.socket.sysmessage('This guildstone is abandoned.') else: if not player.cansee(stone) or not player.canreach(stone, 3): player.socket.clilocmessage() else: mainMenu(player, guild)...
items = countReagents(char.getbackpack(), self.reagents.copy())
def checkreagents(self, char, mode, args=[]): if not char.npc and len(self.reagents) > 0: items = countReagents(char.getbackpack(), self.reagents.copy()) if arcanegem.canConsumeCharges( char ): return True char.message(502630) return False
char.message(502630) return False
items = countReagents(char.getbackpack(), self.reagents.copy()) for item in items.keys(): if items[item] > 0: char.message(502630) return False return True
def checkreagents(self, char, mode, args=[]): if not char.npc and len(self.reagents) > 0: items = countReagents(char.getbackpack(), self.reagents.copy()) if arcanegem.canConsumeCharges( char ): return True char.message(502630) return False
char.socket.sysmessage(str(consumeReagents(char.getbackpack(), self.reagents.copy())))
def consumereagents(self, char, mode, args=[]): if not char.npc and len(self.reagents) > 0: lowerreagentcost = properties.fromchar(char, LOWERREAGENTCOST)
if member != player:
if member != player and member.socket:
def onLogin(player): if player.hastag('guildmessages'): count = int(player.gettag('guildmessages')) for i in range(0, count): name = 'guildmessage' + str(i) text = unicode(player.gettag(name)) player.socket.sysmessage(text) # Make sure that this event is removed as soon as we don't are in a guild anymore if not playe...
if newmap: socket.sysmesage( "Please select a target to move %i,%i,%i,%i" % ( xmod, ymod, zmod, newmap ) )
if newmap != None: socket.sysmessage( "Please select a target to move %i,%i,%i,%i" % ( xmod, ymod, zmod, newmap ) )
def commandMove( socket, cmd, args ): char = socket.player args = args.strip() if len(args) == 0: socket.sysmessage( "Moves an object relative to its current position." ) socket.sysmessage( "Usage: move [x]" ) socket.sysmessage( "Usage: move [x],[y]" ) socket.sysmessage( "Usage: move [x],[y],[z]" ) return False else: a...
targetitem = wolfpack.finditem( target.item.serial )
targetitem = target.item
def response( char, args, target ): char.turnto(target.pos) if not char.canreach(target.pos, 4): char.socket.clilocmessage(500295) return item = wolfpack.finditem(args[0]) if not item: return if not item.hastag( 'resname' ): return False else: resname = item.gettag( 'resname' ) if target.item: targetitem = wolfpac...
statics = wolfpack.statics(target.pos.x, target.pos.y, target.pos.map, True)
def response( char, args, target ): char.turnto(target.pos) if not char.canreach(target.pos, 4): char.socket.clilocmessage(500295) return item = wolfpack.finditem(args[0]) if not item: return if not item.hastag( 'resname' ): return False else: resname = item.gettag( 'resname' ) if target.item: targetitem = wolfpac...
else: char.socket.clilocmessage(501973) return
char.socket.clilocmessage(501973) return
def response( char, args, target ): char.turnto(target.pos) if not char.canreach(target.pos, 4): char.socket.clilocmessage(500295) return item = wolfpack.finditem(args[0]) if not item: return if not item.hastag( 'resname' ): return False else: resname = item.gettag( 'resname' ) if target.item: targetitem = wolfpac...
target.effect(0x36BD, 20, 10)
def potionregion( args ): char = args[0] potion = args[1] bonus = args[2] if potion.gettag('potiontype') == 11: outradius = 1 elif potion.gettag('potiontype') == 12: outradius = 2 elif potion.gettag('potiontype') == 13: outradius = randint(2,3) else: outradius = 1 # Potion Keg Radius Override! if potion.hastag('kegfill...
damage = damage / char.distanceto(potion) else: damage = damage / char.distanceto(char)
damage = (damage / char.distanceto(potion)) if damage >= (target.maxhitpoints / 2): target.effect(0x3709, 10, 30) target.effect(0x36BD, 20, 10)
def potiondamage( char, target, potion, dmgbonus ): if potion.gettag('potiontype') == 11: damage = randint(POTION_LESSEREXPLOSION_RANGE[0], POTION_LESSEREXPLOSION_RANGE[1]) elif potion.gettag('potiontype') == 12: damage = randint(POTION_EXPLOSION_RANGE[0], POTION_EXPLOSION_RANGE[1]) elif potion.gettag('potiontype') == ...
socket.attachtarget( "skills.fishing.response" )
socket.attachtarget( "skills.fishing.response", [ iserial ] )
def onUse( char, item ): socket = char.socket # Can't fish on horses if char.itemonlayer( LAYER_MOUNT ): socket.clilocmessage( 0x7A4EB, "", 0x3b2, 3 ) # You can't fish while riding! return True # Are we already fishing? if socket.hastag( 'is_fishing' ) and socket.gettag( 'is_fishing' ) > wolfpack.time.currenttime(): ...
char.addtimer( 5000, "skills.fishing.itemtimer", [ pos, deepwater ] )
char.addtimer( 5000, "skills.fishing.itemtimer", [ pos, deepwater, args[0] ] )
def response( char, args, target ): socket = char.socket pos = target.pos # First: Check Distance (easiest) if char.pos.map != pos.map or char.pos.distance( pos ) > FISHING_MAX_DISTANCE: socket.clilocmessage( 0x7a4f0, "", 0x3b2, 3, char ) # You need to be closer to the water to fish! return # Second: Check Map/Static...
return 0 socket = char.socket
return False
def itemtimer( char, args ): if len( fishingItems ) < 1: socket.sysmessage( 'This script has not been configured correctly.' ) return 0 socket = char.socket socket.deltag( 'is_fishing' ) if len( args ) != 2: return # Is there any fish left there? (8x8 grid) resource = findResourceGem( args[0] ) if resource: amount ...
if len( args ) != 2:
if len( args ) != 3:
def itemtimer( char, args ): if len( fishingItems ) < 1: socket.sysmessage( 'This script has not been configured correctly.' ) return 0 socket = char.socket socket.deltag( 'is_fishing' ) if len( args ) != 2: return # Is there any fish left there? (8x8 grid) resource = findResourceGem( args[0] ) if resource: amount ...
if not wolfpack.tobackpack(weapon, char):
if not utilities.tobackpack(weapon, char):
def checkweapon(self, char): weapon = char.itemonlayer(LAYER_RIGHTHAND) if not weapon or not properties.itemcheck(weapon, ITEM_WEAPON): weapon = char.itemonlayer(LAYER_LEFTHAND) if not weapon: return True # Check if the spellchanneling property is true for this item if not properties.fromitem(weapon, SPELLCHANNELING...
char.message(str(castspeed / 4.0))
def calcdelay(self, char, mode): # Wands and commands don't have a delay if mode == MODE_WAND or mode == MODE_CMD: return 0 # Get the AOS bonus from all items the character wears castspeed = 3 - properties.fromchar(char, CASTSPEEDBONUS) # Under the influence of the protection spell # spells are cast more slowly if ch...
char.message(str(delay))
def setspelldelay(self, char, mode): if char.npc: pass elif char.socket: castrecovery = - properties.fromchar(char, CASTRECOVERYBONUS) castrecovery += 6 castrecovery += self.castrecovery if castrecovery < 0: castrecovery = 0
while( runes[ runenum ] > -1 ):
while( runenum < 16 and runes[ runenum ] > -1 ):
def sendGump( char, item ): char.socket.closegump( 0x87654322 ) char.soundeffect( 0x55 ) runebook = cGump( 0, 0, 0, 100, 120 ) runebook.startPage( 0 ) runebook.addGump( 100, 10, 2200 ) # decoration bar n = 125 m = 0 for i in range( 0, 16 ): if( i == 8 ): n = 170 if( i % 8 == 0 ): m = 57 elif( i % 8 == 7 ): m = 59 el...
return 0
return False
def peacemaking( char, skill ): if skill != PEACEMAKING: return 0 if char.socket.hastag( 'skill_delay' ): if wolfpack.time.currenttime() < char.socket.gettag( 'skill_delay' ): char.socket.clilocmessage( 500118, "", 0x3b2, 3 ) return 1 else: char.socket.deltag( 'skill_delay' ) # check instrument in backpack backpack =...
return 1
return True
def peacemaking( char, skill ): if skill != PEACEMAKING: return 0 if char.socket.hastag( 'skill_delay' ): if wolfpack.time.currenttime() < char.socket.gettag( 'skill_delay' ): char.socket.clilocmessage( 500118, "", 0x3b2, 3 ) return 1 else: char.socket.deltag( 'skill_delay' ) # check instrument in backpack backpack =...
return 1
char.socket.clilocmessage( 500617, "", 0x3b2, 3 ) char.socket.attachtarget( "skills.peacemaking.selectinstrument", [items] ) return True selecttarget( char, items )
def peacemaking( char, skill ): if skill != PEACEMAKING: return 0 if char.socket.hastag( 'skill_delay' ): if wolfpack.time.currenttime() < char.socket.gettag( 'skill_delay' ): char.socket.clilocmessage( 500118, "", 0x3b2, 3 ) return 1 else: char.socket.deltag( 'skill_delay' ) # check instrument in backpack backpack =...
return 0
return False
def response( char, args, target ): if not char.socket.hastag( 'peacemaking_instrument' ): return 0 # you can only target chars if not target.char: return 1 instrument = wolfpack.finditem( char.socket.gettag( 'peacemaking_instrument' ) ) if not instrument: return 0 if skills.skilltable[ PEACEMAKING ][ skills.UNHIDE ] ...
return 1
return True
def response( char, args, target ): if not char.socket.hastag( 'peacemaking_instrument' ): return 0 # you can only target chars if not target.char: return 1 instrument = wolfpack.finditem( char.socket.gettag( 'peacemaking_instrument' ) ) if not instrument: return 0 if skills.skilltable[ PEACEMAKING ][ skills.UNHIDE ] ...
musicianship.play_instrument( char, instrument, result )
skills.musicianship.play_instrument( char, instrument, result )
def response( char, args, target ): if not char.socket.hastag( 'peacemaking_instrument' ): return 0 # you can only target chars if not target.char: return 1 instrument = wolfpack.finditem( char.socket.gettag( 'peacemaking_instrument' ) ) if not instrument: return 0 if skills.skilltable[ PEACEMAKING ][ skills.UNHIDE ] ...
circle = self.circle else: circle = self.circle - 2
circle = self.circle - 1 else: circle = self.circle - 3
def consumerequirements(self, char, mode, args=[], target=None, item=None): if char.gm: return True
if char.skill < reqskill:
if char.skill[MINING] < reqskill:
def domining(char, args): char.soundeffect( random.choice([0x125, 0x126]) ) tool = wolfpack.finditem(args[0]) pos = args[1] socket = char.socket socket.deltag( 'is_mining' ) if not tool: return False # Recheck distance #if not char.canreach(pos, MINING_MAX_DISTANCE): # socket.clilocmessage(501867) # return False # F...
char, type ):
def tobard( char, type ):
def playinstrument( char, item, how ): socket = char.socket # Instrument ID: [ Success Sound, Fail Sound ] instruments = { 0xE9C:[ 0x38, 0x39 ],# Drum 0xE9D:[ 0x52, 0x53 ],# Tambourine 0xE9E:[ 0x52, 0x53 ],# Tambourine with tassle 0xEB1:[ 0x43, 0x44 ],# Standing Harp 0xEB2:[ 0x45, 0x46 ],# Harp 0xEB3:[ 0x4C, 0x4D ],# L...
addtobook(char, cont, item)
return addtobook(char, cont, item)
def onDropOnItem( cont, item ): # Who is dragging us? char = item.container if not char.ischar(): return False addtobook(char, cont, item)
char.updatestats()
def onEquip( char, item, layer ): # Boni? if item.hastag( 'boni_str' ): char.strength = char.strength + int( item.gettag( 'boni_str' ) ) if item.hastag( 'boni_dex' ): char.dexterity = char.dexterity + int( item.gettag( 'boni_dex' ) ) if item.hastag( 'boni_int' ): char.intelligence = char.intelligence + int( item.gett...
ischecked(char, item)
ischecked(player, char, item)
def onDropOnChar(char, item): # See if it's not hostile if char.npc and char.id < 0x190: player = item.container if char.tamed and (char.owner == player) or isPetFriend(player, char) : if checkfoodpreference(char, item): ischecked(char, item) else: return False return True
def ischecked(char, item):
def ischecked(player, char, item):
def ischecked(char, item): amount = item.amount if amount > 0: happier = False stamGain = 0 if item.baseid == 'eed': stamGain = amount - 50 else: stamGain = (amount * 15) - 50 if stamGain > 0: char.stamina += stamGain for i in range(0, amount): loyalty = 0 if char.hastag('loyalty'): loyalty = char.gettag('loyalty') # i...
gump.addButton( 120, 340, 0xF9, 0xF8, 0 )
gump.addButton( 120, 340, 0xF9, 0xF8, -1 )
def charinfo( socket, char ): if not char or not socket: return page_ = 0 pages = 0 if char.npc: pages = 5 else: pages = 5 gump = cGump( 0, 0, 0, 0, 40 ) gump.setCallback( "commands.info.charinfo_response" ) gump.setArgs( [char] ) gump.startPage( page_ ) gump.addResizeGump( 0, 40, 0xA28, 450, 350 ) # Background gump...
gump.addButton( 190, 340, 0xF3, 0xF1, -1 )
gump.addButton( 190, 340, 0xF3, 0xF1, 0 )
def charinfo( socket, char ): if not char or not socket: return page_ = 0 pages = 0 if char.npc: pages = 5 else: pages = 5 gump = cGump( 0, 0, 0, 0, 40 ) gump.setCallback( "commands.info.charinfo_response" ) gump.setArgs( [char] ) gump.startPage( page_ ) gump.addResizeGump( 0, 40, 0xA28, 450, 350 ) # Background gump...
if choice.button == -1 or not char or not socket:
if choice.button == 0 or not char or not socket:
def charinfo_response( player, args, choice ): socket = player.socket char = args[0] if choice.button == -1 or not char or not socket: return 1 textentries = choice.text keys = textentries.keys() for key in keys: if key == 1: char.name = textentries[ key ] elif key == 2: char.title = textentries[ key ] elif key == 3:...
gump.addButton( 120, 340, 0xF9, 0xF8, 0 )
gump.addButton( 120, 340, 0xF9, 0xF8, -1 )
def iteminfo( socket, item ): if not socket or not item: return 0 page_ = 0 pages = 5 gump = cGump( 0, 0, 0, 0, 40 ) gump.setCallback( "commands.info.iteminfo_response" ) gump.setArgs( [item] ) gump.startPage( page_ ) gump.addResizeGump( 0, 40, 0xA28, 450, 350 ) #Background gump.addGump( 105, 18, 0x58B ) # Fancy top...