Esempio n. 1
0
def hostile_players():
    print "Declaring hostility to all players"
    players = craw.get_players()
    my_id = craw.get_player_id()
    players = filter(lambda player: player.id != my_id and player.level >= 9, players)
    packet = ""
    for player in players:
        packet += hostile_player_string(player.id)

    craw.send_packet(packet)
Esempio n. 2
0
	def cast_town_portal(self):
		if utility.town_check() != False:
			print 'You cannot open a town portal inside a town.'
			return False
			
		tome_id = craw.get_tp_tome_id()
		if tome_id == None:
			print 'Unable to cast a town portal because you have no non-empty Tome of Town Portal in your inventory'
			return False
			
		location = craw.get_player_location()
		if location == None:
			print 'Unable to retrieve the location of your character'
			return False
			
		x, y = location
			
		packet = chr(0x20) + utility.pack_number(tome_id, 4) + utility.pack_number(x, 4) + utility.pack_number(y, 4)
		craw.send_packet(packet)
		
		return True
Esempio n. 3
0
	def run(self):
		#print 'Entering TP %08x' % self.tp_entry.id
		x, y = self.tp_entry.location
		craw.send_packet('\x03' + utility.pack_number(x, 2) + utility.pack_number(y, 2))
		time.sleep(configuration.follow_portal_move_delay)
		portal_id = utility.pack_number(self.tp_entry.id, 4)
		craw.send_packet('\x04\x02\x00\x00\x00' + portal_id)
		time.sleep(configuration.follow_portal_interact_delay)
		craw.send_packet('\x13\x02\x00\x00\x00' + portal_id)
Esempio n. 4
0
def send_chat(message):
    # print 'Saying "%s"' % message
    packet = "\x15\x01\x00" + message + "\x00\x00\x00"
    craw.send_packet(packet)
Esempio n. 5
0
def enter_portal(portal_id):
    packet = chr(0x13) + utility.pack_number(2, 4) + utility.pack_number(portal_id, 4)
    craw.send_packet(packet)
Esempio n. 6
0
def hostile_player(id):
    craw.send_packet(hostile_player_string(id))
Esempio n. 7
0
def grant_loot_permission(player_id):
    packet = "\x5d\x01\x01" + utility.pack_number(player_id, 4)
    craw.send_packet(packet)
Esempio n. 8
0
def invite_player(player_id):
    packet = "\x5e\x06" + utility.pack_number(player_id, 4)
    craw.send_packet(packet)
Esempio n. 9
0
def accept_invitation(player_id):
    packet = "\x5e\x08" + utility.pack_number(player_id, 4)
    craw.send_packet(packet)
Esempio n. 10
0
def cast_skill_at_location(side, x, y):
    packet = chr(side) + utility.pack_number(x, 2) + utility.pack_number(y, 2)
    craw.send_packet(packet)
Esempio n. 11
0
def cast_skill_at_target(side, type, target):
    packet = chr(side) + utility.pack_number(type, 4) + utility.pack_number(target, 4)
    craw.send_packet(packet)
Esempio n. 12
0
def set_skill(skill, side):
    packet = "\x3c" + utility.pack_number(skill, 2) + "\x00" + chr(side) + "\xff\xff\xff\xff"
    craw.send_packet(packet)
Esempio n. 13
0
def flash_player(id):
	packet = '\x4b\x00\x00\x00\x00' + utility.pack_number(id, 4)
	craw.send_packet(packet)