def stel(world_session, args): try: tel_name = args.split()[0] except IndexError: return -1, 'please specify a location name to start searching.' locations = WorldDatabaseManager.worldport_get_by_name(tel_name, return_all=True) for location in locations: port_text = f'|cFF00FFFF[Map {location.map}]|r - {location.name}' ChatManager.send_system_message(world_session, port_text) return 0, f'{len(locations)} worldports found.'
def tel(world_session, args): try: tel_name = args.split()[0] except IndexError: return -1, 'please specify a location name.' location = WorldDatabaseManager.worldport_get_by_name(tel_name) if location: tel_location = Vector(location.x, location.y, location.z) world_session.player_mgr.teleport(location.map, tel_location) return 0, 'Teleported to "%s".' % location.name return -1, '"%s" not found.' % tel_name
def tel(world_session, args): try: tel_name = args.split()[0] except IndexError: return -1, 'please specify a location name.' location = WorldDatabaseManager.worldport_get_by_name(tel_name) if location: tel_location = Vector(location.x, location.y, location.z, location.o) success = world_session.player_mgr.teleport(location.map, tel_location) if success: return 0, f'Teleported to "{location.name}".' return -1, f'map not found ({location.map}).' return -1, f'"{tel_name}" not found.'